/* @file: style.css */
/* Focus Vault — polished UI, consistent theming, no hacks */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700;900&display=swap');

/* ═══════════════════════════════════════════════════
   CSS Variables
══════════════════════════════════════════════════════ */
:root {
    --accent:          #6964c6;
    --accent-dim:      rgba(105, 100, 198, 0.4);
    --text-primary:    #282456;
    --text-primary-inv:#ffffff;
    --bg-light:        #d0cbe5;
    --bg-focus:        #7a6da2;
    --bg-dark:         #1a1b1e;
    --bg-dark-focus:   #0d0d0d;
    --glass-light:     rgba(255, 255, 255, 0.38);
    --glass-dark:      rgba(255, 255, 255, 0.05);
    --transition:      all 0.65s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ═══════════════════════════════════════════════════
   Base
══════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    min-height: 100vh;
    background-color: var(--bg-light);
    color: var(--text-primary);
    transition: var(--transition);
    -webkit-font-smoothing: antialiased;
}

body[data-focus-state="active"] {
    background-color: var(--bg-focus) !important;
    color: var(--text-primary-inv) !important;
}

html.dark body {
    background-color: var(--bg-dark) !important;
    color: #f1f5f9;
}

html.dark body[data-focus-state="active"] {
    background-color: var(--bg-dark-focus) !important;
}

/* ═══════════════════════════════════════════════════
   Typography
══════════════════════════════════════════════════════ */
/* Timer & token display — tabular nums for clean digit rolling */
#timer,
#token-display,
[data-unit] {
    font-family: 'Times New Roman', Times, serif !important;
    font-variant-numeric: tabular-nums;
}

#timer {
    color: var(--accent);
    font-weight: 900;
    letter-spacing: -0.02em;
    transition: color 0.5s ease;
}

html.dark #timer,
html.dark #rankTextTop,
body[data-focus-state="active"] #timer,
body[data-focus-state="active"] #rankTextTop {
    color: #ffffff !important;
}

/* ═══════════════════════════════════════════════════
   Glassmorphism Cards
══════════════════════════════════════════════════════ */
.glass-card {
    background: var(--glass-light);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 2rem;
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    border: none !important;
    transition: background 0.5s ease;
}

html.dark .glass-card {
    background: var(--glass-dark);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* ═══════════════════════════════════════════════════
   Start Button
══════════════════════════════════════════════════════ */
#startBtn {
    border: none !important;
    outline: none !important;
    background-color: var(--accent);
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    font-size: 0.85rem;
    letter-spacing: 0.15em;
    cursor: pointer;
    transition:
        transform 0.2s ease,
        background-color 0.3s ease,
        box-shadow 0.3s ease;
    box-shadow: 0 8px 24px var(--accent-dim);
}

#startBtn:hover {
    box-shadow: 0 12px 32px var(--accent-dim);
    transform: translateY(-1px);
}

html.dark #startBtn {
    background-color: #787878 !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

body[data-focus-state="active"] #startBtn {
    background-color: rgba(255, 255, 255, 0.12) !important;
    backdrop-filter: blur(10px);
    box-shadow: none;
}

#startBtn:active {
    transform: scale(0.96) translateY(0);
    box-shadow: none;
}

/* ═══════════════════════════════════════════════════
   SVG Progress Circle
══════════════════════════════════════════════════════ */
#progressCircle {
    filter: drop-shadow(0 0 10px var(--accent-dim));
    transition:
        stroke-dashoffset 0.9s cubic-bezier(0.4, 0, 0.2, 1),
        color 0.5s ease;
    color: var(--accent);
}

html.dark #progressCircle {
    filter: drop-shadow(0 0 14px rgba(255, 255, 255, 0.15));
    color: #ffffff !important;
}

body[data-focus-state="active"] #progressCircle {
    color: #ffffff !important;
    filter: drop-shadow(0 0 14px rgba(255, 255, 255, 0.25));
}

/* ═══════════════════════════════════════════════════
   Mining / Assets Card
══════════════════════════════════════════════════════ */
.mining-card {
    background: linear-gradient(135deg, #4f4b84 0%, #3b3861 100%);
    border-radius: 2rem !important;
    color: #ffffff;
    border: none !important;
    box-shadow:
        0 25px 50px -12px rgba(59, 56, 97, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    position: relative;
    overflow: hidden;
}

/* Subtle shimmer overlay */
.mining-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(255,255,255,0.08) 0%,
        transparent 50%,
        rgba(0,0,0,0.08) 100%
    );
    pointer-events: none;
}

/* Decorative orb */
.mining-card::after {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    pointer-events: none;
}

#token-display {
    color: #ffffff;
    font-size: 3rem;
    letter-spacing: -0.04em;
    font-weight: 500;
}

/* ═══════════════════════════════════════════════════
   Activity Log Entries
══════════════════════════════════════════════════════ */
.log-entry {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.log-entry:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* ═══════════════════════════════════════════════════
   Custom Dropdown
══════════════════════════════════════════════════════ */
#customOptions {
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                opacity    0.3s ease;
}

.option-item {
    transition: background 0.15s ease, color 0.15s ease;
    font-family: 'Inter', sans-serif;
}

/* ═══════════════════════════════════════════════════
   Scrollbar Annihilation
══════════════════════════════════════════════════════ */
#customOptions, #logList, .custom-scroll {
    scrollbar-width: none;
    -ms-overflow-style: none;
}
#customOptions::-webkit-scrollbar,
#logList::-webkit-scrollbar { display: none !important; }

/* ═══════════════════════════════════════════════════
   Digit Roll Animation
══════════════════════════════════════════════════════ */
@keyframes roll {
    0%   { transform: translateY(8px); opacity: 0; }
    100% { transform: translateY(0);   opacity: 1; }
}

.animate-roll {
    display: inline-block;
    animation: roll 0.18s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* ═══════════════════════════════════════════════════
   Nav EXP Bar
══════════════════════════════════════════════════════ */
nav #expBar {
    background: linear-gradient(90deg, rgba(255,255,255,0.9), rgba(255,255,255,0.5));
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

body[data-focus-state="active"] nav {
    border-color: rgba(255,255,255,0.15);
}

/* ═══════════════════════════════════════════════════
   Misc Polish
══════════════════════════════════════════════════════ */
/* Ensure Syne is used everywhere for headings/labels */
p, span, button, li, h1, h2, h3 {
    font-family: 'Inter', sans-serif;
}

/* Subtle fade-in on load */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

main.glass-card {
    animation: fadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

section > article:nth-child(1) { animation: fadeUp 0.6s 0.1s cubic-bezier(0.22, 1, 0.36, 1) both; }
section > article:nth-child(2) { animation: fadeUp 0.6s 0.2s cubic-bezier(0.22, 1, 0.36, 1) both; }
section > article:nth-child(3) { animation: fadeUp 0.6s 0.3s cubic-bezier(0.22, 1, 0.36, 1) both; }

/* ── Single-page view layout ──────────────────────── */
body[data-view="app"] {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3rem 1.5rem;
}