/* ================================================== */
/* RESPONSIVE & CLEAN DASHBOARD + DARK THEME STYLES   */
/* ================================================== */

/* ====================== */
/* MOBILE MENU BASE STYLES */
/* ====================== */

/* Ensure smooth transitions for mobile menu */
body.menu-open,
body.admin-menu-open {
    overflow: hidden;
}

/* Mobile menu styles - ensure they only apply on mobile */
@media (max-width: 768px) {

    #mobile-menu,
    #admin-mobile-menu {
        display: block;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    body.menu-open #mobile-menu,
    body.admin-menu-open #admin-mobile-menu {
        transform: translateX(0);
    }
}

@media (min-width: 769px) {

    /* Hide mobile menu completely on desktop */
    #mobile-menu,
    #admin-mobile-menu {
        display: none !important;
    }

    /* Ensure body doesn't have mobile menu classes on desktop */
    body.menu-open,
    body.admin-menu-open {
        overflow: auto;
    }
}

@media (max-width: 1024px) {

    /* ====================== */
    /* CLEAN DASHBOARD LAYOUT */
    /* ====================== */
    .dashboard .dashboard-grid {
        display: none !important;
    }

    .dashboard .chart-container {
        display: block;
        width: 100%;
        min-height: 70vh;
        max-width: 100%;
        margin: 0 auto;
        padding: 10px;
        background: #10141f;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    }

    /* ====================== */
    /* HEADER STYLING         */
    /* ====================== */
    .dashboard header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 15px;
        background-color: #1b2738;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .dashboard header .logo {
        display: block;
        font-size: 1.4rem;
        font-weight: 700;
        color: #b0b8c3;
    }

    .dashboard header .user-info {
        display: flex;
        align-items: center;
        gap: 10px;
        color: #fff;
        font-size: 0.95rem;
    }

    .dashboard header .logout-button {
        background: #ff4444;
        border: none;
        color: white;
        padding: 5px 10px;
        border-radius: 6px;
        cursor: pointer;
    }

    /* Admin dashboard specific header styling */
    #admin-dashboard header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 15px;
        background-color: #1b2738;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    #admin-dashboard header .logo {
        display: block;
        font-size: 1.4rem;
        font-weight: 700;
        color: #b0b8c3;
    }

    #admin-dashboard header .user-info {
        display: none;
    }

    #admin-hamburger-icon {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 42px;
        height: 42px;
        font-size: 24px;
        background: #fff;
        color: #333;
        border-radius: 8px;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
        cursor: pointer;
        z-index: 10000;
    }

    /* Admin mobile menu */
    #admin-mobile-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        max-width: 320px;
        height: 100%;
        background: #10141f;
        box-shadow: 2px 0 12px rgba(0, 0, 0, 0.3);
        z-index: 9999;
        transition: left 0.3s ease-in-out;
        padding-top: 60px;
    }

    body.admin-menu-open #admin-mobile-menu {
        left: 0;
    }

    #admin-mobile-menu-items {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    #admin-mobile-menu-items li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    #admin-mobile-menu-items li a {
        display: block;
        padding: 14px 20px;
        text-decoration: none;
        color: #f0f4ff;
        font-size: 16px;
        transition: background 0.2s ease, color 0.2s ease;
    }

    #admin-mobile-menu-items li a:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #00e0c6;
    }

    #hamburger-icon {
        display: flex;
        justify-content: center;
        align-items: center;
        position: fixed;
        top: 12px;
        right: 12px;
        width: 42px;
        height: 42px;
        font-size: 24px;
        background: #fff;
        color: #333;
        border-radius: 8px;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
        cursor: pointer;
        z-index: 10000;
    }

    /* ====================== */
    /* MOBILE MENU DRAWER     */
    /* ====================== */
    #mobile-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        max-width: 320px;
        height: 100%;
        background: #10141f;
        box-shadow: 2px 0 12px rgba(0, 0, 0, 0.3);
        z-index: 9999;
        transition: left 0.3s ease-in-out;
        padding-top: 60px;
    }

    body.menu-open #mobile-menu {
        left: 0;
    }

    #mobile-menu-items {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    #mobile-menu-items li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    #mobile-menu-items li a {
        display: block;
        padding: 14px 20px;
        text-decoration: none;
        color: #f0f4ff;
        font-size: 16px;
        transition: background 0.2s ease, color 0.2s ease;
    }

    #mobile-menu-items li a:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #00e0c6;
    }

    /* ====================== */
    /* DARK CONTAINER THEME   */
    /* ====================== */
    .container,
    .form-card,
    #my-investment-container .form-card,
    #profits-container .form-card,
    #transactions-container .form-card,
    #referral-bonus-container .form-card,
    #referral-link-container .form-card,
    #withdrawal-container .form-card,
    #invest-container .form-card,
    #payment-container .form-card {
        background: rgba(10, 15, 25, 0.95);
        color: #fff;
        border-radius: 12px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
        padding: 20px;
    }

    .container h1,
    .container h2,
    .container h3 {
        color: #f0f4ff;
        text-align: center;
        margin-bottom: 10px;
    }

    .container .amount {
        font-size: 2rem;
        font-weight: bold;
        color: #4caf50;
        text-align: center;
    }

    /* ====================== */
    /* FORMS & INPUTS         */
    /* ====================== */
    .input-group {
        display: flex;
        flex-direction: column;
        margin-bottom: 12px;
    }

    .input-group input,
    .input-group select {
        font-size: 1rem;
        padding: 10px;
        border-radius: 6px;
        border: 1px solid #ccc;
        outline: none;
        background: #1b2233;
        color: #fff;
    }

    /* ====================== */
    /* MODALS & CLOSE BUTTONS */
    /* ====================== */
    .close-button {
        position: absolute;
        top: 10px;
        right: 15px;
        font-size: 20px;
        color: #fff;
        cursor: pointer;
    }

    .modal-content {
        width: 90%;
        max-width: 400px;
        background: rgba(10, 15, 25, 0.95);
        border-radius: 10px;
        color: #fff;
    }

    /* ====================== */
    /* FLOATING WHATSAPP BTN  */
    /* ====================== */
    .whatsapp-float {
        position: fixed;
        bottom: 20px;
        right: 20px;
        background: #25D366;
        color: white;
        border-radius: 50%;
        padding: 15px;
        font-size: 24px;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
        z-index: 10001;
        cursor: pointer;
        touch-action: manipulation;
    }
}

/* Desktop styles for admin dashboard */
@media (min-width: 1025px) {
    #admin-hamburger-icon {
        display: none !important;
    }

    #admin-mobile-menu {
        display: none !important;
    }

    #admin-dashboard header .user-info {
        display: flex;
        align-items: center;
        gap: 10px;
        color: #fff;
        font-size: 0.95rem;
    }
}

/* ====================== */
/* ADDITIONAL MOBILE MENU ENHANCEMENTS */
/* ====================== */

/* Backdrop overlay for mobile menu */
@media (max-width: 768px) {
    .mobile-menu-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9998;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    body.menu-open .mobile-menu-backdrop,
    body.admin-menu-open .mobile-menu-backdrop {
        opacity: 1;
        visibility: visible;
    }
}

/* Smooth transitions for all interactive elements */
#mobile-menu,
#admin-mobile-menu,
.mobile-menu-backdrop,
body.menu-open,
body.admin-menu-open {
    transition: all 0.3s ease-in-out;
}

/* Ensure proper z-index stacking */
#mobile-menu,
#admin-mobile-menu {
    z-index: 9999;
}

.hamburger-menu,
#admin-hamburger-icon {
    z-index: 10000;
}

.whatsapp-float {
    z-index: 10001;
}