@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&family=DM+Sans:ital,wght@0,400;0,500;0,700;1,400&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
    --bg-primary: #0a0c10;
    --bg-secondary: #12151c;
    --bg-card: #181c26;
    --bg-card-hover: #1e2330;
    --bg-elevated: #222838;

    --text-primary: #e8eaf0;
    --text-secondary: #8b90a0;
    --text-muted: #555a6e;

    --accent-lime: #c8ff2e;
    --accent-lime-dim: rgba(200, 255, 46, 0.15);
    --accent-blue: #2ea0ff;
    --accent-blue-dim: rgba(46, 160, 255, 0.12);
    --accent-red: #ff4466;
    --accent-orange: #ff8a2e;

    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --shadow-card: 0 2px 12px rgba(0,0,0,0.3);
    --shadow-elevated: 0 8px 32px rgba(0,0,0,0.5);

    --font-display: 'Archivo Black', sans-serif;
    --font-body: 'DM Sans', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ─── Typography ─── */
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.02em; line-height: 1.15; }
h1 { font-size: 2.5rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; }

a { color: var(--accent-lime); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: #e0ff7a; }

/* ─── Layout ─── */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ─── Navigation ─── */
.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 12, 16, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.nav-brand {
    font-family: var(--font-display);
    font-size: 1.15rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-brand .ball-icon {
    width: 28px;
    height: 28px;
    background: var(--accent-lime);
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 20px rgba(200, 255, 46, 0.3);
}

.nav-brand .ball-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(30deg);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid rgba(0,0,0,0.2);
    clip-path: polygon(0 40%, 100% 40%, 100% 60%, 0 60%);
}

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

.nav-links a, .nav-links button {
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: none;
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.nav-links a:hover, .nav-links button:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.05);
}

.nav-links .nav-username {
    color: var(--accent-lime);
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-lime);
    color: #0a0c10;
}

.btn-primary:hover {
    background: #d8ff5e;
    box-shadow: 0 0 30px rgba(200, 255, 46, 0.25);
    transform: translateY(-1px);
    color: #0a0c10;
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.btn-danger {
    background: rgba(255, 68, 102, 0.1);
    color: var(--accent-red);
    border: 1px solid rgba(255, 68, 102, 0.2);
}

.btn-danger:hover {
    background: rgba(255, 68, 102, 0.2);
}

.btn-sm { padding: 8px 16px; font-size: 0.8rem; }
.btn-lg { padding: 16px 32px; font-size: 1rem; }

/* ─── Cards ─── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
    transition: all var(--transition-normal);
}

.card:hover {
    border-color: var(--border-hover);
}

/* ─── Forms ─── */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    outline: none;
    transition: all var(--transition-fast);
}

.form-input:focus {
    border-color: var(--accent-lime);
    box-shadow: 0 0 0 3px var(--accent-lime-dim);
}

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

/* ─── Status Badges ─── */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-pending { background: rgba(255, 138, 46, 0.12); color: var(--accent-orange); }
.status-processing { background: var(--accent-blue-dim); color: var(--accent-blue); }
.status-completed { background: var(--accent-lime-dim); color: var(--accent-lime); }
.status-failed { background: rgba(255, 68, 102, 0.12); color: var(--accent-red); }

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.status-processing::before { animation: pulse-dot 1.5s infinite; }

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ─── Stats Grid ─── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--accent-lime);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.stat-unit {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ─── Upload Area ─── */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-xl);
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.upload-zone:hover {
    border-color: var(--accent-lime);
    background: var(--accent-lime-dim);
}

.upload-zone.drag-over {
    border-color: var(--accent-lime);
    background: var(--accent-lime-dim);
    transform: scale(1.01);
}

.upload-zone .upload-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.6;
}

.upload-zone h3 {
    color: var(--text-primary);
    margin-bottom: 8px;
}

.upload-zone p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.upload-progress {
    margin-top: 24px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-primary);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--accent-lime);
    border-radius: 3px;
    transition: width 0.3s ease;
    box-shadow: 0 0 12px rgba(200, 255, 46, 0.4);
}

.progress-text {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 8px;
}

/* ─── Video List ─── */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.video-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
    cursor: pointer;
}

.video-card:hover {
    border-color: var(--accent-lime);
    box-shadow: 0 4px 20px rgba(200, 255, 46, 0.08);
    transform: translateY(-2px);
}

.video-card-header {
    background: var(--bg-elevated);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.video-card-body {
    padding: 20px;
}

.video-card-title {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-card-meta {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 8px;
}

.video-card-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
}

.video-card-stat {
    text-align: center;
    padding: 8px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
}

.video-card-stat-value {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--accent-lime);
}

.video-card-stat-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ─── Analysis Page ─── */
.analysis-header {
    padding: 40px 0 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 32px;
}

.analysis-header h1 {
    font-size: 1.75rem;
    margin-bottom: 8px;
}

.player-comparison {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 24px;
    align-items: start;
    margin-top: 32px;
}

.player-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
}

.player-panel.player-1 { border-top: 3px solid #ff4466; }
.player-panel.player-2 { border-top: 3px solid #2ea0ff; }

.player-name {
    font-family: var(--font-display);
    font-size: 1.1rem;
    margin-bottom: 24px;
}

.player-1 .player-name { color: #ff4466; }
.player-2 .player-name { color: #2ea0ff; }

.player-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.player-stat-row:last-child { border-bottom: none; }

.player-stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.player-stat-value {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
}

.vs-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--text-muted);
    padding-top: 60px;
}

/* ─── Shot Timeline ─── */
.shot-timeline {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-top: 32px;
}

.shot-timeline h3 {
    margin-bottom: 20px;
}

.timeline-bar {
    width: 100%;
    height: 48px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    position: relative;
    overflow: hidden;
}

.timeline-marker {
    position: absolute;
    top: 0;
    width: 3px;
    height: 100%;
    border-radius: 2px;
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.timeline-marker:hover {
    transform: scaleX(2);
}

.timeline-marker.player-1 { background: #ff4466; }
.timeline-marker.player-2 { background: #2ea0ff; }

/* ─── Video Player ─── */
.video-player-section {
    margin-top: 32px;
}

.video-player-wrapper {
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-player-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ─── Hero / Landing ─── */
.hero {
    padding: 100px 0 80px;
    text-align: center;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(200, 255, 46, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.hero h1 {
    font-size: 3.5rem;
    line-height: 1.05;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-lime) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 540px;
    margin: 0 auto 36px;
}

.hero-cta {
    display: flex;
    gap: 16px;
    justify-content: center;
}

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

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    transition: all var(--transition-normal);
}

.feature-card:hover {
    border-color: var(--accent-lime);
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(200, 255, 46, 0.06);
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 16px;
}

.feature-card h3 {
    margin-bottom: 8px;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ─── Auth Pages ─── */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 64px);
    padding: 40px 24px;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-elevated);
}

.auth-card h2 {
    margin-bottom: 8px;
}

.auth-card .auth-subtitle {
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-size: 0.9rem;
}

.auth-divider {
    text-align: center;
    margin-top: 24px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.auth-divider a { color: var(--accent-lime); font-weight: 600; }

.error-message {
    background: rgba(255, 68, 102, 0.1);
    border: 1px solid rgba(255, 68, 102, 0.2);
    color: var(--accent-red);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    margin-bottom: 20px;
    display: none;
}

.error-message.visible { display: block; }

/* ─── Dashboard ─── */
.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 40px 0 24px;
}

.empty-state {
    text-align: center;
    padding: 80px 40px;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state h3 {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

/* ─── Loading States ─── */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--accent-lime);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.skeleton {
    background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-card-hover) 50%, var(--bg-elevated) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    .hero h1 { font-size: 2.25rem; }
    .features { grid-template-columns: 1fr; }
    .player-comparison { grid-template-columns: 1fr; }
    .vs-divider { padding-top: 0; }
    .video-grid { grid-template-columns: 1fr; }
    .hero-cta { flex-direction: column; align-items: center; }
}

/* ─── Toast Notifications ─── */
.toast-container {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 20px;
    font-size: 0.9rem;
    box-shadow: var(--shadow-elevated);
    animation: slide-in 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.success { border-left: 3px solid var(--accent-lime); }
.toast.error { border-left: 3px solid var(--accent-red); }

@keyframes slide-in {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
