/**
 * DSI Global Notification System Styles
 * Enhanced version with animations, accessibility, and brand colors
 * @version 2.0.0
 */

/* =====================================================
 * WRAPPER & POSITIONING
 * ===================================================== */

.dsi-notifications-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    pointer-events: none;
}

.dsi-notifications-position {
    position: fixed;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    pointer-events: none;
    max-height: 100vh;
    overflow: hidden;
}

/* Position variants */
.dsi-notifications--top-right {
    top: 0;
    right: 0;
    align-items: flex-end;
}

.dsi-notifications--top-left {
    top: 0;
    left: 0;
    align-items: flex-start;
}

.dsi-notifications--bottom-right {
    bottom: 0;
    right: 0;
    align-items: flex-end;
}

.dsi-notifications--bottom-left {
    bottom: 0;
    left: 0;
    align-items: flex-start;
}

.dsi-notifications--center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    align-items: center;
    justify-content: center;
}

/* =====================================================
 * NOTIFICATION CARD
 * ===================================================== */

.dsi-notification {
    position: relative;
    display: flex;
    flex-direction: column;
    margin: 0.5rem 0;
    padding: 0;
    border-radius: 8px;
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.07),
        0 2px 4px rgba(0, 0, 0, 0.05),
        0 10px 20px rgba(0, 0, 0, 0.1);
    pointer-events: auto;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 320px;
    max-width: 450px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    overflow: hidden;
    animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dsi-notification:hover {
    box-shadow:
        0 6px 12px rgba(0, 0, 0, 0.1),
        0 4px 6px rgba(0, 0, 0, 0.08),
        0 15px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* =====================================================
 * NOTIFICATION CONTENT
 * ===================================================== */

.dsi-notification__content {
    display: flex;
    align-items: flex-start;
    padding: 1rem 1.25rem;
    width: 100%;
}

.dsi-notification__icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    margin-right: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dsi-notification__icon svg {
    width: 100%;
    height: 100%;
}

.dsi-notification__body {
    flex: 1;
    min-width: 0;
}

.dsi-notification__title {
    font-weight: 600;
    font-size: 0.9375rem;
    line-height: 1.4;
    margin-bottom: 0.25rem;
    color: #1a1a1a;
}

.dsi-notification__message {
    font-size: 0.875rem;
    line-height: 1.5;
    color: #4a4a4a;
    word-wrap: break-word;
}

.dsi-notification__close {
    flex-shrink: 0;
    background: none;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    padding: 0;
    margin-left: 0.75rem;
    color: #666;
    font-size: 1.5rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.dsi-notification__close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #333;
}

.dsi-notification__close:focus {
    outline: 2px solid #119fb4;
    outline-offset: 2px;
}

.dsi-notification__close:active {
    transform: scale(0.95);
}

/* =====================================================
 * PROGRESS BAR
 * ===================================================== */

.dsi-notification__progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.dsi-notification__progress-bar {
    height: 100%;
    width: 100%;
    background: currentColor;
    transform-origin: left;
}

/* =====================================================
 * TYPE COLORS (DSI BRAND)
 * ===================================================== */

/* Success - Primary Brand Color */
.dsi-notification--success {
    border-left: 4px solid #119fb4;
}

.dsi-notification--success .dsi-notification__icon {
    color: #119fb4;
}

.dsi-notification--success .dsi-notification__progress-bar {
    background: #119fb4;
}

/* Error - Danger Red */
.dsi-notification--error {
    border-left: 4px solid #e23333;
}

.dsi-notification--error .dsi-notification__icon {
    color: #e23333;
}

.dsi-notification--error .dsi-notification__progress-bar {
    background: #e23333;
}

/* Warning - Orange */
.dsi-notification--warning {
    border-left: 4px solid #ff9800;
}

.dsi-notification--warning .dsi-notification__icon {
    color: #ff9800;
}

.dsi-notification--warning .dsi-notification__progress-bar {
    background: #ff9800;
}

/* Info - Alternative Brand Color */
.dsi-notification--info {
    border-left: 4px solid #12a8be;
}

.dsi-notification--info .dsi-notification__icon {
    color: #12a8be;
}

.dsi-notification--info .dsi-notification__progress-bar {
    background: #12a8be;
}

/* =====================================================
 * ANIMATIONS
 * ===================================================== */

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(100%);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Animation classes for different positions */
.dsi-notifications--top-left .dsi-notification {
    animation: slideInLeft 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dsi-notifications--bottom-right .dsi-notification {
    animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dsi-notifications--bottom-left .dsi-notification {
    animation: slideInLeft 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dsi-notifications--center .dsi-notification {
    animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =====================================================
 * ACCESSIBILITY
 * ===================================================== */

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus visible for keyboard navigation */
.dsi-notification:focus-within {
    outline: 2px solid #119fb4;
    outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .dsi-notification {
        animation: none;
        transition: opacity 0.2s ease;
    }

    .dsi-notification__progress-bar {
        transition: none;
    }
}

/* =====================================================
 * DARK MODE SUPPORT
 * ===================================================== */

/*@media (prefers-color-scheme: dark) {
    .dsi-notification {
        background: #2d2d2d;
        border-color: rgba(255, 255, 255, 0.1);
        box-shadow: 
            0 4px 6px rgba(0, 0, 0, 0.3),
            0 2px 4px rgba(0, 0, 0, 0.2);
    }
    
    .dsi-notification:hover {
        box-shadow: 
            0 6px 12px rgba(0, 0, 0, 0.4),
            0 4px 6px rgba(0, 0, 0, 0.3);
    }
    
    .dsi-notification__title {
        color: #ffffff;
    }
    
    .dsi-notification__message {
        color: #c4c4c4;
    }
    
    .dsi-notification__close {
        color: #aaa;
    }
    
    .dsi-notification__close:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #fff;
    }
    
    .dsi-notification__progress {
        background: rgba(255, 255, 255, 0.1);
    }
}*/

/* =====================================================
 * RESPONSIVE DESIGN
 * ===================================================== */

/* Tablets and below */
@media (max-width: 768px) {
    .dsi-notifications-position {
        padding: 0.75rem;
        left: 0;
        right: 0;
        width: 100%;
    }

    .dsi-notification {
        min-width: 280px;
        max-width: calc(100vw - 1.5rem);
        margin: 0.375rem 0;
    }

    .dsi-notification__content {
        padding: 0.875rem 1rem;
    }

    .dsi-notification__title {
        font-size: 0.875rem;
    }

    .dsi-notification__message {
        font-size: 0.8125rem;
    }

    /* Stack notifications on mobile */
    .dsi-notifications--top-right,
    .dsi-notifications--top-left {
        left: 0;
        right: 0;
        align-items: stretch;
    }

    .dsi-notifications--bottom-right,
    .dsi-notifications--bottom-left {
        left: 0;
        right: 0;
        align-items: stretch;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .dsi-notifications-position {
        padding: 0.5rem;
    }

    .dsi-notification {
        min-width: 100%;
        max-width: 100%;
        margin: 0.25rem 0;
        border-radius: 6px;
    }

    .dsi-notification__content {
        padding: 0.75rem 0.875rem;
    }

    .dsi-notification__icon {
        width: 20px;
        height: 20px;
        margin-right: 0.625rem;
    }
}

/* =====================================================
 * PRINT STYLES
 * ===================================================== */

@media print {
    .dsi-notifications-wrapper {
        display: none;
    }
}

/* =====================================================
 * HIGH CONTRAST MODE
 * ===================================================== */

@media (prefers-contrast: high) {
    .dsi-notification {
        border-width: 2px;
    }

    .dsi-notification__close:focus {
        outline-width: 3px;
    }
}





/********************************************************/

/* =====================================================
 * CONFIRMATION DIALOGS
 * ===================================================== */

.dsi-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 1rem;
}

.dsi-confirm-overlay.show {
    opacity: 1;
}

.dsi-confirm-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 100%;
    transform: scale(0.9) translateY(-20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

.dsi-confirm-container.show {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Header */
.dsi-confirm-header {
    padding: 2rem 2rem 1rem;
    text-align: center;
    border-bottom: 1px solid #e1e8ed;
}

.dsi-confirm-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dsi-confirm-icon--info {
    background: rgba(18, 168, 190, 0.1);
    color: #12a8be;
}

.dsi-confirm-icon--success {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.dsi-confirm-icon--warning {
    background: rgba(255, 152, 0, 0.1);
    color: #ff9800;
}

.dsi-confirm-icon--danger {
    background: rgba(226, 51, 51, 0.1);
    color: #e23333;
}

.dsi-confirm-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

/* Body */
.dsi-confirm-body {
    padding: 1.5rem 2rem;
}

.dsi-confirm-message {
    font-size: 1rem;
    line-height: 1.6;
    color: #4a4a4a;
    margin: 0;
    text-align: center;
}

.dsi-confirm-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 1rem;
    margin-top: 1rem;
    transition: all 0.2s ease;
}

.dsi-confirm-input:focus {
    outline: none;
    border-color: #119fb4;
    box-shadow: 0 0 0 4px rgba(17, 159, 180, 0.1);
}

.dsi-confirm-input--error {
    border-color: #e23333;
    animation: shake 0.4s ease;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    75% {
        transform: translateX(10px);
    }
}

/* Footer */
.dsi-confirm-footer {
    padding: 1rem 2rem 2rem;
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

/* Buttons */
.dsi-confirm-btn {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
}

.dsi-confirm-btn--cancel {
    background: #f8f9fa;
    color: #6c757d;
    border: 2px solid #e1e8ed;
}

.dsi-confirm-btn--cancel:hover {
    background: #e9ecef;
    border-color: #ced4da;
}

.dsi-confirm-btn--confirm {
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dsi-confirm-btn--primary {
    background: #119fb4;
}

.dsi-confirm-btn--primary:hover {
    background: #0d8399;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(17, 159, 180, 0.3);
}

.dsi-confirm-btn--danger {
    background: #e23333;
}

.dsi-confirm-btn--danger:hover {
    background: #c92a2a;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(226, 51, 51, 0.3);
}

.dsi-confirm-btn--success {
    background: #28a745;
}

.dsi-confirm-btn--success:hover {
    background: #218838;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.dsi-confirm-btn--warning {
    background: #ff9800;
}

.dsi-confirm-btn--warning:hover {
    background: #f57c00;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 152, 0, 0.3);
}

.dsi-confirm-btn:focus {
    outline: 2px solid #119fb4;
    outline-offset: 2px;
}

.dsi-confirm-btn:active {
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    .dsi-confirm-container {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }

    .dsi-confirm-header,
    .dsi-confirm-body {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .dsi-confirm-footer {
        flex-direction: column;
        padding: 1rem 1.5rem 1.5rem;
    }

    .dsi-confirm-btn {
        width: 100%;
    }
}


/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

    .dsi-confirm-overlay,
    .dsi-confirm-container,
    .dsi-confirm-btn {
        transition: none !important;
        animation: none !important;
    }
}