/**
 * =============================================================================
 * Global Notification Modal Styles
 * =============================================================================
 * 
 * Styles for the centralized notification modal system that matches
 * the application's design theme.
 * 
 * Features:
 * - Success/Info: Dropdown notifications at top of screen (non-blocking)
 * - Error/Warning: Full-screen modal with backdrop (blocking)
 * - Textured background matching site theme
 * - Smooth animations for modal entry
 * - Themed button colors (#2d8998 teal)
 * - Responsive design for mobile devices
 * - Dark mode support
 * - Type-specific title colors (success, error, warning, info)
 * 
 * @module notification-styles
 * =============================================================================
 */

/* ============================================================================
   Modal Backdrop and Container
   ============================================================================ */

#notificationModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 100001;
    /* Above Product Details modal (4000) and all other modals */
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Show state - uses flexbox display */
#notificationModal.show {
    display: flex !important;
}

/* ============================================================================
   Modal Content Box
   ============================================================================ */

#notificationModal .notification-content {
    /* Background with noise texture matching site theme */
    background-image: url("../../images/bg_noise.webp"), linear-gradient(180deg, var(--color-bg-gradient-top, #f8f8f7), var(--color-bg-gradient-bottom, #f1f0ee));
    background-position: 0 0, 0 0;
    background-size: auto, auto;
    border: 1px solid var(--color-border, #dddfe0);
    border-radius: var(--radius-2xl, 1.25rem);
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-xl, 0 10px 40px rgba(0, 0, 0, 0.3));
    position: relative;
    animation: notificationSlideIn 0.3s ease-out;
}

/* Smooth slide-in animation */
@keyframes notificationSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }

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

/* ============================================================================
   Modal Header (Title Only - No Icons)
   ============================================================================ */

#notificationModal .notification-header {
    margin-bottom: 1rem;
    text-align: center;
}

#notificationModal .notification-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    color: var(--color-text-primary, #2c3e50);
}

/* ============================================================================
   Modal Body (Message Text)
   ============================================================================ */

#notificationModal .notification-body {
    color: var(--color-text-secondary, #555);
    font-size: 1rem;
    white-space: pre-line;
    /* Preserve newlines and wrap text */
    line-height: 1.6;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* ============================================================================
   Modal Footer (Action Buttons)
   ============================================================================ */

#notificationModal .notification-footer {
    display: flex;
    justify-content: center;
    gap: 12px;
}

/* Base button styles */
#notificationModal .notification-btn {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
}

/* Primary button - uses theme teal color */
#notificationModal .notification-btn-primary {
    background: var(--color-primary, #2d8998);
    color: white;
}

/* Countdown text styling - less visible and not bold */
#notificationModal .notification-btn-primary .countdown-text {
    font-weight: normal;
    opacity: 0.7;
    font-size: 0.9em;
}

#notificationModal .notification-btn-primary:hover {
    background: var(--color-primary-dark, #246b78);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(45, 137, 152, 0.4);
}

#notificationModal .notification-btn-primary:active {
    transform: translateY(0);
    background: var(--color-primary-darkest, #1d5561);
}

/* Secondary button (for future use) */
#notificationModal .notification-btn-secondary {
    background: #e5e7eb;
    color: #4a4a4a;
}

#notificationModal .notification-btn-secondary:hover {
    background: #d1d5db;
}

/* ============================================================================
   Type-Specific Title Colors
   ============================================================================ */

#notificationModal.type-success .notification-title {
    color: var(--color-primary, #2d8998);
}

#notificationModal.type-error .notification-title {
    color: #c0392b;
}

#notificationModal.type-warning .notification-title {
    color: #e67e22;
}

#notificationModal.type-info .notification-title {
    color: #3498db;
}

/* ============================================================================
   Dark Mode Support
   ============================================================================ */

@media (prefers-color-scheme: dark) {
    #notificationModal {
        background: rgba(0, 0, 0, 0.85);
    }

    #notificationModal .notification-content {
        background-image: none;
        background: var(--color-bg-input-disabled, #0a0b0c);
        border: 1px solid var(--color-border, rgba(255, 255, 255, 0.12));
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    }

    #notificationModal .notification-title {
        color: var(--color-text-primary, #ffffff);
    }

    #notificationModal .notification-body {
        color: var(--color-text-secondary, #cbd5e1);
    }

    #notificationModal .notification-btn-secondary {
        background: rgba(255, 255, 255, 0.1);
        color: var(--color-text-primary, #ffffff);
    }

    #notificationModal .notification-btn-secondary:hover {
        background: rgba(255, 255, 255, 0.15);
    }
}

/* ============================================================================
   Responsive Design - Mobile Devices
   ============================================================================ */

@media (max-width: 768px) {
    #notificationModal .notification-content {
        padding: 1.5rem;
        max-width: 90%;
    }

    #notificationModal .notification-title {
        font-size: 1.1rem;
    }

    #notificationModal .notification-body {
        font-size: 0.9rem;
    }
}

/* ============================================================================
   Dropdown Notification (Success/Info) - Non-blocking Top Notification
   ============================================================================ */

#notificationDropdown {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100000;
    /* Above Product Details modal (4000) and all other modals */
    pointer-events: none;
    /* Allow clicks to pass through */
    padding: 1rem;
    animation: dropdownSlideDown 0.3s ease-out;
}

/* Show state */
#notificationDropdown.show {
    display: block;
    pointer-events: auto;
    /* Enable clicks on the dropdown itself */
}

/* Dropdown content container */
#notificationDropdown .notification-dropdown-content {
    /* Background with noise texture matching site theme */
    background-image: url("../../images/bg_noise.webp"), linear-gradient(180deg, var(--color-bg-gradient-top, #f8f8f7), var(--color-bg-gradient-bottom, #f1f0ee));
    background-position: 0 0, 0 0;
    background-size: auto, auto;
    border: 1px solid var(--color-border, #dddfe0);
    border-radius: var(--radius-lg, 0.75rem);
    padding: 0.875rem 1rem;
    max-width: 500px;
    width: 100%;
    margin: 0 auto;
    box-shadow: var(--shadow-lg, 0 4px 20px rgba(0, 0, 0, 0.15));
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
}

/* Slide down animation */
@keyframes dropdownSlideDown {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }

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

/* Icon container */
#notificationDropdown .notification-dropdown-icon {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    font-weight: bold;
    color: white;
}

/* Text container */
#notificationDropdown .notification-dropdown-text {
    flex: 1;
    min-width: 0;
    /* Allow text to shrink */
}

/* Title */
#notificationDropdown .notification-dropdown-title {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--color-text-primary, #2c3e50);
}

/* Message */
#notificationDropdown .notification-dropdown-message {
    font-size: 0.875rem;
    color: var(--color-text-secondary, #555);
    line-height: 1.4;
    white-space: pre-line;
    word-wrap: break-word;
}

/* Close button */
#notificationDropdown .notification-dropdown-close {
    flex-shrink: 0;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--color-text-secondary, #666);
    cursor: pointer;
    padding: 0;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

#notificationDropdown .notification-dropdown-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--color-text-primary, #2c3e50);
}

#notificationDropdown .notification-dropdown-close:active {
    background: rgba(0, 0, 0, 0.1);
}

/* ============================================================================
   Type-Specific Dropdown Styles
   ============================================================================ */

/* Success type */
#notificationDropdown.type-success .notification-dropdown-icon {
    background: var(--color-primary, #2d8998);
}

#notificationDropdown.type-success .notification-dropdown-content {
    border-left: 3px solid var(--color-primary, #2d8998);
}

/* Info type */
#notificationDropdown.type-info .notification-dropdown-icon {
    background: #3498db;
}

#notificationDropdown.type-info .notification-dropdown-content {
    border-left: 3px solid #3498db;
}

/* ============================================================================
   Dropdown Dark Mode Support
   ============================================================================ */

@media (prefers-color-scheme: dark) {
    #notificationDropdown .notification-dropdown-content {
        background-image: none;
        background: var(--color-bg-input-disabled, #0a0b0c);
        border: 1px solid var(--color-border, rgba(255, 255, 255, 0.12));
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    }

    #notificationDropdown .notification-dropdown-title {
        color: var(--color-text-primary, #ffffff);
    }

    #notificationDropdown .notification-dropdown-message {
        color: var(--color-text-secondary, #cbd5e1);
    }

    #notificationDropdown .notification-dropdown-close {
        color: var(--color-text-secondary, #cbd5e1);
    }

    #notificationDropdown .notification-dropdown-close:hover {
        background: rgba(255, 255, 255, 0.1);
        color: var(--color-text-primary, #ffffff);
    }

    #notificationDropdown .notification-dropdown-close:active {
        background: rgba(255, 255, 255, 0.15);
    }
}

/* ============================================================================
   Dropdown Responsive Design - Mobile Devices
   ============================================================================ */

@media (max-width: 768px) {
    #notificationDropdown {
        padding: 0.75rem;
    }

    #notificationDropdown .notification-dropdown-content {
        padding: 0.75rem;
        gap: 0.5rem;
    }

    #notificationDropdown .notification-dropdown-icon {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 1rem;
    }

    #notificationDropdown .notification-dropdown-title {
        font-size: 0.8125rem;
    }

    #notificationDropdown .notification-dropdown-message {
        font-size: 0.8125rem;
    }

    #notificationDropdown .notification-dropdown-close {
        width: 1.25rem;
        height: 1.25rem;
        font-size: 1.25rem;
    }
}