/* css/global.css - Ultra Minimalist Pro Analytics Design */
:root {
    /* Core Pro Colors */
    --bg-base: #0A0A0A;
    --bg-surface: #121212;
    --bg-surface-hover: #1A1A1A;
    --border-subtle: #27272A;

    /* Typography */
    --text-primary: #FAFAFA;
    --text-secondary: #A1A1AA;
    --text-muted: #52525B;

    /* Action Colors */
    --accent-primary: #2563EB;
    /* Crisp Blue */
    --accent-hover: #1D4ED8;

    /* Game Colors */
    --val-red: #FF4655;
    --mr-yellow: #FFB800;
    --cs-orange: #F59E0B;
    --ow-orange: #FF8800;

    /* Sizing */
    --border-radius: 6px;
    --nav-height: 64px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-weight: 600;
    letter-spacing: -0.02em;
}

.text-secondary {
    color: var(--text-secondary);
}

.text-muted {
    color: var(--text-muted);
}

/* Layout */
.main-content {
    max-width: 1200px;
    margin: calc(var(--nav-height) + 2rem) auto 4rem auto;
    padding: 0 1.5rem;
    flex: 1 0 auto;
    width: 100%;
}

/* Navigation Structure */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background-color: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: 0.5px;
}

.logo svg {
    color: var(--accent-primary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
}

.nav-divider {
    width: 1px;
    height: 20px;
    background-color: var(--border-subtle);
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    border: 1px solid transparent;
}

.btn-primary {
    background-color: var(--accent-primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
}

.btn-outline {
    background-color: transparent;
    border-color: var(--border-subtle);
    color: var(--text-primary);
}

.btn-outline:hover {
    background-color: var(--bg-surface-hover);
    border-color: var(--text-secondary);
}

.btn-tier2 {
    background-color: var(--bg-surface);
    border-color: var(--border-subtle);
    color: var(--text-primary);
}

.btn-tier2:hover {
    background-color: var(--bg-surface-hover);
}

.btn-full {
    width: 100%;
}

/* Cards & Grids */
.data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--border-radius);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Tier 1 Games (Valorant, Marvel Rivals) get subtle hover lifts. CS2/OW2 stay flat. */
.card.tier-1:hover {
    border-color: var(--text-muted);
}

.card-preview {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-subtle);
    padding: 1rem;
}

.card-content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-title {
    font-size: 1rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-family: monospace;
}

/* Partial Support "Drawer" */
.settings-drawer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-surface);
    z-index: 10;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-drawer.open {
    transform: translateY(0);
}

.settings-table {
    width: 100%;
    font-size: 0.8rem;
    border-collapse: collapse;
    margin-bottom: auto;
}

.settings-table tr {
    border-bottom: 1px solid var(--border-subtle);
}

.settings-table td {
    padding: 0.5rem 0;
}

.settings-table td:last-child {
    text-align: right;
    color: var(--text-primary);
    font-weight: 500;
}

.settings-table td:first-child {
    color: var(--text-secondary);
}

/* Game Hero Headers */
.game-header {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-subtle);
}

.game-title {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.game-title.val {
    color: var(--val-red);
}

.game-title.mr {
    color: var(--mr-yellow);
}

.game-title.cs {
    color: var(--cs-orange);
}

.game-title.ow {
    color: var(--ow-orange);
}

/* Generator / Lab */
.lab-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 900px) {
    .lab-layout {
        display: flex;
        flex-direction: column-reverse;
        gap: 1.5rem;
    }

    .lab-sidebar {
        position: static;
        max-height: none;
        overflow-y: visible;
        border: none;
        padding: 0 0.5rem;
    }

    .lab-preview-area {
        position: static;
        min-height: 250px;
    }

    .lab-canvas {
        padding: 1rem;
    }
}

.lab-sidebar {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    position: sticky;
    top: calc(var(--nav-height) + 2rem);
    max-height: calc(100vh - var(--nav-height) - 4rem);
    overflow-y: auto;
}

.lab-preview-area {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    min-height: 500px;
}

.lab-canvas {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.02);
    padding: 2rem;
}

/* The crucial code output box that hides on CS2/OW2 */
.lab-code-block {
    padding: 1.5rem;
    border-top: 1px solid var(--border-subtle);
    background-color: var(--bg-base);
}

.code-field {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 0.75rem;
    border-radius: var(--border-radius);
    font-family: monospace;
    font-size: 0.85rem;
    width: 100%;
    margin-bottom: 1rem;
    word-break: break-all;
}

.code-field[readonly] {
    cursor: text;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

input[type="range"] {
    width: 100%;
    accent-color: var(--accent-primary);
}

select,
input[type="text"] {
    width: 100%;
    background-color: var(--bg-base);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: 4px;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
}

select:focus,
input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Game Picker Select in Lab */
.game-picker {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border-subtle);
    margin-top: 4rem;
}

/* Mobile Nav */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        width: 100%;
        background-color: var(--bg-surface);
        flex-direction: column;
        padding: 1rem 0;
        border-bottom: 1px solid var(--border-subtle);
    }

    .nav-links.show {
        display: flex;
    }

    .nav-links a {
        padding: 0.75rem 1.5rem;
        width: 100%;
    }

    .nav-divider {
        display: none;
    }

    .mobile-toggle {
        display: block;
    }
}

.dropdown:hover .dropdown-content {
    display: block !important;
}