/* ============================================
   INDEX.CSS — Power BI Sync Skin
   PALETA DE COLORES UNIFORME AZUL (PROFESIONAL)
   ============================================ */

/* 1. CORE VARIABLES & THEMES */
:root {
    /* --- Base Palette (HLS) --- */
    --bg-h: 215;
    /* Base Azul Marino */
    --bg-s: 50%;
    --bg-l: 6%;

    --primary-h: 206;
    /* Azul Power BI */
    --primary-s: 100%;
    --primary-l: 41%;
    /* #0078d4 */

    --accent-h: 190;
    /* Cian/Azul Eléctrico */
    --accent-s: 100%;
    --accent-l: 65%;

    --text-h: 210;
    --text-s: 20%;

    /* --- Semantic Colors --- */
    --success-hue: 150;
    /* Verde semántico */
    --warning-hue: 35;
    /* Naranja (no usado, pero definido) */
    --error-hue: 0;
    /* Rojo semántico */

    /* --- Fonts --- */
    --font-main: 'Inter', -apple-system, system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* --- Animations --- */
    --ease-out: cubic-bezier(0.33, 1, 0.68, 1);
}

/* ============================================
   DARK THEME (Default)
   ============================================ */
[data-theme="dark"] {
    /* Backgrounds */
    --color-bg: hsl(var(--bg-h), var(--bg-s), var(--bg-l));
    --color-surface: hsl(var(--bg-h), 25%, 12%);
    --color-surface-soft: hsl(var(--bg-h), 20%, 16%);
    --color-border: hsla(var(--bg-h), 20%, 25%, 0.5);

    /* Text */
    --color-text-base: hsl(var(--text-h), var(--text-s), 95%);
    --color-text-muted: hsl(var(--text-h), 10%, 70%);
    --color-text-on-accent: #ffffff;

    /* Accents (All Blues now) */
    --color-primary: #0078d4;
    --color-accent: #36d4ff;
    /* Un azul más claro eléctrico */
    --color-glare: hsla(190, 100%, 75%, 0.1);

    /* UI Elements */
    --color-badge-bg: hsla(var(--primary-h), 100%, 15%, 0.6);
    --color-badge-border: hsla(var(--primary-h), 100%, 41%, 0.5);
    --color-prog-bg: hsla(var(--bg-h), 100%, 95%, 0.08);

    /* Shadow */
    --shadow-main: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
}

/* ============================================
   LIGHT THEME
   ============================================ */
[data-theme="light"] {
    --bg-l: 96%;
    --color-bg: hsl(var(--bg-h), 15%, var(--bg-l));
    --color-surface: #ffffff;
    --color-surface-soft: hsl(var(--bg-h), 10%, 90%);
    --color-border: hsla(var(--bg-h), 15%, 20%, 0.12);

    --color-text-base: hsl(var(--text-h), 20%, 10%);
    --color-text-muted: hsl(var(--text-h), 10%, 40%);
    --color-text-on-accent: #ffffff;

    --color-primary: #006ec4;
    --color-accent: #007cc0;
    --color-glare: rgba(0, 120, 212, 0.04);

    --color-badge-bg: hsla(var(--primary-h), 80%, 90%, 0.7);
    --color-badge-border: hsla(var(--primary-h), 70%, 50%, 0.3);
    --color-prog-bg: hsla(var(--bg-h), 20%, 10%, 0.06);

    --shadow-main: 0 10px 40px -15px rgba(0, 40, 100, 0.15);
}

/* ============================================
   ERROR STATE GLOBAL
   ============================================ */
[data-state="error"] {
    --color-primary: hsl(var(--error-hue), 80%, 50%);
    --color-accent: hsl(var(--error-hue), 90%, 65%);
    --color-badge-bg: hsla(var(--error-hue), 80%, 15%, 0.6);
    --color-badge-border: hsla(var(--error-hue), 80%, 50%, 0.5);
    --color-text-base: #fff1f1;
    --color-surface: #1a0505;
    /* Fondo rojo muy oscuro */
}

/* 2. RESET & BASE STYLES (NO CAMBIOS) */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font-main);
    background-color: var(--color-bg);
    color: var(--color-text-base);
    line-height: 1.5;
    overflow: hidden;
    height: 100%;
    width: 100%;
    transition: background-color 1s var(--ease-out);
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

strong {
    font-weight: 700;
    color: var(--color-primary);
}

/* 3. LAYOUT (NO CAMBIOS DE ESTRUCTURA) */
#physics-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    animation: fadeInCanvas 1.5s var(--ease-out) 0.5s forwards;
}

@keyframes fadeInCanvas {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Ambient Particles */
#ambient-particles {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.ambient-dot {
    position: absolute;
    background: linear-gradient(180deg, transparent, var(--color-accent), transparent);
    border-radius: 2px;
    opacity: 0;
    animation: ambientRise linear infinite;
    filter: blur(1px);
}

@keyframes ambientRise {
    0% {
        transform: translateY(100vh) scaleY(1);
        opacity: 0;
    }

    10% {
        opacity: 0.15;
    }

    80% {
        opacity: 0.15;
    }

    100% {
        transform: translateY(-100px) scaleY(1.5);
        opacity: 0;
    }
}

/* Glitch Overlay */
.glitch-overlay {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle, rgba(220, 38, 38, 0.1) 0%, rgba(0, 0, 0, 0) 70%);
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.glitch-overlay.active {
    opacity: 1;
    animation: glitchEffect 1.5s infinite;
}

@keyframes glitchEffect {
    0% {
        transform: translate(0);
    }

    10% {
        transform: translate(-5px, 2px);
    }

    20% {
        transform: translate(3px, -3px);
        mix-blend-mode: difference;
    }

    30% {
        transform: translate(0);
        mix-blend-mode: normal;
    }
}

/* 4. MAIN CONTAINER (Destellos Azules ahora) */
.main-container {
    position: relative;
    z-index: 10;
    height: 100%;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 4rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.main-container::after {
    content: '';
    position: absolute;
    top: 30%;
    left: -20%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, var(--color-glare) 0%, rgba(0, 0, 0, 0) 60%);
    z-index: -1;
    pointer-events: none;
    border-radius: 50%;
}

/* 5. UI ELEMENTS */

/* Theme Toggle (Adaptado a paleta azul) */
.theme-toggle {
    position: fixed;
    top: 2rem;
    left: 2rem;
    z-index: 100;
    padding: 0.5rem;
    border-radius: 50px;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    backdrop-filter: blur(8px);
    transition: all 0.3s var(--ease-out);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.theme-toggle:hover {
    transform: translateY(-2px);
    border-color: var(--color-accent);
}

.toggle-track {
    position: relative;
    width: 60px;
    height: 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 6px;
}

.toggle-icon {
    font-size: 1rem;
}

.toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 24px;
    height: 24px;
    background-color: var(--color-accent);
    /* Acento azul */
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .toggle-thumb {
    transform: translateX(32px);
}

/* Timer Container (Círculo azul brillante) */
.timer-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 100;
    pointer-events: none;
}

.timer-ring {
    position: relative;
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timer-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.timer-bg-circle {
    fill: none;
    stroke: var(--color-prog-bg);
    stroke-width: 6;
}

.timer-progress-circle {
    fill: none;
    stroke: var(--color-accent);
    /* Azul elérico */
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s linear, stroke 1s var(--ease-out);
}

.timer-display {
    position: absolute;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 2rem;
    letter-spacing: -1px;
    color: var(--color-text-base);
}

.timer-digits {
    display: inline-block;
    width: 1.1em;
    text-align: center;
}

.timer-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, var(--color-glare) 0%, rgba(0, 0, 0, 0) 70%);
    filter: blur(10px);
}

/* Status Badge */
.status-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    background-color: var(--color-badge-bg);
    border: 1px solid var(--color-badge-border);
    border-radius: 50px;
    backdrop-filter: blur(10px);
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--color-primary);
    /* Azul */
    box-shadow: 0 0 10px 2px var(--color-glare);
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(0.9);
    }
}

.status-text {
    font-size: 0.93rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-text-base);
}

/* Title Section (Eliminado Dorado, todo Azul Eléctrico brillante) */
.title-section {
    max-width: 700px;
    margin-bottom: 4rem;
    z-index: 2;
}

.main-title {
    font-size: 4.8rem;
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -3px;
    margin-bottom: 1.5rem;
}

.title-line {
    display: block;
    color: var(--color-text-base);
}

.title-accent {
    display: block;
    /* Gradiente Uniforme Azul Profesional */
    background: linear-gradient(135deg, #00bcf2 0%, #0078d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px var(--color-glare));
}

.subtitle {
    font-size: 1.35rem;
    color: var(--color-text-muted);
    max-width: 550px;
    transition: color 1s;
}

/* Progress Section (Barras azules) */
.progress-section {
    width: 100%;
    max-width: 600px;
    margin-bottom: 2rem;
    z-index: 2;
}

.progress-bar-container {
    width: 100%;
    height: 10px;
    background-color: var(--color-prog-bg);
    border-radius: 50px;
    overflow: hidden;
    margin-bottom: 0.75rem;
    border: 1px solid var(--color-border);
}

.progress-bar {
    height: 100%;
    width: 0%;
    /* Gradiente azul para la barra */
    background: linear-gradient(90deg, #0078d4 0%, #50e6ff 100%);
    border-radius: 50px;
    transition: width 0.5s var(--ease-out), background 1s var(--ease-out);
    box-shadow: 0 0 10px var(--color-glare);
}

.progress-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.93rem;
    color: var(--color-text-muted);
}

.progress-file {
    font-family: var(--font-mono);
    font-weight: 500;
}

.progress-percent {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--color-text-base);
}

/* Message Area (Error) (Mantiene rojo semántico pero profesional) */
.message-area {
    max-width: 600px;
    padding: 2.5rem;
    border-radius: 20px;
    background-color: var(--color-surface);
    border: 1px solid rgba(239, 68, 68, 0.3);
    box-shadow: var(--shadow-main);
    animation: messageSlideUp 0.6s var(--ease-out);
}

.hidden {
    display: none !important;
}

@keyframes messageSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.message-title {
    font-size: 2rem;
    font-weight: 800;
    color: #fff1f1;
    margin-bottom: 1rem;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.message-detail {
    color: #fca5a5;
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.message-detail strong {
    color: #fff;
}

.retry-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 2rem;
    background-color: #ef4444;
    color: white;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    transition: background 0.2s;
}

.retry-btn:hover {
    background-color: #dc2626;
}

/* 6. FOOTER */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 4rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.87rem;
    color: var(--color-text-muted);
    z-index: 5;
    background: linear-gradient(180deg, transparent, var(--color-bg));
}

.footer-dot {
    color: var(--color-border);
}

/* 7. ANIMATIONS */
.screen-shake {
    animation: screenShake 0.6s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes screenShake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}

/* 8. MEDIA QUERIES */
@media (max-width: 1024px) {
    .main-title {
        font-size: 4rem;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 15px;
    }

    .main-container {
        padding: 0 2rem;
    }

    .main-title {
        font-size: 3.2rem;
        letter-spacing: -1px;
    }

    .footer {
        padding: 1.5rem 2rem;
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .timer-container {
        top: auto;
        bottom: 8rem;
        right: 2rem;
        transform: scale(0.8);
        transform-origin: bottom right;
    }

    .theme-toggle {
        top: 1rem;
        left: auto;
        right: 1rem;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    .main-title {
        font-size: 2.8rem;
    }

    .subtitle {
        font-size: 1.1rem;
    }

    .status-badge {
        padding: 0.5rem 1rem;
    }
}