/* Mobile Responsive CSS for Nex$tep Finance */
/* This CSS only applies to mobile devices (screens smaller than 768px) */

@media (max-width: 768px) {
    /* ---------- 1.  Ghost-overlay bug fix ---------- */
    .mobile-menu:not(.active) {
        display: none;
        pointer-events: none;   /* ← stops invisible layer from blocking clicks */
    }

    /* ---------- 2.  Navigation Mobile Styles ---------- */
    nav .max-w-7xl {
        padding: 0 1rem;
    }

    nav .flex.justify-between {
        flex-direction: row;
        align-items: center;
    }

    nav .hidden.md\\:flex {
        display: none !important;
    }

    nav .flex.items-center.space-x-8 {
        display: none;
    }

    /* Mobile Menu Button */
    .mobile-menu-btn {
        display: block !important;
        background: rgba(255, 255, 255, 0.2);
        border: 1px solid rgba(255, 255, 255, 0.3);
        border-radius: 8px;
        padding: 8px 12px;
        color: white;
        font-size: 18px;
        cursor: pointer;
    }

    /* Mobile Menu container (optional smooth animation) */
    .mobile-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        z-index: 100;

        /* ---- uncomment for smooth slide ----
        transition: transform .25s ease, opacity .25s ease;
        transform: translateY(-10px);
        opacity: 0;
        */
    }

    .mobile-menu.active {
        display: block;
        /* transform: translateY(0); opacity: 1; */   /* <-- uncomment if animation enabled */
    }

    .mobile-menu a {
        display: block;
        padding: 1rem;
        color: #333;
        text-decoration: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        font-weight: 500;
    }

    .mobile-menu a:hover {
        background: rgba(102, 126, 234, 0.1);
    }

    /* ---------- 3.  Hero Section Mobile ---------- */
    .hero-section {
        padding: 6rem 1rem 3rem !important;
    }

    .hero-section h1 {
        font-size: 2.5rem !important;
        line-height: 1.2 !important;
    }

    .hero-section .text-5xl.md\\:text-7xl {
        font-size: 2.5rem !important;
    }

    .hero-section .text-xl.md\\:text-2xl {
        font-size: 1rem !important;
        padding: 0 1rem;
    }

    .hero-section .flex.flex-col.sm\\:flex-row {
        flex-direction: column;
        gap: 1rem;
        padding: 0 1rem;
    }

    .hero-section .px-8 {
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }

    .hero-section .py-4 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }

    /* ---------- 4.  Stats Grid Mobile ---------- */
    .grid.md\\:grid-cols-3 {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
        padding: 0 1rem;
    }

    .grid.md\\:grid-cols-3 .glass-card {
        padding: 1.5rem !important;
    }

    .grid.md\\:grid-cols-3 .text-4xl {
        font-size: 2rem !important;
    }

    /* ---------- 5.  Features Section Mobile ---------- */
    .features-section {
        padding: 3rem 1rem !important;
    }

    .features-section h2 {
        font-size: 2rem !important;
        margin-bottom: 1rem !important;
    }

    .features-section .text-xl {
        font-size: 1rem !important;
        padding: 0 1rem;
    }

    .features-section .grid.md\\:grid-cols-3 {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
        margin-top: 2rem !important;
    }

    .features-section .glass-card {
        padding: 2rem 1.5rem !important;
    }

    .features-section .w-20 {
        width: 4rem !important;
        height: 4rem !important;
    }

    .features-section .text-3xl {
        font-size: 2rem !important;
    }

    .features-section .text-2xl {
        font-size: 1.5rem !important;
    }

    .features-section .mb-6 {
        margin-bottom: 1rem !important;
    }

    .features-section .px-6 {
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }

    .features-section .py-3 {
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
    }

    /* ---------- 6.  Budget Simulator Mobile ---------- */
    #budget-modal .max-w-2xl {
        max-width: 95vw !important;
        margin: 1rem !important;
        max-height: 95vh !important;
    }

    #budget-modal .p-8 {
        padding: 1.5rem !important;
    }

    #budget-modal h3 {
        font-size: 1.5rem !important;
    }

    #budget-modal .grid.md\\:grid-cols-2 {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    #budget-modal .space-y-6 > div {
        margin-bottom: 1rem !important;
    }

    #budget-modal .p-4 {
        padding: 1rem !important;
    }

    #budget-modal .text-3xl {
        font-size: 1.5rem !important;
    }

    /* ---------- 7.  Login / Register Modals Mobile ---------- */
    #login-modal .max-w-md,
    #register-modal .max-w-md {
        max-width: 95vw !important;
        margin: 1rem !important;
    }

    #login-modal .p-8,
    #register-modal .p-8 {
        padding: 1.5rem !important;
    }

    #login-modal h3,
    #register-modal h3 {
        font-size: 1.5rem !important;
    }

    #login-modal .space-y-4 > div,
    #register-modal .space-y-4 > div {
        margin-bottom: 1rem !important;
    }

    #login-modal .p-3,
    #register-modal .p-3 {
        padding: 0.75rem !important;
    }

    #login-modal .py-3,
    #register-modal .py-3 {
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
    }

    /* ---------- 8.  Footer Mobile ---------- */
    footer .py-8 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }

    footer .text-xl {
        font-size: 1.25rem !important;
    }

    footer .text-sm {
        font-size: 0.875rem !important;
    }

    /* ---------- 9.  Container & Text ---------- */
    .container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .px-4 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .max-w-7xl {
        max-width: 100% !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .text-4xl {
        font-size: 2rem !important;
    }

    .text-3xl {
        font-size: 1.5rem !important;
    }

    .text-2xl {
        font-size: 1.25rem !important;
    }

    .text-xl {
        font-size: 1.125rem !important;
    }

    .text-lg {
        font-size: 1rem !important;
    }

    /* ---------- 10.  Buttons ---------- */
    .px-6 {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }

    .py-3 {
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
    }

    .px-4 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .py-2 {
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
    }

    /* ---------- 11.  Margins ---------- */
    .mb-8 {
        margin-bottom: 1.5rem !important;
    }

    .mb-6 {
        margin-bottom: 1rem !important;
    }

    .mb-4 {
        margin-bottom: 0.75rem !important;
    }

    .mt-12 {
        margin-top: 2rem !important;
    }

    .mt-16 {
        margin-top: 2rem !important;
    }

    /* ---------- 12.  Glass Cards ---------- */
    .glass-card {
        margin-bottom: 1rem !important;
    }

    /* ---------- 13.  Disable heavy animations on mobile ---------- */
    .slide-in {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }

    /* ---------- 14.  User Profile ---------- */
    #user-profile.show {
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
    }

    #user-profile .w-10 {
        width: 2rem !important;
        height: 2rem !important;
    }

    #username {
        font-size: 0.875rem !important;
        max-width: 100px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* Extra small devices (phones, 480px and down) */
@media (max-width: 480px) {
    .hero-section h1 {
        font-size: 2rem !important;
    }

    .hero-section .text-5xl.md\\:text-7xl {
        font-size: 2rem !important;
    }

    .features-section .text-2xl {
        font-size: 1.25rem !important;
    }

    .features-section .w-20 {
        width: 3rem !important;
        height: 3rem !important;
    }

    .features-section .text-3xl {
        font-size: 1.5rem !important;
    }

    .stats-number {
        font-size: 1.5rem !important;
    }
}

/* Tablet adjustments (768px to 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .hero-section h1 {
        font-size: 3rem !important;
    }

    .features-section .grid.md\\:grid-cols-3 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.5rem !important;
    }

    .grid.md\\:grid-cols-3 {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}