/* ============================================
   EZ VIRTUAL TOOLS - CONSTRUCTION
   Mobile Navigation & Layout
   ============================================ */

:root {
    /* Layout */
    --mobile-header-height: 60px;
    --mobile-bottom-nav-height: 68px;
    --mobile-safe-bottom: env(safe-area-inset-bottom, 0px);
    --touch-target: 48px;

    /* Spacing */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-full: 9999px;

    /* Construction Colors - Amber/Yellow theme */
    --accent: #f59e0b;
    --accent-hover: #fbbf24;
    --accent-glow: rgba(245, 158, 11, 0.15);
    --accent-glow-strong: rgba(245, 158, 11, 0.25);

    /* Glass effects */
    --glass-bg: rgba(18, 18, 26, 0.85);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.05);
    --surface-1: rgba(255, 255, 255, 0.03);
    --surface-2: rgba(255, 255, 255, 0.06);
    --surface-3: rgba(255, 255, 255, 0.09);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px var(--accent-glow);

    /* Animation */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.1);
}

/* Desktop - hide mobile elements */
@media (min-width: 769px) {
    .bottom-nav,
    .mobile-fab,
    .mobile-action-bar {
        display: none !important;
    }
    .mobile-menu {
        right: -320px !important;
        display: none !important;
    }
    .mobile-menu-overlay {
        display: none !important;
    }
}

/* Mobile enhancements */
@media (max-width: 768px) {
    html {
        scroll-behavior: smooth;
    }
    body {
        -webkit-font-smoothing: antialiased;
        padding-top: var(--mobile-header-height);
        padding-bottom: calc(var(--mobile-bottom-nav-height) + var(--mobile-safe-bottom) + 72px);
    }
}

/* Header */
@media (max-width: 768px) {
    .header {
        position: fixed !important;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        height: var(--mobile-header-height);
        padding: 0 var(--space-4) !important;
        background: var(--glass-bg) !important;
        backdrop-filter: blur(20px) saturate(180%);
        border-bottom: 1px solid var(--glass-border) !important;
        display: flex !important;
        align-items: center;
        justify-content: space-between;
    }
    .nav-links, .nav {
        display: none !important;
    }
    .logo span {
        background: linear-gradient(135deg, #f59e0b, #fbbf24);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }
}

/* Bottom Navigation */
.bottom-nav {
    display: none;
}

@media (max-width: 768px) {
    .bottom-nav {
        display: flex !important;
        position: fixed;
        bottom: var(--space-4);
        left: var(--space-4);
        right: var(--space-4);
        height: var(--mobile-bottom-nav-height);
        background: var(--glass-bg);
        backdrop-filter: blur(20px);
        border: 1px solid var(--glass-border);
        border-radius: var(--radius-2xl);
        box-shadow: var(--shadow-lg);
        z-index: 900;
        justify-content: space-around;
        align-items: center;
    }
    .bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        padding: var(--space-2) var(--space-4);
        color: rgba(255, 255, 255, 0.5);
        text-decoration: none;
        font-size: 10px;
        font-weight: 600;
        min-width: 56px;
        min-height: var(--touch-target);
        border-radius: var(--radius-lg);
        transition: all 0.25s var(--ease-out-expo);
        background: transparent;
        border: none;
        cursor: pointer;
        position: relative;
    }
    .bottom-nav-item::before {
        content: '';
        position: absolute;
        inset: 4px;
        border-radius: var(--radius-md);
        background: var(--accent);
        opacity: 0;
        transform: scale(0.8);
        transition: all 0.25s var(--ease-out-expo);
        z-index: -1;
    }
    .bottom-nav-item.active {
        color: white;
    }
    .bottom-nav-item.active::before {
        opacity: 1;
        transform: scale(1);
    }
    .bottom-nav-icon svg {
        width: 22px;
        height: 22px;
        stroke: currentColor;
        fill: none;
        stroke-width: 1.75;
    }
}

/* Forms */
@media (max-width: 768px) {
    .form-row, .input-row {
        display: flex !important;
        flex-direction: column !important;
        gap: var(--space-3) !important;
    }
    label {
        display: block;
        font-size: 12px !important;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: rgba(255, 255, 255, 0.5);
        margin-bottom: var(--space-2) !important;
    }
    input[type="text"],
    input[type="number"],
    select {
        width: 100%;
        font-size: 16px !important;
        padding: var(--space-4) !important;
        background: var(--surface-1) !important;
        border: 1px solid var(--glass-border) !important;
        border-radius: var(--radius-md) !important;
        color: white !important;
    }
    input:focus, select:focus {
        outline: none !important;
        border-color: var(--accent) !important;
        box-shadow: 0 0 0 3px var(--accent-glow) !important;
    }
}

/* Buttons */
@media (max-width: 768px) {
    .btn, button[type="submit"], .btn-primary {
        width: 100%;
        padding: var(--space-4) var(--space-5) !important;
        font-size: 15px !important;
        font-weight: 600;
        border-radius: var(--radius-md) !important;
        border: none;
        cursor: pointer;
    }
    .btn-primary, button[type="submit"] {
        background: linear-gradient(135deg, #f59e0b, #fbbf24) !important;
        color: white !important;
        box-shadow: var(--shadow-sm), 0 4px 12px var(--accent-glow);
    }
}

/* Results */
@media (max-width: 768px) {
    .results-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: var(--space-3) !important;
    }
    .result-value {
        font-size: 1.5rem !important;
        font-weight: 800;
        color: var(--accent) !important;
    }
    .result-label {
        font-size: 10px !important;
        text-transform: uppercase;
        color: rgba(255, 255, 255, 0.5);
    }
}

/* Cards */
@media (max-width: 768px) {
    .card, .calc-card {
        background: linear-gradient(135deg, var(--surface-2), var(--surface-1)) !important;
        border: 1px solid var(--glass-border) !important;
        border-radius: var(--radius-lg) !important;
        padding: var(--space-4) !important;
        margin-bottom: var(--space-4);
    }
}

/* Portrait mode simplification */
@media (max-width: 768px) and (orientation: portrait) {
    .header {
        height: 50px !important;
    }
    .bottom-nav {
        height: 60px !important;
    }
    body {
        padding-top: 50px !important;
        padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px) + 16px) !important;
    }
    .mobile-fab, .mobile-action-bar {
        display: none !important;
    }
}
