@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700;800;900&family=Rajdhani:wght@300;400;500;600;700&family=Michroma&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Bad Ass Color Palette */
    --carbon-black: #0a0a0a;
    --midnight: #121212;
    --dark-chrome: #1a1a1a;
    --gunmetal: #2d2d2d;
    --titanium: #3e3e3e;
    --platinum: #e5e5e5;
    --silver: #a3a3a3;
    
    /* High-Energy Accent Colors */
    --racing-red: #ff003c;
    --racing-red-glow: #ff3b6b;
    --championship-gold: #ffc700;
    --gold-accent: #f59e0b;
    --torque-orange: #ff8c00; /* Vibrant Orange */
    --boost-blue: #00e5ff;
    --afr-purple: #c500ff;
    --success-green: #00ff87;
    --warning-amber: #f59e0b;
    --danger-red: #ef4444;
}

body {
    font-family: 'Rajdhani', sans-serif;
    background: var(--carbon-black);
    color: var(--platinum);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Premium Background Effects */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(255, 0, 60, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 199, 0, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(0, 229, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

/* Carbon Fiber Pattern Overlay */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.03;
    background-image: 
        repeating-linear-gradient(45deg, transparent, transparent 2px, rgba(255,255,255,.1) 2px, rgba(255,255,255,.1) 4px),
        repeating-linear-gradient(-45deg, transparent, transparent 2px, rgba(255,255,255,.05) 2px, rgba(255,255,255,.05) 4px);
    pointer-events: none;
    z-index: 1;
}

/* Navigation - Luxury Header */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: linear-gradient(to bottom, rgba(10, 10, 10, 0.98), rgba(10, 10, 10, 0.9));
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(251, 191, 36, 0.2);
    z-index: 1000;
    transition: all 0.3s ease;
}

nav::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--championship-gold), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { opacity: 0.3; }
    50% { opacity: 1; }
    100% { opacity: 0.3; }
}

.nav-container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 2;
}

.logo img {
    height: 50px;
    width: auto;
}

@keyframes slideGradient {
    to { background-position: -200% 0; }
}

.nav-links {
    display: flex;
    gap: 3rem;
    align-items: center;
}

.nav-link {
    color: var(--silver);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--racing-red);
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: var(--championship-gold);
}

.nav-link:hover::before {
    width: 100%;
}

/* Main Container - Wider for better screen utilization */
.container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 2rem;
    padding-top: 120px;
    position: relative;
    z-index: 2;
}

/* Hero Section - Luxury Performance */
.hero {
    padding: 5rem 0 3rem;
    text-align: center;
    position: relative;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(220, 38, 38, 0.1));
    border: 1px solid rgba(251, 191, 36, 0.3);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-size: 0.875rem;
    color: var(--championship-gold);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

.hero-badge::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(251, 191, 36, 0.3), transparent);
    animation: sweep 3s infinite;
}

@keyframes sweep {
    to { left: 100%; }
}

.hero-title {
    font-family: 'Michroma', sans-serif;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 400;
    line-height: 1.1;
    margin-bottom: 2rem;
    letter-spacing: -1px;
    position: relative;
}

.hero-title .accent {
    background: linear-gradient(135deg, var(--championship-gold), var(--racing-red));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--silver);
    max-width: 700px;
    margin: 0 auto 3rem;
    font-weight: 300;
    letter-spacing: 0.5px;
}

.about {
    max-width: 800px;
    margin: 2rem auto 3rem;
    text-align: center;
    color: var(--silver);
    line-height: 1.5;
}

/* Premium Stats Bar */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2px;
    background: rgba(251, 191, 36, 0.1);
    padding: 2px;
    border-radius: 20px;
    margin-bottom: 4rem;
    position: relative;
    overflow: hidden;
}

.stats-bar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(251, 191, 36, 0.1) 50%, transparent 70%);
    animation: shine 4s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) skewX(-45deg); }
    100% { transform: translateX(200%) skewX(-45deg); }
}

.stat {
    background: var(--midnight);
    padding: 2.5rem 2rem;
    text-align: center;
    border-radius: 18px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.stat:hover {
    background: var(--dark-chrome);
    transform: translateY(-2px);
}

.stat-value {
    font-family: 'Orbitron', monospace;
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--championship-gold), var(--gold-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}

.stat-label {
    color: var(--silver);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
}

/* Upload Section - Premium Feel */
.upload-section {
    background: linear-gradient(135deg, var(--midnight), var(--dark-chrome));
    border: 1px solid rgba(251, 191, 36, 0.1);
    border-radius: 30px;
    padding: 4rem;
    margin-bottom: 4rem;
    position: relative;
    overflow: hidden;
}

.upload-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.05) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    to { transform: rotate(360deg); }
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    z-index: 1;
}

.section-title {
    font-family: 'Orbitron', monospace;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.section-subtitle {
    color: var(--silver);
    font-size: 1.125rem;
}

/* Premium Upload Area */
.upload-area {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.05), rgba(251, 191, 36, 0.05));
    border: 2px dashed rgba(251, 191, 36, 0.3);
    border-radius: 20px;
    padding: 5rem 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.upload-area:hover {
    border-color: var(--championship-gold);
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.1), rgba(251, 191, 36, 0.1));
    transform: scale(1.01);
}

.upload-area.dragover {
    border-color: var(--racing-red);
    background: rgba(220, 38, 38, 0.1);
    transform: scale(1.02);
}

.upload-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 2rem;
    background: linear-gradient(135deg, var(--racing-red), var(--championship-gold));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    position: relative;
    box-shadow: 0 0 50px rgba(251, 191, 36, 0.3);
}

.upload-icon::after {
    content: '';
    position: absolute;
    inset: -10px;
    background: linear-gradient(135deg, var(--racing-red), var(--championship-gold));
    border-radius: 50%;
    opacity: 0.3;
    filter: blur(20px);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.1); opacity: 0.5; }
}

.upload-text {
    font-family: 'Orbitron', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.upload-subtext {
    color: var(--silver);
    font-size: 1rem;
}

.file-info {
    margin-top: 1.5rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(34, 197, 94, 0.05));
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 10px;
    color: var(--success-green);
    font-weight: 600;
    display: inline-block;
}

/* Configuration Form - Luxury Inputs */
.config-section {
    margin-top: 3rem;
    display: none;
    position: relative;
    z-index: 1;
}

.config-section.show {
    display: block;
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.form-group {
    background: linear-gradient(135deg, var(--dark-chrome), var(--midnight));
    border: 1px solid rgba(251, 191, 36, 0.1);
    border-radius: 15px;
    padding: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.form-group::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--championship-gold), transparent);
    transition: left 0.5s ease;
}

.form-group:hover::before {
    left: 100%;
}

.form-group:hover {
    border-color: rgba(251, 191, 36, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(251, 191, 36, 0.1);
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--championship-gold);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.form-input {
    width: 100%;
    padding: 1rem 1.25rem;
    background: var(--carbon-black);
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: 10px;
    color: var(--platinum);
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    font-family: 'Rajdhani', sans-serif;
}

.form-input:focus {
    outline: none;
    border-color: var(--championship-gold);
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.2);
    background: var(--midnight);
}

select.form-input {
    cursor: pointer;
}

/* ====================================
   CONFIG GROUPS - Organized sections
   ==================================== */
.config-group {
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.8), rgba(20, 20, 20, 0.9));
    border: 1px solid rgba(255, 199, 0, 0.1);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.config-group:hover {
    border-color: rgba(255, 199, 0, 0.25);
}

.config-group-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.config-group-icon {
    font-size: 1.25rem;
}

.config-group-title {
    font-family: 'Michroma', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--championship-gold);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.config-group-hint {
    font-size: 0.75rem;
    color: var(--silver);
    margin-left: auto;
    font-weight: 400;
}

/* Config Rows - Responsive grid layouts */
.config-row {
    display: grid;
    gap: 1rem;
}

.config-row-2 {
    grid-template-columns: repeat(2, 1fr);
}

.config-row-3 {
    grid-template-columns: repeat(3, 1fr);
}

.config-row-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 900px) {
    .config-row-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    .config-row-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .config-row-4,
    .config-row-3,
    .config-row-2 {
        grid-template-columns: 1fr;
    }
}

/* Compact form groups for dense layouts */
.config-group .form-group {
    padding: 0.75rem;
    margin: 0;
}

.config-group .form-group-compact {
    padding: 0.5rem 0.75rem;
}

.config-group .form-group-compact .form-input {
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
}

/* Checkbox styling in config */
.form-group-checkbox {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.75rem;
    background: var(--carbon-black);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.checkbox-label:hover {
    border-color: var(--championship-gold);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--championship-gold);
}

.checkbox-label span {
    font-size: 0.85rem;
    color: var(--silver);
}

/* Collapsible config group */
.config-group-collapsible .config-group-header {
    cursor: pointer;
    user-select: none;
}

.config-group-collapsible .config-collapse-icon {
    margin-left: auto;
    transition: transform 0.3s ease;
    color: var(--silver);
    font-size: 0.8rem;
}

.config-group-collapsible.collapsed .config-collapse-icon {
    transform: rotate(-90deg);
}

.config-group-collapsible .config-group-content {
    max-height: 300px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.config-group-collapsible.collapsed .config-group-content {
    max-height: 0;
    opacity: 0;
}

/* Toggle switch positioning in header */
.config-group-header .toggle-switch {
    margin-left: 1rem;
}

.input-group {
    position: relative;
}

.tire-size-display {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--championship-gold);
    font-weight: 600;
    font-size: 1rem;
    pointer-events: none;
}

.input-description {
    font-size: 0.8rem;
    color: var(--silver);
    margin-top: 0.75rem;
    padding: 0 0.5rem;
}

/* SAE Correction Controls */
.sae-controls {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.05), rgba(14, 165, 233, 0.02));
    border: 1px solid rgba(14, 165, 233, 0.2);
    border-radius: 15px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.sae-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.sae-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--boost-blue);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.toggle-switch {
    position: relative;
    width: 60px;
    height: 30px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--gunmetal);
    border-radius: 30px;
    transition: all 0.3s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background: var(--silver);
    border-radius: 50%;
    transition: all 0.3s ease;
}

input:checked + .toggle-slider {
    background: linear-gradient(135deg, var(--boost-blue), var(--racing-red));
}

input:checked + .toggle-slider::before {
    transform: translateX(30px);
    background: white;
}

#saeInputs {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

/* Analyze Button - Premium CTA */
.analyze-section {
    text-align: center;
    margin-top: 3rem;
}

.btn {
    padding: 1.25rem 4rem;
    font-size: 1.25rem;
    font-weight: 700;
    font-family: 'Orbitron', monospace;
    text-transform: uppercase;
    letter-spacing: 2px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: inline-block;
    color: white;
}

.btn-primary {
    background: linear-gradient(135deg, var(--racing-red), var(--championship-gold));
    color: black;
    box-shadow: 0 10px 30px rgba(220, 38, 38, 0.3);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(220, 38, 38, 0.4);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Modal Styles - ADDED */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: linear-gradient(135deg, var(--dark-chrome), var(--midnight));
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: 20px;
    padding: 3rem 4rem;
    width: 90%;
    max-width: 700px;
    text-align: center;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

.modal-title {
    font-family: 'Orbitron', monospace;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--championship-gold);
}

.modal-description {
    color: var(--silver);
    font-size: 1.125rem;
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

.modal-actions {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Pull Selector Modal - Enhanced */
.pull-selector-modal {
    max-width: 950px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    text-align: left;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: var(--silver);
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
}

.modal-close:hover {
    color: var(--championship-gold);
}

.highlight-text {
    color: var(--championship-gold);
    font-weight: 700;
}

.pull-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
    max-height: 45vh;
    overflow-y: auto;
    padding: 0.5rem;
}

.pull-card {
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.9), var(--midnight));
    border: 2px solid rgba(251, 191, 36, 0.15);
    border-radius: 15px;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.pull-card:hover {
    border-color: rgba(251, 191, 36, 0.5);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.pull-card.selected {
    border-color: var(--championship-gold);
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), var(--midnight));
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.25);
}

.pull-card.best-pull::before {
    content: 'BEST';
    position: absolute;
    top: -10px;
    right: 15px;
    background: var(--success-green);
    color: var(--carbon-black);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.pull-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(251, 191, 36, 0.15);
}

.pull-card-title {
    font-family: 'Orbitron', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--championship-gold);
}

.pull-card-checkbox {
    width: 22px;
    height: 22px;
    accent-color: var(--championship-gold);
    cursor: pointer;
}

.pull-card-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

.pull-stat {
    display: flex;
    flex-direction: column;
}

.pull-stat-label {
    font-size: 0.65rem;
    color: var(--silver);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.pull-stat-value {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--platinum);
}

.pull-stat-value.highlight {
    color: var(--championship-gold);
}

.pull-minipreview {
    height: 40px;
    margin-top: 0.75rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    overflow: hidden;
}

.pull-selection-options {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    background: rgba(0, 229, 255, 0.05);
    border: 1px solid rgba(0, 229, 255, 0.2);
    border-radius: 10px;
}

.overlay-toggle {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--platinum);
    cursor: pointer;
    font-size: 0.95rem;
}

.overlay-toggle input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--boost-blue);
}

/* Pull card color indicators for overlay mode */
.pull-card[data-color="1"] .pull-card-title { color: var(--success-green); }
.pull-card[data-color="2"] .pull-card-title { color: var(--boost-blue); }
.pull-card[data-color="3"] .pull-card-title { color: #a855f7; }
.pull-card[data-color="4"] .pull-card-title { color: var(--torque-orange); }
.pull-card[data-color="5"] .pull-card-title { color: var(--racing-red); }

/* Loading Overlay - Premium */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
    position: relative;
}

.spinner {
    width: 80px;
    height: 80px;
    border: 3px solid rgba(251, 191, 36, 0.1);
    border-top-color: var(--championship-gold);
    border-right-color: var(--racing-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 2rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-family: 'Orbitron', monospace;
    font-size: 1.5rem;
    color: var(--platinum);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 2rem;
}

.loading-steps {
    text-align: left;
    display: inline-block;
}

.loading-step {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0.75rem 0;
    color: var(--silver);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.loading-step.active {
    color: var(--championship-gold);
    transform: translateX(10px);
}

.loading-step.complete {
    color: var(--success-green);
}

.loading-step.complete::before {
    content: '✓';
    color: var(--success-green);
}

/* Results Section - Premium Display */
.results-section {
    display: none;
    margin-top: 4rem;
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.results-header {
    text-align: center;
    margin-bottom: 2rem; /* Reduced margin */
}

.power-gain {
    font-family: 'Orbitron', monospace;
    font-size: 4rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--success-green), var(--championship-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 1.5rem 0;
    letter-spacing: -2px;
}

/* Dyno Chart Container - Premium & Prominent */
.dyno-container {
    background: linear-gradient(135deg, var(--midnight), var(--dark-chrome));
    border: 2px solid rgba(251, 191, 36, 0.15);
    border-radius: 25px;
    padding: 2rem;
    margin-bottom: 4rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 60px rgba(251, 191, 36, 0.08);
}

.dyno-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(220, 38, 38, 0.05) 0%, transparent 70%);
    animation: rotate 30s linear infinite reverse;
}

.secondary-analysis-section {
    text-align: center;
    margin-bottom: 4rem;
}

.chart-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.chart-controls label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--silver);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.chart-controls label:hover {
    color: var(--platinum);
}

.chart-controls input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--championship-gold);
}

.chart-controls select {
    background: var(--dark-chrome);
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: 8px;
    color: var(--platinum);
    padding: 0.5rem 1rem;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    cursor: pointer;
}

#dynoChart {
    width: 100%;
    height: auto;
    min-height: 550px;
    position: relative;
    z-index: 1;
    background: var(--carbon-black);
    border-radius: 15px;
    padding: 15px;
}

#dynoChart svg {
    width: 100%;
    height: auto;
    min-height: 520px;
}

/* Analysis Cards - Premium */
.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.analysis-card {
    background: linear-gradient(135deg, var(--midnight), var(--dark-chrome));
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.analysis-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    transition: all 0.3s ease;
}

.analysis-card.good::before {
    background: var(--success-green);
    box-shadow: 0 0 20px rgba(0, 255, 135, 0.5);
}

.analysis-card.warning::before {
    background: var(--warning-amber);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.5);
}

.analysis-card.danger::before {
    background: var(--danger-red);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
}

.analysis-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.analysis-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.analysis-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: bold;
}

.analysis-card.good .analysis-icon {
    background: rgba(0, 255, 135, 0.2);
    color: var(--success-green);
    box-shadow: 0 0 15px rgba(0, 255, 135, 0.3);
}

.analysis-card.warning .analysis-icon {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning-amber);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
}

.analysis-card.danger .analysis-icon {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger-red);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.3);
}

.analysis-value {
    font-family: 'Orbitron', monospace;
    font-size: 2.5rem;
    font-weight: 800;
    margin: 1rem 0;
    letter-spacing: -1px;
}

.analysis-description {
    color: var(--silver);
    font-size: 1rem;
    line-height: 1.6;
}

/* Tune Health Section */
#tuneHealthSection {
    display: none; /* Hidden by default */
    margin-top: 4rem;
}

/* NEW: Health Grade Styles - ADDED */
.health-grade-container {
    background: linear-gradient(135deg, var(--midnight), var(--dark-chrome));
    border: 1px solid rgba(251, 191, 36, 0.1);
    border-radius: 25px;
    padding: 3rem;
    margin-bottom: 4rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.grade-label {
    font-family: 'Orbitron', monospace;
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--championship-gold);
}

.grade-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Michroma', sans-serif;
    font-size: 5rem;
    font-weight: bold;
    color: var(--carbon-black);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    border: 5px solid rgba(255,255,255,0.8);
    transition: all 0.4s ease;
}

.grade-circle.grade-a, .grade-circle.grade-b {
    background: linear-gradient(135deg, var(--success-green), #00c96e);
    box-shadow: 0 0 40px var(--success-green);
}

.grade-circle.grade-c {
    background: linear-gradient(135deg, var(--warning-amber), #ffc107);
    box-shadow: 0 0 40px var(--warning-amber);
}

.grade-circle.grade-d, .grade-circle.grade-f {
    background: linear-gradient(135deg, var(--danger-red), #ff4d4d);
    box-shadow: 0 0 40px var(--danger-red);
}

.grade-remarks {
    font-size: 1.125rem;
    color: var(--silver);
    max-width: 600px;
}

#fuelTrimChart {
    width: 100%;
    height: auto;
    min-height: 400px;
    background: var(--carbon-black);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

#fuelTrimChart svg {
    max-width: 100%;
    height: auto;
}


/* CTA Section - Luxury */
.cta-section {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.05), rgba(251, 191, 36, 0.05));
    border: 2px solid rgba(251, 191, 36, 0.2);
    border-radius: 30px;
    padding: 4rem;
    text-align: center;
    margin-top: 4rem;
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: -100%;
    left: -100%;
    width: 300%;
    height: 300%;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

.cta-title {
    font-family: 'Orbitron', monospace;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    z-index: 1;
}

.cta-subtitle {
    color: var(--silver);
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    position: relative;
    z-index: 1;
}

.cta-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.btn-secondary {
    background: transparent;
    color: var(--championship-gold);
    border: 2px solid var(--championship-gold);
    padding: 1.25rem 3rem;
    font-size: 1.125rem;
    font-weight: 700;
    font-family: 'Orbitron', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: var(--championship-gold);
    color: var(--carbon-black);
    box-shadow: 0 10px 30px rgba(251, 191, 36, 0.3);
}

/* Baseline Request Message */
.baseline-message {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.05));
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 10px;
    padding: 1.5rem;
    margin: 2rem 0;
    text-align: center;
    color: var(--warning-amber);
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.baseline-message button {
    margin-top: 1rem;
    background: var(--warning-amber);
    color: var(--carbon-black);
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 25px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.baseline-message button:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(245, 158, 11, 0.4);
}

/* Footer - Minimal Luxury */
footer {
    margin-top: 8rem;
    padding: 3rem 0;
    border-top: 1px solid rgba(251, 191, 36, 0.1);
    text-align: center;
    color: var(--silver);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    z-index: 2;
}

/* Comparison buttons container */
#comparisonButtonsContainer {
    text-align: center;
    margin-top: 2rem;
    padding: 1rem;
}

#selectComparisonBtn,
#loadBothRunsBtn,
#clearAllDataBtn {
    margin: 0 0.5rem;
}

#toggleComparisonContainer {
    display: inline-flex;
    align-items: center;
    margin-left: 1rem;
    color: var(--silver);
}

/* Remove old comparison upload section styles if they exist */
.comparison-upload-section,
.comparison-upload,
#comparisonUploadSection {
    display: none !important;
}

/* Large Desktop Responsive - Use more screen width */
@media (min-width: 1600px) {
    .nav-container,
    .container {
        max-width: 1700px;
    }

    #dynoChart {
        min-height: 600px;
    }

    #dynoChart svg {
        min-height: 570px;
    }

    .analysis-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Ultra-wide displays */
@media (min-width: 1920px) {
    .nav-container,
    .container {
        max-width: 1850px;
    }

    #dynoChart {
        min-height: 650px;
    }

    #dynoChart svg {
        min-height: 620px;
    }

    .dyno-container {
        padding: 2.5rem;
    }
}

/* 4K displays */
@media (min-width: 2560px) {
    .nav-container,
    .container {
        max-width: 2200px;
    }

    #dynoChart {
        min-height: 750px;
    }

    #dynoChart svg {
        min-height: 720px;
    }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .stats-bar {
        grid-template-columns: 1fr;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }

    .upload-section {
        padding: 2rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .btn {
        width: 100%;
    }
}

/* ============================================
   VIRTUAL DYNO TIPS SECTION
   ============================================ */
.dyno-tips-compact {
    background: linear-gradient(135deg, rgba(20, 20, 20, 0.95), rgba(30, 30, 30, 0.9));
    border: 1px solid rgba(255, 199, 0, 0.15);
    border-radius: 12px;
    margin-top: 1.5rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.tips-header-compact {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: rgba(255, 199, 0, 0.08);
    cursor: pointer;
}

.tips-icon {
    font-size: 1.25rem;
}

.tips-title {
    font-family: 'Orbitron', monospace;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--championship-gold);
    letter-spacing: 1.5px;
    flex: 1;
}

.tips-toggle {
    background: none;
    border: none;
    color: var(--silver);
    font-size: 0.8rem;
    cursor: pointer;
    transition: transform 0.3s ease;
    padding: 0.25rem;
}

.dyno-tips-compact.expanded .tips-toggle {
    transform: rotate(180deg);
}

.tips-content {
    display: none;
    padding: 1rem 1.25rem;
    background: rgba(10, 10, 10, 0.5);
}

.dyno-tips-compact.expanded .tips-content {
    display: block;
}

.tip-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.85rem;
    color: var(--silver);
    line-height: 1.4;
}

.tip-item:last-child {
    border-bottom: none;
}

.tip-bullet {
    color: var(--success-green);
    font-weight: bold;
    flex-shrink: 0;
}

.tip-item strong {
    color: var(--platinum);
    font-weight: 600;
}

/* Hover effect for tips header */
.tips-header-compact:hover {
    background: rgba(255, 199, 0, 0.12);
}

/* Auto-expand on larger screens */
@media (min-width: 1200px) {
    .tips-content {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem 2rem;
    }

    .dyno-tips-compact .tips-content {
        display: grid;
    }

    .tips-toggle {
        display: none;
    }
}

/* ============================================================================
   ADVANCED KNOCK ANALYSIS DASHBOARD STYLES
   ============================================================================ */

#advancedKnockDashboard {
    background: linear-gradient(180deg, #0a0a0a 0%, #151515 100%);
    border: 1px solid rgba(255, 199, 0, 0.2);
    border-radius: 12px;
    overflow: hidden;
}

#advancedKnockDashboard svg {
    display: block;
    width: 100%;
    height: auto;
}


/* Cylinder Detail Cards Grid */
.cylinder-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

@media (max-width: 900px) {
    .cylinder-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .cylinder-cards-grid {
        grid-template-columns: 1fr;
    }
}

.cylinder-card {
    background: linear-gradient(135deg, #0a0a0a, #151515);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cylinder-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

/* Knock Dashboard Section Headers */
#advancedKnockDashboard + .analysis-title {
    color: var(--championship-gold);
}

/* ============================================================
   MULTI-RUN COMPARE — run manager panel + comparison summary
   Lets a tuner overlay e.g. a 93 octane pull and an E85 pull
   as co-equal curves instead of base/comparison.
   ============================================================ */

.run-panel {
    margin: 1.5rem auto 0;
    max-width: 1200px;
    background: linear-gradient(135deg, #0f0f0f, #161616);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1.1rem 1.25rem 1.25rem;
}

.run-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.run-panel-title {
    font-family: 'Orbitron', monospace;
    font-size: 0.8rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--championship-gold);
    font-weight: 700;
}

.run-panel-actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.btn.run-btn-sm {
    width: auto;
    padding: 0.5rem 0.95rem;
    font-size: 0.72rem;
    letter-spacing: 1px;
}

.run-panel-hint {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--silver);
    opacity: 0.65;
}

.run-list {
    margin-top: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.run-empty {
    font-size: 0.8rem;
    color: var(--silver);
    opacity: 0.6;
    padding: 0.5rem 0;
}

.run-row {
    display: grid;
    grid-template-columns: 14px minmax(120px, 1fr) auto minmax(0, 1.2fr) auto auto;
    align-items: center;
    gap: 0.85rem;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    transition: opacity 0.2s ease, border-color 0.2s ease;
}

.run-row.run-hidden {
    opacity: 0.4;
}

.run-swatch {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    display: inline-block;
}

.run-label-input {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--platinum);
    font-family: 'Orbitron', monospace;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.4rem 0.6rem;
    width: 100%;
    min-width: 0;
}

.run-label-input:focus {
    outline: none;
    border-color: var(--championship-gold);
    background: rgba(0, 0, 0, 0.6);
}

.run-peak {
    font-family: 'Orbitron', monospace;
    font-size: 0.85rem;
    color: var(--silver);
    white-space: nowrap;
}

.run-peak strong {
    font-size: 1.05rem;
}

.run-best {
    color: var(--championship-gold);
    font-size: 0.7rem;
    margin-left: 0.4rem;
}

.run-file {
    font-size: 0.72rem;
    color: var(--silver);
    opacity: 0.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.run-visible {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    color: var(--silver);
    cursor: pointer;
    white-space: nowrap;
}

.run-visible input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.run-remove-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    color: var(--silver);
    cursor: pointer;
    font-size: 0.8rem;
    line-height: 1;
    padding: 0.35rem 0.5rem;
    transition: all 0.2s ease;
}

.run-remove-btn:hover {
    color: var(--danger-red);
    border-color: var(--danger-red);
}

@media (max-width: 820px) {
    .run-row {
        grid-template-columns: 14px 1fr auto auto;
    }
    .run-file {
        display: none;
    }
    .run-peak {
        grid-column: 2 / -1;
    }
}

/* ---- Comparison summary cards (under the analysis grid) ---- */

.run-stats-summary {
    max-width: 1200px;
    margin: 1.5rem auto 0;
}

.run-stats-title {
    font-family: 'Orbitron', monospace;
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--championship-gold);
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.run-stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.run-stats-card {
    background: linear-gradient(135deg, #0a0a0a, #151515);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-top: 3px solid var(--success-green);
    border-radius: 10px;
    padding: 1rem 1.1rem;
}

.run-stats-label {
    font-family: 'Orbitron', monospace;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 0.6rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.run-stats-peak {
    font-family: 'Orbitron', monospace;
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--platinum);
    line-height: 1.15;
}

.run-stats-peak span {
    font-size: 0.7rem;
    color: var(--silver);
    opacity: 0.7;
    font-weight: 400;
}

.run-stats-peak.sub {
    font-size: 1.15rem;
    opacity: 0.75;
}

.run-stats-delta {
    margin-top: 0.6rem;
    padding-top: 0.55rem;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    font-size: 0.78rem;
    font-weight: 600;
    font-family: 'Orbitron', monospace;
}

.run-stats-delta.ref   { color: var(--silver); opacity: 0.5; font-weight: 400; }
.run-stats-delta.up    { color: var(--success-green); }
.run-stats-delta.down  { color: var(--danger-red); }

/* ============================================================================
   VIRTUAL DYNO BETA NOTICE

   Informational, not an error. Amber/gold rather than the danger red used by
   .analysis-card.bad, because the results are usable — just not gospel.
   ============================================================================ */

.dyno-beta-notice {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto 2rem;
    /* .upload-section::before is a full-bleed rotating gradient with default
       pointer-events, so every child in that section has to be lifted above it
       or the Report button is unclickable. Same trick as .section-header. */
    position: relative;
    z-index: 1;
    padding: 1.15rem 1.4rem;
    background: linear-gradient(135deg, rgba(255, 199, 0, 0.09), rgba(255, 199, 0, 0.02));
    border: 1px solid rgba(255, 199, 0, 0.28);
    border-left: 3px solid var(--championship-gold);
    border-radius: 12px;
}

.dyno-beta-icon {
    flex-shrink: 0;
    font-size: 1.25rem;
    line-height: 1.4;
    color: var(--championship-gold);
}

.dyno-beta-body {
    min-width: 0;
}

.dyno-beta-title {
    font-family: 'Orbitron', monospace;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--championship-gold);
    margin-bottom: 0.4rem;
}

.dyno-beta-text {
    color: var(--silver);
    font-size: 0.95rem;
    line-height: 1.55;
    margin: 0;
}

.btn-report-problem {
    margin-top: 0.85rem;
    padding: 0.5rem 1.1rem;
    background: transparent;
    border: 1px solid rgba(255, 199, 0, 0.45);
    border-radius: 8px;
    color: var(--championship-gold);
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn-report-problem:hover,
.btn-report-problem:focus-visible {
    background: rgba(255, 199, 0, 0.14);
    border-color: var(--championship-gold);
    color: #fff;
    outline: none;
}

.btn-report-problem:focus-visible {
    box-shadow: 0 0 0 2px rgba(255, 199, 0, 0.4);
}

@media (max-width: 600px) {
    .dyno-beta-notice {
        gap: 0.75rem;
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    .dyno-beta-text {
        font-size: 0.9rem;
    }
    .btn-report-problem {
        width: 100%;
    }
}

/* ============================================================================
   "REPORT A PROBLEM" FEEDBACK MODAL
   Markup is injected by js/modules/dyno-feedback.js; it reuses the shared
   .modal-overlay / .modal-content shell and only adds what it needs.
   ============================================================================ */

/* Stop the page behind the overlay from scrolling under the dialog. */
body.feedback-modal-open {
    overflow: hidden;
}

.dyno-feedback-modal {
    max-width: 620px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2.5rem;
    position: relative;
    text-align: left;
}

.dyno-feedback-modal .modal-title {
    font-size: 1.6rem;
    margin-bottom: 0.75rem;
    padding-right: 2rem;
}

.dyno-feedback-modal .modal-description {
    font-size: 1rem;
    margin-bottom: 1.75rem;
}

.feedback-field {
    margin-bottom: 1.35rem;
}

.feedback-field .form-label {
    display: block;
    margin-bottom: 0.4rem;
}

.feedback-required {
    color: var(--racing-red);
}

.feedback-textarea {
    width: 100%;
    min-height: 8rem;
    resize: vertical;
    font-family: 'Rajdhani', sans-serif;
    line-height: 1.5;
}

.feedback-textarea.over-limit {
    border-color: var(--danger-red);
}

.feedback-meter {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.35rem;
}

.feedback-count {
    font-family: 'Orbitron', monospace;
    font-size: 0.7rem;
    letter-spacing: 1px;
    color: var(--silver);
    opacity: 0.7;
}

/* Past 250 words the submit button is disabled, so make the counter obvious. */
.feedback-count.over {
    color: var(--danger-red);
    opacity: 1;
    font-weight: 700;
}

.feedback-error {
    margin-top: 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--danger-red);
}

/* ---- Auto-attached context preview ---- */

.feedback-context {
    margin: 1.5rem 0;
    padding: 1rem 1.15rem;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

.feedback-context-title {
    font-family: 'Orbitron', monospace;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--championship-gold);
    margin-bottom: 0.6rem;
}

.feedback-context-note {
    font-size: 0.85rem;
    color: var(--success-green);
    margin: 0 0 0.6rem;
}

/* Nothing was attached — inform, don't alarm. */
.feedback-context-note.dropped {
    color: var(--warning-amber);
}

.feedback-context-meta {
    max-height: 11rem;
    overflow: auto;
    margin: 0;
    font-family: 'Courier New', monospace;
    font-size: 0.72rem;
    line-height: 1.5;
    color: var(--silver);
    white-space: pre-wrap;
    word-break: break-word;
}

/* ---- Status / error banner ---- */

.feedback-status {
    margin: 1.25rem 0 0;
    padding: 0.85rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.feedback-status.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #ffb4b4;
}

.feedback-mailto {
    color: var(--championship-gold);
    font-weight: 700;
    word-break: break-all;
}

.dyno-feedback-modal .modal-actions {
    justify-content: flex-start;
    margin-top: 1.75rem;
}

/* The global .btn is sized for hero CTAs (4rem side padding); two of them do
   not fit across this dialog, so scale them down here only. */
.dyno-feedback-modal .btn {
    padding: 0.85rem 2rem;
    font-size: 0.95rem;
    letter-spacing: 1.5px;
}

.dyno-feedback-modal .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.dyno-feedback-modal .btn.is-sending {
    cursor: progress;
}

/* ---- Success state ---- */

.feedback-success {
    text-align: center;
    padding: 1.5rem 0 0.5rem;
}

.feedback-success-icon {
    width: 62px;
    height: 62px;
    margin: 0 auto 1.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--carbon-black);
    background: var(--success-green);
    border-radius: 50%;
}

.feedback-success-title {
    font-family: 'Orbitron', monospace;
    font-size: 1.3rem;
    color: var(--success-green);
    margin-bottom: 0.75rem;
}

.feedback-success-text {
    color: var(--silver);
    font-size: 0.95rem;
    line-height: 1.6;
}

.feedback-success .modal-actions {
    justify-content: center;
}

@media (max-width: 600px) {
    .dyno-feedback-modal {
        padding: 2rem 1.25rem;
        width: 94%;
        max-height: 94vh;
    }
    .dyno-feedback-modal .modal-title {
        font-size: 1.3rem;
    }
    .dyno-feedback-modal .modal-actions {
        flex-direction: column;
    }
    .dyno-feedback-modal .modal-actions .btn {
        width: 100%;
    }
}
