/* ============================================================
   STATIMUSIC — Design System
   Palette : #191919 | #333333 | #F0F0F0 | #F2CC0D | #888888
   Font : Inter
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #191919;
    color: #F0F0F0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; }

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 40px;
    height: 60px;
    background: #191919;
    border-bottom: 1px solid #2a2a2a;
}

.nav-logo { flex-shrink: 0; }
.nav-logo img { height: 32px; }

/* Search — always visible, left-aligned after logo */
.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    padding: 0 12px;
    width: 340px;
    transition: border-color 0.2s;
}
.search-wrapper:focus-within { border-color: #F2CC0D; }

.search-icon {
    color: #666;
    flex-shrink: 0;
    margin-right: 8px;
}

#search-input {
    background: none;
    border: none;
    color: #F0F0F0;
    font-family: inherit;
    font-size: 0.875rem;
    padding: 9px 0;
    outline: none;
    width: 100%;
}
#search-input::placeholder { color: #555; }

.search-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    z-index: 200;
}
.search-dropdown.hidden { display: none; }

.dropdown-group {
    padding: 8px 14px 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #555;
}
.dropdown-item {
    display: block;
    padding: 9px 14px;
    font-size: 0.875rem;
    color: #ccc;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dropdown-item:hover { background: #333; color: #F0F0F0; }

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
    margin-left: auto;
}
.nav-link {
    font-size: 0.85rem;
    font-weight: 500;
    color: #888;
    transition: color 0.2s;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.nav-link:hover { color: #F0F0F0; }

/* ============================================================
   MAIN & FOOTER
   ============================================================ */
main { flex: 1; }

.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 40px;
    border-top: 1px solid #2a2a2a;
    margin-top: 80px;
}
.site-footer span { font-size: 0.75rem; color: #555; }

/* ============================================================
   FLASH MESSAGES
   ============================================================ */
.flash { padding: 12px 40px; font-size: 0.875rem; font-weight: 500; }
.flash-success { background: #1a3a1a; color: #6fcf6f; }
.flash-error { background: #3a1a1a; color: #cf6f6f; }

/* ============================================================
   AUTH PAGES
   ============================================================ */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 60px);
    padding: 40px 20px;
}
.auth-card {
    background: #222;
    border: 1px solid #2e2e2e;
    border-radius: 12px;
    padding: 48px 40px;
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.auth-logo { margin: 0 auto 8px; }
.auth-card h1 { font-size: 1.4rem; font-weight: 600; text-align: center; }
.auth-hint { text-align: center; font-size: 0.875rem; color: #888; line-height: 1.5; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form input[type="email"],
.auth-form input[type="password"] {
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    color: #F0F0F0;
    font-family: inherit;
    font-size: 0.9rem;
    padding: 12px 16px;
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
}
.auth-form input:focus { border-color: #F2CC0D; }
.auth-form input::placeholder { color: #555; }
.btn-primary {
    background: #F2CC0D;
    color: #191919;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 13px 20px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    letter-spacing: 0.02em;
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.auth-switch { text-align: center; font-size: 0.85rem; color: #666; }
.auth-switch a { color: #F2CC0D; font-weight: 500; }
.auth-switch a:hover { text-decoration: underline; }
.auth-error { font-size: 0.85rem; color: #cf6f6f; text-align: center; }
.file-label {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2a2a2a;
    border: 1px dashed #444;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    font-size: 0.875rem;
    color: #888;
    transition: border-color 0.2s, color 0.2s;
    text-align: center;
}
.file-label:hover { border-color: #F2CC0D; color: #F0F0F0; }
.file-label input[type="file"] { display: none; }

/* ============================================================
   DASHBOARD — HOME
   ============================================================ */
.dashboard {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 24px 80px;
    display: flex;
    flex-direction: column;
    gap: 60px;
}

/* KPIs */
.kpis-section { display: flex; gap: 12px; flex-wrap: wrap; }
.kpi-card {
    background: #333;
    border-radius: 10px;
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 140px;
}
.kpi-value { font-size: 1.5rem; font-weight: 700; color: #F0F0F0; letter-spacing: -0.02em; }
.kpi-label { font-size: 0.75rem; font-weight: 500; color: #888; text-transform: uppercase; letter-spacing: 0.06em; }

/* Section titles */
.section-title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #888;
    margin-bottom: 24px;
}
.top-section { display: flex; flex-direction: column; }

/* ============================================================
   PODIUM GRID
   ============================================================ */
.podium-grid {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 40px;
}
.podium-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s;
}
.podium-card:hover { transform: translateY(-4px); }

.podium-img-wrap { flex-shrink: 0; overflow: hidden; }
.podium-img { width: 100%; height: 100%; object-fit: cover; }
.podium-img.circle, .no-cover.circle { border-radius: 50%; }
.podium-img.rounded, .no-cover.rounded { border-radius: 12px; }

.no-cover {
    width: 100%;
    height: 100%;
    background: #2a2a2a;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    font-size: 1.5rem;
    font-weight: 700;
}

.podium-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #F0F0F0;
    text-align: center;
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.podium-time {
    font-size: 0.78rem;
    color: #888;
    text-align: center;
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.podium-rank { font-size: 1.2rem; font-weight: 700; color: #F0F0F0; letter-spacing: -0.01em; }
.podium-rank.rank-gold { color: #F2CC0D; }

/* ============================================================
   DETAIL PAGES
   ============================================================ */
.detail-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 32px 24px 80px;
    display: flex;
    flex-direction: column;
    gap: 56px;
}
.back-btn { font-size: 0.85rem; color: #666; font-weight: 500; transition: color 0.2s; align-self: flex-start; }
.back-btn:hover { color: #F0F0F0; }

/* Header */
.detail-header { display: flex; gap: 48px; align-items: flex-start; }
.detail-cover-wrap { display: flex; flex-direction: column; align-items: center; gap: 16px; flex-shrink: 0; }

.detail-cover { width: 200px; height: 200px; object-fit: cover; }
.detail-cover.circle { border-radius: 50%; }
.detail-cover.rounded { border-radius: 12px; }

.no-cover.large { width: 200px; height: 200px; border-radius: 12px; font-size: 2rem; }
.no-cover.circle.large { border-radius: 50%; }

.detail-name { font-size: 1.3rem; font-weight: 700; text-align: center; color: #F0F0F0; }
.detail-sub { font-size: 0.9rem; color: #888; text-align: center; }
.detail-sub.secondary { font-size: 0.8rem; color: #555; }

.detail-right { flex: 1; display: flex; flex-direction: column; gap: 20px; padding-top: 8px; }
.detail-rank { font-size: 2.8rem; font-weight: 800; color: #F0F0F0; letter-spacing: -0.03em; line-height: 1; }
.detail-rank.rank-gold { color: #F2CC0D; }

.detail-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
    background: #333;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #ccc;
}

.detail-kpis-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.detail-kpi { background: #333; border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.detail-kpi-label { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: #666; }
.detail-kpi-value { font-size: 1rem; font-weight: 700; color: #F0F0F0; }

/* ============================================================
   TRACK TABLE
   ============================================================ */
.track-table-wrap {
    background: #222;
    border: 1px solid #2e2e2e;
    border-radius: 12px;
    overflow: hidden;
}
.track-table { width: 100%; border-collapse: collapse; }
.track-table thead tr { border-bottom: 1px solid #2e2e2e; }
.track-table th {
    padding: 12px 16px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #555;
    text-align: left;
}
.track-row { border-bottom: 1px solid #252525; cursor: pointer; transition: background 0.15s; }
.track-row:last-child { border-bottom: none; }
.track-row:hover { background: #2a2a2a; }
.track-row td { padding: 12px 16px; font-size: 0.875rem; color: #ccc; vertical-align: middle; }
.track-rank { color: #555; font-weight: 600; font-size: 0.8rem; width: 32px; }
.track-title { display: flex; align-items: center; gap: 12px; font-weight: 500; color: #F0F0F0; }
.track-thumb { width: 36px; height: 36px; border-radius: 4px; object-fit: cover; flex-shrink: 0; }
.track-meta { color: #666; font-size: 0.8rem; }
.track-time { color: #888; font-size: 0.8rem; text-align: right; }

/* ============================================================
   SMALL CARDS ROW
   ============================================================ */
.cards-row { display: flex; gap: 16px; flex-wrap: wrap; }
.small-card { display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; transition: transform 0.2s; width: 120px; }
.small-card:hover { transform: translateY(-3px); }
.small-card-img { width: 120px; height: 120px; object-fit: cover; }
.small-card-img.rounded { border-radius: 8px; }
.no-cover.small { width: 120px; height: 120px; border-radius: 8px; font-size: 1.2rem; }
.small-card-name { font-size: 0.78rem; font-weight: 600; color: #ccc; text-align: center; max-width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.small-card-time { font-size: 0.7rem; color: #666; }

/* ============================================================
   CHART
   ============================================================ */
.chart-section { display: flex; flex-direction: column; gap: 16px; }
.chart-wrap {
    background: #333;
    border-radius: 12px;
    overflow: hidden;
    padding: 16px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 700px) {
    .navbar { padding: 0 16px; gap: 12px; }
    .search-wrapper { width: 200px; }
    .dashboard { padding: 24px 16px 60px; }
    .detail-page { padding: 20px 16px 60px; }
    .detail-header { flex-direction: column; align-items: center; gap: 24px; }
    .detail-right { width: 100%; align-items: center; }
    .podium-grid { gap: 20px; }
    .kpis-section { gap: 8px; }
    .kpi-card { padding: 12px 16px; }
    .site-footer { padding: 20px 16px; }
}

.detail-sub:hover { color: #F2CC0D; text-decoration: none; }
a.detail-sub { transition: color 0.2s; }

/* ============================================================
   UPLOAD PAGE
   ============================================================ */
.page {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 48px 24px 80px;
}

.upload-title { color: #f2f2f2; font-size: 22px; font-weight: 500; text-align: center; margin-bottom: 8px; }
.upload-sub { color: #888; font-size: 14px; text-align: center; margin-bottom: 20px; max-width: 560px; }

.demo-banner {
    width: 100%;
    max-width: 560px;
    border: 1.5px solid #F2CC0D;
    border-radius: 10px;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    cursor: pointer;
    background: transparent;
    transition: background 0.15s;
    text-decoration: none;
    gap: 12px;
}
.demo-banner:hover { background: rgba(242, 204, 13, 0.07); }
.demo-banner-left { display: flex; align-items: center; gap: 12px; }
.demo-banner-text { color: #F2CC0D; font-size: 13px; font-weight: 500; line-height: 1.4; }
.demo-banner-sub { color: #a89200; font-size: 11px; font-weight: 400; margin-top: 2px; }
.demo-banner-arrow { color: #F2CC0D; opacity: 0.6; flex-shrink: 0; }

/* Drop zone */
.drop-zone {
    width: 100%;
    max-width: 560px;
    border: 1.5px dashed #333;
    border-radius: 16px;
    padding: 44px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    background: #1e1e1e;
    transition: border-color 0.2s, background 0.2s;
    margin-top: 8px;
    text-align: center;
}
.drop-zone:hover { border-color: #F2CC0D; background: #222; }
.drop-label { color: #f2f2f2; font-size: 15px; font-weight: 500; }
.drop-formats { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.format-pill {
    background: #2a2a2a;
    border: 0.5px solid #3a3a3a;
    border-radius: 5px;
    padding: 3px 9px;
    font-family: monospace;
    font-size: 11px;
    color: #888;
}
.format-label { font-size: 11px; color: #555; margin-left: 2px; }
.drop-hint { color: #555; font-size: 12px; }
.drop-multi { font-size: 12px; color: #666; display: flex; align-items: center; gap: 6px; }

.upload-error { font-size: 0.85rem; color: #cf6f6f; margin-top: 12px; width: 100%; max-width: 560px; }

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #222;
    border: 0.5px solid #2e2e2e;
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 6px;
}
.file-name { color: #aaa; font-size: 13px; }
.file-remove { background: none; border: none; color: #555; cursor: pointer; font-size: 14px; padding: 0 4px; }
.file-remove:hover { color: #f2f2f2; }

.btn-analyser {
    width: 100%;
    max-width: 560px;
    background: #F2CC0D;
    color: #191919;
    border: none;
    border-radius: 10px;
    padding: 14px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 12px;
    font-family: inherit;
}
.btn-analyser:hover { background: #e0bc00; }
.btn-analyser:disabled { opacity: 0.6; cursor: not-allowed; }

.divider {
    width: 100%;
    max-width: 560px;
    border: none;
    border-top: 0.5px solid #252525;
    margin: 44px 0 28px;
}

.help-title {
    font-size: 11px;
    color: #f2f2f2;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 20px;
    text-align: center;
    width: 100%;
    max-width: 560px;
}

.platforms {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 720px;
}

.platform-card {
    background: #1e1e1e;
    border: 0.5px solid #2a2a2a;
    border-radius: 12px;
    padding: 18px;
}
.platform-header { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 10px; }

.delay-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #2a2a2a;
    border: 0.5px solid #333;
    border-radius: 5px;
    padding: 3px 8px;
    font-size: 11px;
    color: #888;
    margin-bottom: 14px;
}

.step { display: flex; gap: 10px; margin-bottom: 10px; align-items: flex-start; }
.step-num {
    min-width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #2a2a2a;
    color: #555;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    margin-top: 1px;
    flex-shrink: 0;
}
.step-text { font-size: 12px; color: #666; line-height: 1.6; }
.step-text a { color: #F2CC0D; text-decoration: none; }
.step-text a:hover { text-decoration: underline; }
.step-text code { font-family: monospace; font-size: 10px; color: #aaa; background: #252525; padding: 1px 5px; border-radius: 3px; }
.step-text strong { color: #999; font-weight: 500; }

.tip {
    background: #1a1a1a;
    border: 0.5px solid #2a2a2a;
    border-radius: 7px;
    padding: 10px 12px;
    margin-top: 12px;
    font-size: 11px;
    color: #555;
    line-height: 1.5;
    display: flex;
    gap: 8px;
}

.tuto-screenshot { margin-top: 4px; }
.tuto-caption { font-size: 11px; color: #444; text-align: center; margin-top: 6px; font-style: italic; }

.hidden { display: none !important; }

/* ============================================================
   LANDING PAGE
   ============================================================ */
.landing-body {
    background: #191919;
    color: #F0F0F0;
    font-family: 'Inter', sans-serif;
}

/* Navbar */
.landing-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    height: 64px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(25, 25, 25, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid #2a2a2a;
}

.landing-nav-links {
    display: flex;
    align-items: center;
    gap: 12px;
}

.landing-btn-outline {
    padding: 8px 20px;
    border: 1px solid #444;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #ccc;
    transition: border-color 0.2s, color 0.2s;
}
.landing-btn-outline:hover { border-color: #F2CC0D; color: #F0F0F0; }

.landing-btn-yellow {
    padding: 8px 20px;
    background: #F2CC0D;
    color: #191919;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 700;
    transition: opacity 0.2s;
}
.landing-btn-yellow:hover { opacity: 0.88; }

.landing-btn-large {
    padding: 14px 32px;
    font-size: 1rem;
    border-radius: 10px;
}

/* Hero */
.landing-hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding-top: 64px;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

#hero-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 800px;
    padding: 40px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: #F0F0F0;
}

.hero-questions {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: #ccc;
    line-height: 1.6;
    font-weight: 500;
}

.hero-desc {
    font-size: 0.95rem;
    color: #888;
    max-width: 520px;
    line-height: 1.7;
}

/* Features */
.landing-features {
    padding: 100px 40px;
    max-width: 1100px;
    margin: 0 auto;
}

.features-title {
    font-size: 1.6rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 48px;
    color: #F0F0F0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.feature-card {
    background: #222;
    border: 1px solid #2e2e2e;
    border-radius: 16px;
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: border-color 0.2s, transform 0.2s;
}
.feature-card:hover { border-color: #F2CC0D; transform: translateY(-4px); }

.feature-icon {
    width: 64px;
    height: 64px;
    background: #2a2a2a;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #F0F0F0;
}

.feature-card p {
    font-size: 0.92rem;
    color: #888;
    line-height: 1.7;
}
.feature-card strong { color: #ccc; }

/* About */
.landing-about {
    background: #1e1e1e;
    border-top: 1px solid #2a2a2a;
    border-bottom: 1px solid #2a2a2a;
    padding: 80px 40px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.landing-about h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.landing-about p {
    font-size: 1rem;
    color: #888;
    max-width: 600px;
    line-height: 1.7;
}

.about-highlight {
    color: #F2CC0D !important;
    font-weight: 600;
    font-size: 1rem !important;
}

/* Footer */
.landing-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 28px 40px;
    background: #191919;
}
.landing-footer span { font-size: 0.75rem; color: #555; }

/* Responsive */
@media (max-width: 700px) {
    .landing-nav { padding: 0 16px; }
    .features-grid { grid-template-columns: 1fr; }
    .landing-features { padding: 60px 16px; }
    .landing-about { padding: 60px 16px; }
    .landing-footer { padding: 20px 16px; }
}