/**
 * css/core/base.css
 * Base styles: CSS Variables, Reset, Typography, Utilities, Scrollbar,
 * Animated Background, Animations
 */

/* =============================================================================
   CSS VARIABLES & THEME
   ============================================================================= */
:root {
    /* Primary palette */
    --primary: #3b82f6;
    --primary-light: #60a5fa;
    --primary-dark: #2563eb;

    /* Status colors */
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --error: #ef4444;
    --error-light: #f87171;
    --error-bg: rgba(239, 68, 68, 0.1);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #2563eb 0%, #3b82f6 50%, #60a5fa 100%);
    --gradient-subtle: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(14, 165, 233, 0.08) 100%);
    --gradient-mesh: radial-gradient(at 40% 20%, rgba(59, 130, 246, 0.1) 0px, transparent 50%),
                     radial-gradient(at 80% 0%, rgba(14, 165, 233, 0.1) 0px, transparent 50%),
                     radial-gradient(at 0% 50%, rgba(96, 165, 250, 0.06) 0px, transparent 50%),
                     radial-gradient(at 80% 50%, rgba(56, 189, 248, 0.06) 0px, transparent 50%),
                     radial-gradient(at 0% 100%, rgba(37, 99, 235, 0.06) 0px, transparent 50%);

    /* Backgrounds */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-glass: rgba(255, 255, 255, 0.7);
    --bg-input: #ffffff;

    /* Text */
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    /* Borders */
    --border-color: rgba(148, 163, 184, 0.3);
    --border-light: rgba(148, 163, 184, 0.15);
    --border-glow: rgba(37, 99, 235, 0.5);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 40px rgba(37, 99, 235, 0.2);
    --shadow-primary-sm: 0 2px 8px rgba(37, 99, 235, 0.3);
    --shadow-primary: 0 4px 14px rgba(37, 99, 235, 0.35);
    --shadow-primary-lg: 0 6px 20px rgba(37, 99, 235, 0.45);
    --shadow-primary-focus: 0 0 0 3px rgba(37, 99, 235, 0.1);

    /* Spacing & Sizing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    --header-height: 70px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =============================================================================
   RESET & BASE
   ============================================================================= */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-mesh);
    pointer-events: none;
    z-index: 0;
}

body.modal-open {
    overflow: hidden;
}

input,
button,
textarea,
select {
    font-family: inherit;
}

#app {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* =============================================================================
   TYPOGRAPHY
   ============================================================================= */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

p { margin-bottom: 1rem; }

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover { color: var(--primary-dark); }

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* =============================================================================
   NON-SELECTABLE UI ELEMENTS
   ============================================================================= */
.logo, .logo-text, .nav-btn, .btn, .tab, .mode-btn,
.step, .step-num,
.feature-icon, .feature-icon-wrap,
.upload-icon, .upload-zone-icon, .upload-zone-text, .upload-zone-hint,
.hero-badge, .badge-icon,
.type-icon, .type-name, .type-desc,
.checkbox, .checkbox-mark,
.stat-label, .stat-value, .score-label, .score-circle,
.int-avatar, .avatar-icon, .interviewer-tab,
.rec-icon, .rec-text, .skip-btn,
.footer-brand, .footer-links, .modal-close,
.msg-icon, .speaking-indicator,
h1, h2, h3, h4, h5, h6, label,
.section-title, .hero-title, .hero-subtitle,
.config-title, .ready-subtitle {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* =============================================================================
   UTILITIES
   ============================================================================= */
.hidden { display: none !important; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.no-data {
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    padding: 1.5rem;
}

/* =============================================================================
   SCROLLBAR
   ============================================================================= */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) var(--bg-tertiary);
}

/* =============================================================================
   ANIMATED BACKGROUND SHAPES
   ============================================================================= */
.bg-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bg-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s ease-in-out infinite;
}

.bg-shape-1 {
    width: 600px;
    height: 600px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(16, 185, 129, 0.08));
    top: -200px;
    left: -200px;
    animation-delay: 0s;
}

.bg-shape-2 {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.08), rgba(16, 185, 129, 0.06));
    top: 50%;
    right: -150px;
    animation-delay: -7s;
}

.bg-shape-3 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.08), rgba(37, 99, 235, 0.06));
    bottom: -100px;
    left: 30%;
    animation-delay: -14s;
}

/* =============================================================================
   ANIMATIONS
   ============================================================================= */
@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -30px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(-30px, -20px) scale(1.02); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@keyframes modalIn {
    from { opacity: 0; transform: translate(-50%, calc(-50% + 12px)); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes sparkle {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.2) rotate(10deg); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes btn-glow {
    0%, 100% { box-shadow: var(--shadow-primary); }
    50% { box-shadow: 0 4px 30px rgba(37, 99, 235, 0.55), 0 0 40px rgba(37, 99, 235, 0.2); }
}

@keyframes recording-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { transform: scale(1.01); box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

@keyframes speakingPulse {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40% { transform: scale(1.2); opacity: 1; }
}

@keyframes thinkingPulse {
    0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1); }
}