/* =========================================================================
   Redesign Espace Client (Dashboard) - Rapide Travel
   Premium Glassmorphism Aesthetic
   ========================================================================= */

/* Use variables defined in style.css */

body {
    background: var(--bg-gradient);
    min-height: 100vh;
    font-family: 'Outfit', sans-serif;
    color: var(--text-dark);
    margin: 0;
    padding: 0;
    /* Add subtle animated background elements if needed or keep it clean */
    position: relative;
    overflow-x: hidden;
}

/* Optional: Decorative animated blobs in the background */
body::before,
body::after {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.5;
    animation: float 20s infinite ease-in-out alternate;
}

body::before {
    background: rgba(0, 131, 143, 0.2);
    top: -100px;
    left: -100px;
}

body::after {
    background: rgba(255, 143, 0, 0.15);
    /* Orange accent */
    bottom: -100px;
    right: -100px;
    animation-delay: -10s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(50px, 50px) scale(1.1);
    }
}

/* Layout Container */
.admin-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
    overflow-x: clip;
}

/* Sidebar Styling (Glassmorphism) */
.admin-sidebar {
    width: 280px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.5);
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.04);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
}

.sidebar-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.sidebar-header h1 {
    font-size: 1.5rem;
    color: var(--primary-teal);
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.sidebar-header p {
    font-size: 0.9rem;
    color: var(--text-light);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.8rem 1rem;
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.nav-link.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 131, 143, 0.3);
}

.nav-link.logout {
    color: #e53935;
    margin-top: 2rem;
}

.nav-link.logout:hover {
    background: rgba(229, 57, 53, 0.1);
}

/* Main Content Area */
.admin-main {
    flex: 1;
    margin-left: 280px;
    /* Offset for fixed sidebar */
    padding: 3rem 4rem;
    max-width: 1400px;
    transition: margin-left 0.3s ease;
}

/* Mobile Dashboard Header (Hidden by default) */
.mobile-dashboard-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 1000;
    padding: 0 1.5rem;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.mobile-dashboard-header h1 {
    font-size: 1.2rem;
    margin: 0;
    color: var(--primary-teal);
}

/* Sidebar Toggle Button */
.sidebar-toggle {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 5px;
    z-index: 1001;
}

.sidebar-toggle span {
    display: block;
    width: 25px;
    height: 2px;
    background: var(--primary-teal);
    transition: all 0.3s ease;
}

/* Overlay for Mobile Sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    z-index: 999;
}

.sidebar-overlay.active {
    display: block;
}

.admin-section {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.admin-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.section-header h2 {
    font-size: 2.2rem;
    color: var(--text-dark);
    font-weight: 700;
}

/* Status Badge */
.status-badge {
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.status-active {
    color: var(--primary-teal);
    border: 1px solid rgba(0, 131, 143, 0.2);
}

/* Mail preference popup */
.mail-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(9, 21, 34, 0.42);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 1200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.mail-popup-overlay.active {
    display: flex;
}

.mail-popup-modal {
    width: min(100%, 460px);
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid rgba(0, 131, 143, 0.2);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.25);
    padding: 24px;
}

.mail-popup-modal h3 {
    margin: 0 0 10px;
    color: var(--primary-teal);
    font-size: 1.35rem;
}

.mail-popup-modal p {
    margin: 0;
    color: #41526b;
    line-height: 1.55;
}

.mail-popup-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

@media (max-width: 640px) {
    .mail-popup-actions {
        flex-direction: column;
    }

    .mail-popup-actions .btn {
        width: 100%;
    }
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    padding: 1.8rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-teal);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.95rem;
    color: var(--text-light);
    font-weight: 500;
}

/* Timeline Customization */
.timeline-card {
    padding: 3rem;
    border-radius: 24px;
}

.status-tracker {
    position: relative;
    padding: 1rem 0;
}

.step {
    display: flex;
    align-items: flex-start;
    margin-bottom: 2rem;
    position: relative;
}

.step::before {
    content: '';
    position: absolute;
    left: 24px;
    top: 50px;
    bottom: -30px;
    width: 2px;
    background: rgba(0, 0, 0, 0.08);
}

.step:last-child::before {
    display: none;
}

.step:last-child {
    margin-bottom: 0;
}

.step-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #f0f2f5;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 1.5rem;
    z-index: 1;
    font-size: 1.4rem;
    color: #9e9e9e;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 4px solid white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.step.completed .step-icon {
    background: var(--primary-teal);
    color: white;
    /* Optional: change icon to checkmark using a separate trick, but here we keep original emoji */
}

.step.active .step-icon {
    background: white;
    color: var(--accent-orange);
    border-color: var(--accent-orange);
    box-shadow: 0 0 0 5px rgba(255, 143, 0, 0.15);
    transform: scale(1.15);
}

.step-content {
    background: rgba(255, 255, 255, 0.5);
    padding: 1.2rem 1.5rem;
    border-radius: 12px;
    flex: 1;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.step.active .step-content {
    background: white;
    border-color: rgba(0, 131, 143, 0.1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
}

.step-content h4 {
    margin-bottom: 0.4rem;
    font-size: 1.1rem;
    color: var(--text-dark);
}

.step.active .step-content h4 {
    color: var(--accent-orange);
    font-weight: 700;
}

.step-content p {
    font-size: 0.95rem;
    color: var(--text-light);
    margin-bottom: 0.3rem;
}

/* Responsiveness */
@media (max-width: 900px) {
    body {
        background: linear-gradient(180deg, #f5f8fb 0%, #dce7f1 100%);
    }

    body::before,
    body::after {
        display: none;
    }

    .mobile-dashboard-header {
        display: flex;
    }

    .admin-sidebar {
        width: 280px;
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
        z-index: 1001;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.1);
        border-right: none;
        background: white;
        /* Ensure visibility */
    }

    .admin-sidebar.active {
        transform: translateX(0);
    }

    .sidebar-header {
        margin-bottom: 1.5rem;
        padding-top: 1rem;
    }

    .admin-main {
        margin-left: 0;
        padding: 5rem 1.5rem 2rem;
        /* Adjusted top padding */
        max-width: 100%;
    }

    .section-header h2 {
        font-size: 1.6rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

@media (max-width: 600px) {
    .admin-main {
        padding: 4.6rem 1rem 1.25rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .stat-card {
        padding: 1.2rem;
    }

    .stat-value {
        font-size: 2rem;
    }

    .timeline-card {
        padding: 1.5rem;
        border-radius: 16px;
    }

    .step-icon {
        width: 35px;
        height: 35px;
        font-size: 1rem;
        margin-right: 1rem;
    }

    .step::before {
        left: 17px;
        top: 35px;
    }
}

/* =========================================================================
   WhatsApp Section Improvements
   ========================================================================= */

.whatsapp-instructions ul {
    margin-top: 1rem;
}

.whatsapp-instructions li {
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.whatsapp-icon-large {
    animation: pulseWhatsApp 2s infinite ease-in-out;
    display: inline-block;
}

@keyframes pulseWhatsApp {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
        filter: drop-shadow(0 0 15px rgba(37, 211, 102, 0.4));
    }

    100% {
        transform: scale(1);
    }
}

.btn-primary[href*="wa.me"]:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 20px rgba(37, 211, 102, 0.3) !important;
}