/**
 * Critical CSS — extracted from index.html inline <style> block
 * for CSP compliance (removes need for 'unsafe-inline' in style-src).
 *
 * This file is loaded synchronously in <head> to prevent FOUC.
 */

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

#root {
    height: 100%;
    display: flex;
    flex-direction: column;
}

body {
    background-color: #F8FAFC;
    color: #0F172A;
    font-family: 'Outfit', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

.font-outfit-ready body {
    font-family: 'Outfit', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* iPad specific scroll adjustments */
.custom-scrollbar {
    -webkit-overflow-scrolling: touch;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 10px;
}

.glass-panel {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

/* Prevent input zoom on iOS */
input,
select,
textarea {
    font-size: 16px !important;
}

/* iPad Safe Area Utilities */
.pt-safe {
    padding-top: env(safe-area-inset-top);
}

.pb-safe {
    padding-bottom: env(safe-area-inset-bottom);
}

.pl-safe {
    padding-left: env(safe-area-inset-left);
}

.pr-safe {
    padding-right: env(safe-area-inset-right);
}

.mt-safe {
    margin-top: env(safe-area-inset-top);
}

.mb-safe {
    margin-bottom: env(safe-area-inset-bottom);
}

.h-screen-dvh {
    height: 100vh;
    height: 100dvh;
}

/* Touch target helper */
.touch-target {
    min-width: 44px;
    min-height: 44px;
}

/* Perspective for card flips on touch */
.perspective-1000 {
    perspective: 1000px;
}

.preserve-3d {
    transform-style: preserve-3d;
}

.backface-hidden {
    backface-visibility: hidden;
}

/* ============================================
   LOADING SPINNER — shown before main CSS loads
   These classes match the LoadingFallback component
   in AppRouter.tsx. Without them, the spinner is
   invisible until the async Tailwind CSS activates.
   ============================================ */
.min-h-screen { min-height: 100vh; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-4 { gap: 1rem; }
.w-12 { width: 3rem; }
.h-12 { height: 3rem; }
.border-2 { border-width: 2px; }
.border-indigo-200 { border-color: #c7d2fe; }
.border-t-indigo-600 { border-top-color: #4f46e5; }
.rounded-full { border-radius: 9999px; }
.text-slate-500 { color: #64748b; }
.font-medium { font-weight: 500; }
.font-sans { font-family: 'Outfit', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
.antialiased { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
.bg-white { background-color: #fff; }
.w-full { width: 100%; }
.min-h-screen { min-height: 100vh; }
.relative { position: relative; }

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.animate-spin { animation: spin 1s linear infinite; }
