/* ============================================
   VOXS — Premium Enterprise Translation
   ============================================ */

:root {
    /* VOXS brand palette — deep navy + rich gold */
    --primary: #0F1B2D;
    --primary-hover: #1A2A42;
    --primary-light: rgba(15, 27, 45, 0.06);
    --accent: #D69E00;
    --accent-hover: #C08E00;
    --accent-light: rgba(214, 158, 0, 0.1);
    --gradient-brand: linear-gradient(135deg, #0F1B2D, #1A2A42);
    --gradient-gold: linear-gradient(135deg, #D69E00, #E8B82E);
    --success: #34C759;
    --success-light: rgba(52, 199, 89, 0.1);
    --danger: #FF3B30;
    --danger-light: rgba(255, 59, 48, 0.1);
    --warning: #FF9500;
    --warning-light: rgba(255, 149, 0, 0.1);

    /* Typography colours */
    --text: #1C1C1E;
    --text-secondary: #3C3C43;
    --text-tertiary: #8E8E93;
    --text-muted: #8E8E93;

    /* Surfaces */
    --bg: #F2F2F7;
    --bg-card: #FFFFFF;
    --bg-grouped: #FFFFFF;
    --bg-elevated: #FFFFFF;
    --bg-input: rgba(120, 120, 128, 0.08);

    /* Separators */
    --border: rgba(60, 60, 67, 0.12);
    --separator: rgba(60, 60, 67, 0.08);

    /* Spacing — generous Apple-style */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;

    /* Typography — Apple scale */
    --text-caption: 0.75rem;
    --text-footnote: 0.8125rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-body: 1.0625rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 2rem;
    --text-4xl: 2.5rem;
    --text-display: 3rem;

    /* Shadows — Apple diffused */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 2px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.08);
    --shadow-elevated: 0 12px 40px rgba(0, 0, 0, 0.12);

    /* Radius — Apple rounded */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-pill: 9999px;

    /* Blur */
    --blur-regular: 20px;
    --blur-thick: 40px;

    /* Transitions — Apple spring-like */
    --ease-apple: cubic-bezier(0.25, 0.1, 0.25, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration-fast: 0.2s;
    --duration-normal: 0.35s;
}

/* Dark mode — true Apple dark */
[data-theme="dark"] {
    --text: #FFFFFF;
    --text-secondary: #EBEBF5;
    --text-tertiary: #EBEBF599;
    --text-muted: #98989D;

    --bg: #000000;
    --bg-card: #1C1C1E;
    --bg-grouped: #2C2C2E;
    --bg-elevated: #2C2C2E;
    --bg-input: rgba(120, 120, 128, 0.24);

    --border: rgba(84, 84, 88, 0.36);
    --separator: rgba(84, 84, 88, 0.24);

    --primary-light: rgba(15, 27, 45, 0.15);
    --accent-light: rgba(214, 158, 0, 0.15);
    --success-light: rgba(52, 199, 89, 0.16);
    --danger-light: rgba(255, 59, 48, 0.16);
    --warning-light: rgba(255, 149, 0, 0.16);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 2px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-elevated: 0 12px 40px rgba(0, 0, 0, 0.5);
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text',
                 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.47;
    min-height: 100dvh;
    letter-spacing: -0.01em;
}

/* Layout */
.container {
    max-width: 440px;
    margin: 0 auto;
    padding: var(--space-6);
}

.container-wide {
    max-width: 680px;
    margin: 0 auto;
    padding: var(--space-6);
}

/* Apple Card — floating, no border, shadow-driven */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: var(--space-10);
    box-shadow: var(--shadow-md);
    border: none;
}

/* Utility */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.hidden { display: none !important; }

/* Typography — Apple-style hierarchy */
h1 {
    font-size: var(--text-3xl);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

h2 {
    font-size: var(--text-2xl);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

h3 {
    font-size: var(--text-xl);
    font-weight: 600;
    letter-spacing: -0.015em;
}

p {
    font-size: var(--text-body);
    line-height: 1.53;
}

/* Forms — iOS grouped style */
.form-group {
    margin-bottom: var(--space-5);
}

.form-label {
    display: block;
    font-size: var(--text-footnote);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: var(--space-2);
    color: var(--text-tertiary);
    padding-left: var(--space-1);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--space-4) var(--space-5);
    font-size: var(--text-body);
    font-family: inherit;
    border: none;
    border-radius: var(--radius);
    background: var(--bg-input);
    color: var(--text);
    transition: background var(--duration-fast) var(--ease-apple),
                box-shadow var(--duration-fast) var(--ease-apple);
    -webkit-appearance: none;
    appearance: none;
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

.form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238E8E93' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-4) center;
    padding-right: var(--space-10);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    background: var(--bg-input);
    box-shadow: 0 0 0 4px rgba(214, 158, 0, 0.25);
}

.form-input::placeholder {
    color: var(--text-tertiary);
}

/* Buttons — Apple pill style */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-body);
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-apple);
    text-decoration: none;
    line-height: 1.2;
    letter-spacing: -0.01em;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.btn:active {
    transform: scale(0.97);
    opacity: 0.85;
}

.btn-primary {
    background: var(--accent);
    color: #FFFFFF;
}
.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 16px rgba(214, 158, 0, 0.35);
}

.btn-danger {
    background: var(--danger);
    color: white;
}
.btn-danger:hover {
    opacity: 0.9;
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--accent);
    font-weight: 600;
}
.btn-secondary:hover {
    background: rgba(120, 120, 128, 0.14);
}

.btn-ghost {
    background: transparent;
    color: var(--accent);
    padding: var(--space-3) var(--space-4);
}
.btn-ghost:hover {
    background: var(--accent-light);
}

.btn-lg {
    padding: var(--space-5) var(--space-8);
    font-size: var(--text-lg);
    border-radius: var(--radius-lg);
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-pill {
    border-radius: var(--radius-pill);
}

/* Status badges — Apple system colours */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    font-size: var(--text-sm);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.status-live {
    background: var(--success-light);
    color: var(--success);
}

.status-paused {
    background: var(--warning-light);
    color: var(--warning);
}

.status-ended {
    background: var(--danger-light);
    color: var(--danger);
}

/* Pulse animation — subtle Apple breathing */
.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: applePulse 2s var(--ease-apple) infinite;
}

@keyframes applePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

/* Error banner — Apple-style inline alert */
.error-banner {
    background: var(--danger-light);
    color: var(--danger);
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius);
    text-align: center;
    margin-bottom: var(--space-4);
    cursor: pointer;
    font-size: var(--text-sm);
    font-weight: 500;
    animation: slideDown 0.3s var(--ease-spring);
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Glass morphism — frosted glass effect */
.glass {
    background: rgba(255, 255, 255, 0.72);
    -webkit-backdrop-filter: saturate(180%) blur(var(--blur-regular));
    backdrop-filter: saturate(180%) blur(var(--blur-regular));
}

[data-theme="dark"] .glass {
    background: rgba(28, 28, 30, 0.72);
}

/* Mobile — prevent horizontal overflow */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }

    .container,
    .container-wide {
        padding: var(--space-4);
    }

    .card {
        padding: var(--space-6);
        border-radius: var(--radius-lg);
    }

    h1 {
        font-size: var(--text-2xl);
    }

    h2 {
        font-size: var(--text-xl);
    }

    .btn-lg {
        padding: var(--space-4) var(--space-6);
        font-size: var(--text-base);
    }
}

@media (max-width: 480px) {
    .container,
    .container-wide {
        padding: var(--space-3);
    }

    .card {
        padding: var(--space-5);
    }

    /* Ensure all buttons meet 44px touch target */
    .btn {
        min-height: 44px;
    }
}

/* RTL support */
[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .form-input,
[dir="rtl"] .form-select {
    text-align: right;
}

/* Smooth page transitions */
.screen-enter {
    animation: screenFadeIn 0.4s var(--ease-apple);
}

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

/* Selection */
::selection {
    background: rgba(214, 158, 0, 0.2);
}

/* Scrollbar — thin Apple style */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
}
[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
}
