/* Copyright (c) 2026 Yu Chen. All rights reserved. */
/* SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0 */

/*
 * Base shell for the standalone benchmark dashboard.
 * Theme tokens, reset, header, cards, tables and the theme switch are carried
 * over verbatim from FeedForward-Benchmark's app/data_manager/css/style.css so benchmark.css and
 * scene_viewer.css render identically; only the page layout below differs
 * (no sidebar).
 */

:root {
    --primary: #4361ee;
    --primary-light: #4895ef;
    --secondary: #3f37c9;
    --accent: #f72585;
    --success: #4cc9f0;
    --warning: #f8961e;
    --danger: #f72585;
    --dark: #0a0c12;
    --light: #ffffff;
    --gray: #6c757d;
    --gray-light: #f8f9fa;
    --gray-dark: #343a40;
    --sidebar-width: 280px;
    --header-height: 70px;
    --transition: all 0.2s ease;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 15px 30px rgba(0, 0, 0, 0.1);
    --blur-amount: 12px;
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.5);
    --card-bg: #ffffff;
    --border-radius: 24px;
    --bg-gradient-start: #f5f7fa;
    --bg-gradient-end: #e9ecf5;
    --text-primary: var(--gray-dark);
    --text-secondary: var(--gray);
    --tag-bg: rgba(255, 255, 255, 0.6);
    --navbar-bg: rgba(255, 255, 255, 0.8);
    --shadow-color: rgba(0, 0, 0, 0.1);
    --hover-bg: rgba(67, 97, 238, 0.1);
}

/* Dark mode variables */
[data-theme="dark"] {
    --primary: #6d8cff;
    --primary-light: #8aacff;
    --secondary: #7b6cf6;
    --accent: #ff79a7;
    --success: #6ee7f7;
    --warning: #fbbf24;
    --danger: #f87171;
    --dark: #ffffff;
    --light: #121212;
    --gray: #9ca3af;
    --gray-light: #2d2d3a;
    --gray-dark: #e5e7eb;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 15px 30px rgba(0, 0, 0, 0.4);
    --glass-bg: rgba(30, 35, 45, 0.85);
    --glass-border: rgba(255, 255, 255, 0.1);
    --card-bg: #2d2d3a;
    --bg-gradient-start: #121212;
    --bg-gradient-end: #1a1a2a;
    --text-primary: #e5e7eb;
    --text-secondary: #9ca3af;
    --tag-bg: rgba(255, 255, 255, 0.1);
    --navbar-bg: rgba(30, 35, 45, 0.9);
    --shadow-color: rgba(0, 0, 0, 0.5);
    --hover-bg: rgba(109, 140, 255, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.2s ease;
}

/* Animated background */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 20% 30%, rgba(67, 97, 238, 0.03) 0%, transparent 40%),
        radial-gradient(circle at 90% 70%, rgba(247, 37, 133, 0.03) 0%, transparent 40%);
    filter: blur(60px);
    z-index: -2;
    animation: slowDrift 20s infinite alternate ease-in-out;
}

@keyframes slowDrift {
    0% {
        transform: scale(1) translate(0%, 0%);
        opacity: 0.5;
    }

    100% {
        transform: scale(1.1) translate(2%, -2%);
        opacity: 0.8;
    }
}

.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 5;
}

/* Theme Switch */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
}

.theme-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-switch label {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5px;
    box-shadow: 0 2px 10px var(--shadow-color);
    border: 1px solid var(--glass-border);
}

.theme-switch label i {
    font-size: 14px;
    color: white;
    z-index: 1;
}

/* Header */
.content-header {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-amount)) saturate(180%);
    padding: 20px 30px;
    border-radius: var(--border-radius);
    margin-bottom: 30px;
    box-shadow: var(--shadow-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--glass-border);
    flex-wrap: wrap;
    gap: 15px;
}

.header-title h1 {
    font-size: clamp(20px, 4vw, 28px);
    color: var(--text-primary);
    font-weight: 700;
}

.header-title p {
    color: var(--text-secondary);
    margin-top: 5px;
    font-size: 14px;
}

.header-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.header-actions button {
    padding: 12px 24px;
    border: 1px solid var(--glass-border);
    border-radius: 40px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    background: var(--glass-bg);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary)) !important;
    color: white !important;
}

.btn-secondary {
    background: var(--glass-bg) !important;
    color: var(--primary) !important;
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.tab-content.active {
    display: block;
}

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

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

/* Cards */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-amount)) saturate(180%);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    padding: clamp(15px, 3vw, 25px);
    margin-bottom: 25px;
    border: 1px solid var(--glass-border);
    width: 100%;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--glass-border);
    flex-wrap: wrap;
    gap: 10px;
}

.card-header h2 {
    font-size: clamp(16px, 3vw, 20px);
    font-weight: 600;
    color: var(--text-primary);
}

.card-header .badge {
    background: var(--tag-bg);
    backdrop-filter: blur(8px);
    padding: 8px 16px;
    border-radius: 40px;
    font-size: clamp(11px, 1.5vw, 13px);
    font-weight: 500;
    color: var(--primary);
    border: 1px solid var(--glass-border);
    white-space: nowrap;
}

/* Tables */
.table-container {
    overflow-x: auto;
    border-radius: var(--border-radius);
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: clamp(12px, 2vw, 14px);
    min-width: 100%;
}

th {
    background: var(--tag-bg);
    color: var(--text-primary);
    font-weight: 600;
    padding: clamp(8px, 1.5vw, 16px);
    text-align: left;
    border-bottom: 2px solid var(--glass-border);
    white-space: nowrap;
}

td {
    padding: clamp(8px, 1.5vw, 14px);
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-primary);
    white-space: nowrap;
}

tr:hover {
    background: var(--hover-bg);
}

.best-value {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.1));
    font-weight: 600;
    color: #10b981;
    border-radius: 8px;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--glass-bg);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(67, 97, 238, 0.3);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(67, 97, 238, 0.5);
}


/* ===== Standalone layout ===== */
.dashboard-shell {
    max-width: 1680px;
    margin: 0 auto;
    padding: clamp(16px, 3vw, 30px);
    min-height: 100vh;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-title .header-icon {
    font-size: 34px;
    color: var(--primary);
}

.header-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    color: var(--text-secondary);
    font-size: 13px;
}

.header-meta .badge {
    background: var(--tag-bg);
    padding: 6px 12px;
    border-radius: 40px;
    border: 1px solid var(--glass-border);
    color: var(--primary);
    font-weight: 500;
    white-space: nowrap;
}

@media screen and (max-width: 768px) {
    .content-header {
        padding: 16px;
    }

    .header-title .header-icon {
        font-size: 26px;
    }
}
