/* Customer Order Notification Styles */

.notification-container {
    position: fixed;
    /* place notifications below fixed header to avoid being hidden */
    top: 10px; /* default offset for desktop */
    right: 20px;
    z-index: 20060; /* above modals/header (consistent with layout z-index values) */
    max-width: 400px;
}

/* Adjust for cases where header is smaller or mobile */
@media (max-width:768px) {
    .notification-container {
        top: calc(56px +0.5rem);
        left: 10px;
        right: 10px;
    }
}

@media (max-width:576px) {
    .notification-container {
        top: calc(56px +0.5rem);
    }
}

.notification-toast {
    background: white;
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 12px;
    animation: slideInRight 0.4s ease-out;
}

    .notification-toast.notification-success {
        border-left: 4px solid #28a745;
    }

        .notification-toast.notification-success .toast-header {
            background: linear-gradient(135deg, rgba(40, 167, 69, 0.1) 0%, transparent 100%);
            border-bottom: 1px solid rgba(40, 167, 69, 0.2);
        }

    .notification-toast.notification-info {
        border-left: 4px solid #17a2b8;
    }

        .notification-toast.notification-info .toast-header {
            background: linear-gradient(135deg, rgba(23, 162, 184, 0.1) 0%, transparent 100%);
            border-bottom: 1px solid rgba(23, 162, 184, 0.2);
        }

    .notification-toast.notification-warning {
        border-left: 4px solid #ffc107;
    }

        .notification-toast.notification-warning .toast-header {
            background: linear-gradient(135deg, rgba(255, 193, 7, 0.1) 0%, transparent 100%);
            border-bottom: 1px solid rgba(255, 193, 7, 0.2);
        }

    .notification-toast.notification-error {
        border-left: 4px solid #dc3545;
    }

        .notification-toast.notification-error .toast-header {
            background: linear-gradient(135deg, rgba(220, 53, 69, 0.1) 0%, transparent 100%);
            border-bottom: 1px solid rgba(220, 53, 69, 0.2);
        }

    .notification-toast .toast-header {
        padding: 1rem;
        border-radius: 12px 12px 0 0;
        font-weight: 600;
    }

        .notification-toast .toast-header strong {
            margin-right: 0.5rem;
        }

        .notification-toast .toast-header .btn-close {
            opacity: 0.5;
            transition: opacity 0.3s ease;
        }

            .notification-toast .toast-header .btn-close:hover {
                opacity: 1;
            }

    .notification-toast .toast-body {
        padding: 1rem;
        color: #333;
        font-size: 0.95rem;
        line-height: 1.5;
    }

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.notification-toast.hiding {
    animation: slideOutRight 0.4s ease-out forwards;
}

/* Notification Preferences Styles */
.notification-preferences {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

    .notification-preferences h6 {
        font-weight: 700;
        color: #333;
        margin-bottom: 1.5rem;
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }

.notification-preference-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

    .notification-preference-item:last-child {
        margin-bottom: 0;
    }

    .notification-preference-item:hover {
        background: rgba(243, 156, 18, 0.02);
        border-color: rgba(243, 156, 18, 0.2);
    }

.notification-preference-label {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

    .notification-preference-label i {
        font-size: 1.5rem;
        color: #f39c12;
        min-width: 30px;
        text-align: center;
    }

    .notification-preference-label div {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
    }

    .notification-preference-label strong {
        font-weight: 600;
        color: #333;
        margin: 0;
    }

    .notification-preference-label small {
        font-size: 0.85rem;
        color: #999;
        margin: 0;
    }

/* Toggle Switch Styles */
.toggle-switch {
    position: relative;
    display: inline-flex;
    cursor: pointer;
    user-select: none;
}

    .toggle-switch input {
        display: none;
    }

.toggle-slider {
    display: inline-block;
    width: 50px;
    height: 28px;
    background-color: #ccc;
    border-radius: 20px;
    position: relative;
    transition: background-color 0.3s ease;
    margin-left: 1rem;
    flex-shrink: 0;
}

    .toggle-slider::before {
        content: '';
        position: absolute;
        width: 24px;
        height: 24px;
        border-radius: 50%;
        background-color: white;
        top: 2px;
        left: 2px;
        transition: transform 0.3s ease, box-shadow 0.3s ease;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }

.toggle-switch input:checked + .toggle-slider {
    background-color: #f39c12;
}

    .toggle-switch input:checked + .toggle-slider::before {
        transform: translateX(22px);
        box-shadow: 0 2px 6px rgba(243, 156, 18, 0.3);
    }

.toggle-switch input:disabled + .toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Connection Status Badge Styles */
#customer-notification-status {
    display: inline-flex;
}

    #customer-notification-status .badge {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
        font-weight: 600;
    }

    #customer-notification-status i {
        font-size: 0.6rem;
        animation: pulse 2s ease-in-out infinite;
    }

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Mobile Responsiveness */
@media (max-width: 576px) {
    .notification-container {
        left: 10px;
        right: 10px;
        top: 10px;
        max-width: none;
    }

    .notification-toast {
        margin-bottom: 8px;
    }

    .notification-preference-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .notification-preference-label {
        width: 100%;
    }

    .toggle-slider {
        margin-left: 0;
        margin-top: 0.5rem;
    }

    .toggle-switch {
        align-self: flex-end;
    }
}
