/* css/main.css */

@import url('screens/home.css');
@import url('screens/unifinder.css');
@import url('screens/auth.css');
@import url('screens/explore.css');
@import url('screens/user-card.css');
@import url('screens/digital-id.css');
@import url('screens/dashboard.css');
@import url('screens/subscriptions.css');
@import url('screens/checkout.css');

/* ---------------------------------
   Google Material 3 + Apple HIG Hybrid
---------------------------------- */
:root {
    --primary-green: #327845;
    --dark-green: #1A3C23;
    --accent-gold: #F5A623;
    --success-green: #2ECC71;
    --danger-red: #E74C3C;
    
    --bg-base: #F4F7F5; 
    --bg-tint: #EBF5ED;
    --surface-solid: #FFFFFF;
    --surface-glass: rgba(255, 255, 255, 0.75); 
    
    --text-main: #2D2D2D;
    --text-muted: #686868;
    --text-light: #A5A5A5;
    
    --radius-sm: 8px;
    --radius-md: 16px; 
    --radius-lg: 24px;
    --radius-pill: 9999px; 
    
    --shadow-soft: 0 4px 24px rgba(0, 0, 0, 0.04); 
    --shadow-elevated: 0 10px 20px rgba(50, 120, 69, 0.08); 
    
    --nav-height: 80px;
    --spacing-unit: 1.5rem;
    --max-content-width: 1200px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-base);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--dark-green);
    letter-spacing: -0.02em;
}

/* ---------------------------------
   Apple HIG: Glassmorphism Nav Bar
---------------------------------- */
#main-nav {
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--nav-height);
    background: var(--surface-glass);
    backdrop-filter: blur(20px); 
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 var(--spacing-unit);
    z-index: 1000;
    transition: background 0.3s ease;
}

.nav-left { display: flex; justify-content: flex-start; align-items: center; }

.nav-brand-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

.nav-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
}

/* Navbar Right Side Alignments */
.nav-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 60px; /* Ensures it takes up space opposite the hamburger menu */
}

/* User Avatar Styling */
.header-user-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary-green);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 800;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    transition: transform 0.2s ease;
}

.header-user-avatar:hover {
    transform: scale(1.05);
}

.brand-text {
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--dark-green);
}

.nav-links {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-links button {
    background: transparent;
    border: none;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-pill);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-links button:hover {
    color: var(--primary-green);
    background: var(--bg-tint);
}

.hamburger-btn { display: none; }

/* Master Viewport */
#app-viewport {
    margin-top: calc(var(--nav-height) + 2rem);
    padding: var(--spacing-unit);
    max-width: var(--max-content-width);
    margin-left: auto;
    margin-right: auto;
    min-height: 80vh;
}

.screen {
    display: none;
    opacity: 0;
}

.screen.active {
    display: block;
    opacity: 1;
    animation: appSpringIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes appSpringIn {
    from { 
        opacity: 0; 
        transform: translateY(16px) scale(0.98); 
    }
    to { 
        opacity: 1; 
        transform: none; /* <-- This is the magic fix */ 
    }
}

/* =========================================
   MOBILE & TABLET RESPONSIVE LAYOUT (MASTER)
   ========================================= */

/* Hide footer globally on desktop */
.app-footer {
    display: none !important; 
}

@media screen and (max-width: 1024px) {
    /* 1. App Footer Visibility & Layout */
    .app-footer {
        display: flex !important; /* Forces DevTools to render */
        justify-content: space-around;
        align-items: center;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 75px !important;
        background: #FFFFFF !important;
        box-shadow: 0 -4px 25px rgba(0,0,0,0.1) !important;
        z-index: 999999 !important;
        padding-bottom: 15px !important; /* Fallback for DevTools */
        padding-bottom: env(safe-area-inset-bottom, 15px) !important;
    }

    .footer-item {
        display: flex; flex-direction: column; align-items: center;
        justify-content: center; background: transparent; border: none;
        color: #A0AEC0; cursor: pointer; gap: 6px; flex: 1;
        transition: 0.2s; height: 100%; padding-top: 5px;
    }

    .footer-item svg { width: 24px; height: 24px; fill: currentColor; }
    .footer-item span { font-size: 11px; font-weight: 600; letter-spacing: 0.2px; }
    .footer-item.active, .footer-item:hover { color: var(--primary-green); }

    /* Push viewport up so footer doesn't cover content */
    #app-viewport { padding-bottom: 110px !important; }
    .create-listing-btn { bottom: 100px !important; }

    /* 2. Three-Part Header Restructure */
    #main-nav {
        display: grid !important;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
        padding: 0 20px;
    }
    
    .nav-left { display: flex; justify-content: flex-start; }
    .nav-brand-container { justify-content: center; margin: 0; }
    .nav-right { display: flex; justify-content: flex-end; }
    
    /* Hide Desktop Links & Show Hamburger */
    .nav-links { display: none; }
    .hamburger-btn {
        display: block !important;
        background: none; border: none; font-size: 26px;
        color: var(--dark-green); cursor: pointer; padding: 0;
    }
    
    .desktop-sidebar, .sidebar-container { display: none !important; }

    /* Hamburger Dropdown Logic */
    .nav-links {
        flex-direction: column;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        width: 100%;
        background: var(--surface-glass);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        padding: 20px;
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        border-bottom: 1px solid rgba(0,0,0,0.05);
    }
    .nav-links.mobile-active { display: flex !important; }
}

/* Responsive Multi-Column Footer Styles */
.main-footer {
    /* Base positioning - not sticky, scrolls with page */
    position: static; 
    z-index: 10; 
}

.footer-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 40px; 
    justify-content: space-between; 
}

.footer-col {
    flex: 1 1 200px; 
    min-width: 180px; 
}

/* Mobile Responsiveness - stack columns on small screens */
@media (max-width: 768px) {
    .footer-grid {
        flex-direction: column; 
        align-items: center; 
        gap: 25px; 
        text-align: center; 
    }
    .footer-col {
        min-width: 100%; 
        flex: 1 1 100%;
    }
    .main-footer {
        padding: 40px 15px; 
    }
}

/* Base styles for footer links for readability */
.footer-col ul a {
    color: white; 
    text-decoration: none;
    transition: color 0.3s; 
}

.footer-col ul a:hover {
    color: var(--primary-green); 
}

/* ---------------------------------
   Splash Screen
---------------------------------- */
.splash-screen {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg-base);
    z-index: 9999999; /* Must be the highest */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.splash-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.splash-logo {
    width: 120px;
    height: 120px;
    border-radius: 20px;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

.splash-title {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--dark-green);
    letter-spacing: -1px;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}