:root {
    --primary: #004571;
    --accent: #0ea5e9;
    --bg-internal: #f0f4f8;
    --white: #ffffff;
    --text-high: #0f172a;
    --text-mid: #475569;
    --text-low: #94a3b8;
    --border: #e2e8f0;
    --grad-start: #0076ff;
    --grad-end: #004571;
    --ics: #f59e0b;
    --ilas: #22c55e;
    --inet: #1e3a5f;
    --igs: #78909c;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    min-height: 100vh;
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
}

.hidden {
    display: none !important;
}

/* ================= MOBILE OPTIMIZATION FOUNDATIONS ================= */

/* Safe-area inset variables for notched / Dynamic Island devices */
:root {
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    --mobile-nav-height: 64px;
}

/* Eliminate 300ms tap delay on all interactive elements */
a, button, input, select, textarea, label, [role="button"], [onclick] {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Active tap feedback for app-like responsiveness */
button:active, [role="button"]:active, .btn:active {
    transform: scale(0.97);
    transition: transform 0.1s ease;
}

/* ================= SKELETON SHIMMER LOADING ================= */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton {
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
    border-radius: 6px;
}

.skeleton-text.short { width: 60%; }
.skeleton-text.medium { width: 80%; }
.skeleton-text.full { width: 100%; }

.skeleton-card {
    height: 180px;
    border-radius: 16px;
}

/* ================= REDUCED MOTION SUPPORT ================= */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .skeleton {
        animation: none;
        background: #e2e8f0;
    }
}

/* ================= DARK MODE AUTO-DETECTION ================= */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-internal: #0f172a;
        --white: #1e293b;
        --text-high: #f1f5f9;
        --text-mid: #94a3b8;
        --text-low: #64748b;
        --border: #334155;
    }

    .skeleton {
        background: linear-gradient(90deg, #334155 25%, #475569 50%, #334155 75%);
        background-size: 200% 100%;
    }
}