

/* ==========================================================================
   MASTER RESPONSIVE SHEET - $100K FLUID DESIGN
   Handles: Mobile Navigation, Typography Scaling, Grid Stacking, Widget Fixing
========================================================================== */

/* --- 1. TABLET & SMALL LAPTOP (Max Width: 1024px) --- */
@media screen and (max-width: 1024px) {
    
    /* Container Safety */
    .container { padding: 0 20px; width: 100%; overflow-x: hidden; }
    
    /* Navigation: Hide Desktop Auth, Show Hamburger */
    .nav-auth { display: none !important; }
    .hamburger { display: flex !important; }

    /* Plans Grid: 2 Columns instead of 5 */
    .plans-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 20px; }
    
    /* Stats Grid: 2 Columns */
    .stats-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

/* --- 2. MOBILE PHONES (Max Width: 768px) --- */
@media screen and (max-width: 768px) {

    /* GLOBAL RESET FOR MOBILE */
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
        position: relative;
    }
	
	@media screen and (max-width: 991px) {
    
    /* HAMBURGER TRIGGER */
    .hamburger { display: flex !important; }
    .nav-auth { display: none !important; }

    /* --- PREMIUM DRAWER STYLES (From Code 2) --- */
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%; /* Hidden off-screen */
        width: 100%;
        height: 100vh;
        /* Premium Gradient Background */
        background: linear-gradient(160deg, #050a14 0%, #0d2341 100%);
        /* Glass Effect */
        backdrop-filter: blur(15px); 
        -webkit-backdrop-filter: blur(15px);
        
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        transition: right 0.5s cubic-bezier(0.77, 0, 0.175, 1);
        z-index: 10000;
        padding-top: 20px;
        overflow-y: auto;
    }

    .nav-links.active { right: 0; }

    /* CLOSE BUTTON CONTAINER */
    .close-btn-container {
        width: 100%;
        display: flex;
        justify-content: flex-end;
        padding: 20px 30px;
        margin-bottom: 20px;
    }

    .close-menu-btn {
        font-size: 1.2rem;
        color: rgba(255,255,255,0.6);
        cursor: pointer;
        border: 1px solid rgba(255,255,255,0.2);
        padding: 8px 20px;
        border-radius: 30px;
        transition: 0.3s;
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .close-menu-btn:hover {
        background: rgba(255,255,255,0.1);
        color: white;
        border-color: white;
    }

    /* MENU ANIMATIONS */
    .nav-links li {
        width: 100%;
        text-align: center;
        margin: 10px 0;
        opacity: 0;
        transform: translateY(20px);
        transition: 0.4s ease forwards;
    }
    .nav-links.active li { opacity: 1; transform: translateY(0); }
    
    /* Stagger Delays */
    .nav-links.active li:nth-child(1) { transition-delay: 0.1s; }
    .nav-links.active li:nth-child(2) { transition-delay: 0.2s; }
    .nav-links.active li:nth-child(3) { transition-delay: 0.3s; }
    .nav-links.active li:nth-child(4) { transition-delay: 0.4s; }
    .nav-links.active li:nth-child(5) { transition-delay: 0.5s; }

    /* LINKS TYPOGRAPHY */
    .nav-links a {
        font-size: 1.4rem;
        color: white;
        font-weight: 500;
        display: block;
        padding: 10px;
        font-family: 'Playfair Display', serif;
    }
    .nav-links a:hover { color: #c9a227; transform: scale(1.05); }

    /* MOBILE MENU BUTTONS */
    .btn-mobile-login {
        border: 1px solid rgba(201, 162, 39, 0.5);
        color: #c9a227 !important;
        padding: 15px 40px;
        border-radius: 30px;
        font-weight: 700;
        text-transform: uppercase;
        width: 80%;
        margin: 0 auto;
        display: block !important;
    }
    .btn-mobile-register {
        background: linear-gradient(90deg, #c9a227, #e6c55a);
        color: #0d2341 !important;
        padding: 15px 40px;
        border-radius: 30px;
        font-weight: 700;
        text-transform: uppercase;
        width: 80%;
        margin: 15px auto 0;
        box-shadow: 0 10px 30px rgba(201, 162, 39, 0.3);
        display: block !important;
    }
}

/* --- 3. MOBILE CONTENT LAYOUT (Max Width: 768px) --- */
/* This handles the GRIDS, TEXT, and STACKING (restored from Code 1) */
@media screen and (max-width: 768px) {

    /* GLOBAL RESET */
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
        position: relative;
    }

    /* HERO SECTION RESTRUCTURE */
    .hero-section {
        padding: 120px 0 50px 0 !important;
        min-height: auto !important;
        text-align: center;
    }
    .hero-content {
        grid-template-columns: 1fr !important; /* Stack vertically */
        gap: 30px;
    }
    .hero-text { order: 1; padding: 0 15px; }
    .hero-image { order: 2; margin-top: 20px; }

    /* TYPOGRAPHY SCALING */
    .hero-title {
        font-size: 2rem !important;
        line-height: 1.2 !important;
        word-wrap: break-word;
    }
    .title-highlight {
        font-size: 2.5rem !important;
        display: block;
        margin-top: 5px;
    }
    .hero-description {
        font-size: 1rem !important;
        padding: 0 10px;
    }

    /* HERO STATS */
    .hero-stats {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 15px;
        background: rgba(255,255,255,0.05);
        padding: 20px;
        border-radius: 15px;
        margin-top: 20px;
    }
    .stat-item h3 { font-size: 1.5rem !important; }

    /* HERO BUTTONS STACK */
    .hero-buttons {
        flex-direction: column;
        padding: 0 30px;
    }
    .hero-buttons .btn { width: 100%; margin-bottom: 15px; }

    /* TRADINGVIEW & GRIDS */
    .tradingview-widget-container iframe { min-height: 400px; }
    
    .plans-grid, .features-grid, .markets-grid, .dense-grid {
        grid-template-columns: 1fr !important; /* 1 Column Stack */
        padding: 0 15px;
    }

    .plan-card {
        margin-bottom: 20px;
        transform: none !important;
    }
    .plan-card.featured { transform: scale(1) !important; border: 2px solid #c9a227; }

    /* CONTACT & FOOTER */
    .contact-grid, .content-section, .footer-grid {
        grid-template-columns: 1fr !important;
        gap: 40px;
        text-align: center;
    }
    .footer-social, .footer-contact .contact-item { justify-content: center; }
    .footer-bottom-content { flex-direction: column; gap: 15px; }
}

/* --- 4. UTILITIES (Hide Close Button on Desktop) --- */
@media screen and (min-width: 992px) {
    .close-btn-container { display: none !important; }
    .btn-mobile-login, .btn-mobile-register { display: none !important; }
}

/* ======================================================
   DESKTOP CLEANUP (Fixes Duplicates & X Button)
   Applies to screens wider than 991px
====================================================== */
@media screen and (min-width: 992px) {
    
    /* 1. Hide the Mobile "Close (X)" Button */
    .mobile-header, 
    .close-menu-btn {
        display: none !important;
    }

    /* 2. Hide the Mobile Login/Get Started Buttons inside the menu */
    .mobile-auth-item {
        display: none !important;
    }

    /* 3. Hide the Hamburger Icon (Just in case) */
    .hamburger {
        display: none !important;
    }

    /* 4. Ensure Navigation Layout is Horizontal */
    .nav-links {
        position: relative !important;
        height: auto !important;
        width: auto !important;
        background: transparent !important;
        flex-direction: row !important;
        padding: 0 !important;
        box-shadow: none !important;
        top: auto !important;
        right: auto !important;
        overflow: visible !important;
    }

    /* 5. Reset List Items */
    .nav-links li {
        width: auto !important;
        margin: 0 !important;
        opacity: 1 !important;
        transform: none !important;
    }

    .nav-links a {
        font-size: 0.95rem !important;
        padding: 10px 15px !important;
    }
}
