﻿/* =========================================================
   SmatoroAI Theme & Base System (ES5 / TV Compatible)
   ========================================================= */

:root, html.light, [data-theme="light"], body.light {
    --bg-base:        #f8fafc;
    --bg-surface:     #ffffff;
    --bg-elevated:    #f1f5f9;
    --bg-card:        #ffffff;
    --surface-hover:  rgba(0, 0, 0, 0.04);
    --border:         rgba(0, 0, 0, 0.08);
    --border-strong:  rgba(0, 0, 0, 0.14);
    --text-primary:   #0f172a;
    --text-secondary: #475569;
    --text-muted:     #64748b;
    --accent:         #ea580c;
    --accent-hover:   #c2410c;
    --accent-dim:     rgba(234, 88, 12, 0.12);
    --accent-glow:    rgba(234, 88, 12, 0.2);
    --accent-gradient: linear-gradient(135deg, #ea580c, #e11d48);
    --blue:           #2563eb;
    --blue-dim:       rgba(37, 99, 235, 0.1);
    --purple:         #9333ea;
    --green:          #16a34a;
    --green-dim:      rgba(22, 163, 74, 0.1);
    --red:            #dc2626;
    --red-dim:        rgba(220, 38, 38, 0.1);
    --teal:           #0d9488;
    --shadow-sm:      0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md:      0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg:      0 10px 25px rgba(0, 0, 0, 0.12);
}

html.dark, [data-theme="dark"], body.dark {
    --bg-base:        #0b0d12;
    --bg-surface:     #12151e;
    --bg-elevated:    #1a1e2a;
    --bg-card:        #1e2230;
    --surface-hover:  rgba(255, 255, 255, 0.05);
    --border:         rgba(255, 255, 255, 0.08);
    --border-strong:  rgba(255, 255, 255, 0.14);
    --text-primary:   #f0f2f8;
    --text-secondary: #9aa3bc;
    --text-muted:     #5a6380;
    --accent:         #fb923c;
    --accent-hover:   #f97316;
    --accent-dim:     rgba(251, 146, 60, 0.15);
    --accent-glow:    rgba(251, 146, 60, 0.25);
    --accent-gradient: linear-gradient(135deg, #fb923c, #f43f5e);
    --blue:           #60a5fa;
    --blue-dim:       rgba(96, 165, 250, 0.12);
    --purple:         #a78bfa;
    --green:          #34d399;
    --green-dim:      rgba(52, 211, 153, 0.12);
    --red:            #f87171;
    --red-dim:        rgba(248, 113, 113, 0.15);
    --teal:           #2dd4bf;
    --shadow-sm:      0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md:      0 4px 14px rgba(0, 0, 0, 0.4);
    --shadow-lg:      0 10px 30px rgba(0, 0, 0, 0.55);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    height: 100%;
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
    transition: background-color 0.25s ease, color 0.25s ease;
}

/* Custom TV Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Focus outline for TV Remote Navigation */
button:focus, select:focus, input:focus, a:focus, [tabindex]:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

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

.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
}

.spinner-accent {
    border: 3px solid var(--border-strong);
    border-top-color: var(--accent);
    width: 32px;
    height: 32px;
}
