/* ==========================================================================
   AI7 Digital Bioreactor - Core UI Styles (styles.css)
   Theme: High-Premium Dark Glassmorphism
   Typography: Outfit & Inter
   ========================================================================== */

:root {
    /* Color Palette */
    --bg-darker: #080a0d;
    --bg-dark: #0f1217;
    --bg-panel: rgba(18, 22, 30, 0.75);
    --border-color: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    
    /* Neon Colors */
    --neon-blue: #00d2ff;
    --neon-blue-glow: rgba(0, 210, 255, 0.3);
    
    --neon-green: #00ff88;
    --neon-green-glow: rgba(0, 255, 136, 0.35);
    
    --neon-orange: #ffaa00;
    --neon-orange-glow: rgba(255, 170, 0, 0.35);
    
    --neon-red: #ff3366;
    --neon-red-glow: rgba(255, 51, 102, 0.4);
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    /* Font stacks */
    --font-header: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

/* ==========================================================================
   BASE STYLES & RESET
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-darker);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(0, 210, 255, 0.03) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(0, 255, 136, 0.02) 0%, transparent 45%);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-darker);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--neon-blue);
}

/* ==========================================================================
   COMMON GLASS CARD LAYOUTS
   ========================================================================== */
.card-glass {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 
        0 8px 32px 0 rgba(0, 0, 0, 0.37),
        inset 0 1px 1px 0 rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

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

.card-title {
    font-family: var(--font-header);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 0.5px;
}

.card-title i {
    color: var(--neon-blue);
    text-shadow: 0 0 10px var(--neon-blue-glow);
}

/* ==========================================================================
   HEADER BAR
   ========================================================================== */
.main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: rgba(13, 16, 22, 0.85);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 1.8rem;
    color: var(--neon-green);
    text-shadow: 0 0 15px var(--neon-green-glow);
    animation: pulse-slow 3s infinite ease-in-out;
}

.logo-text h1 {
    font-family: var(--font-header);
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 1px;
}

.logo-text span {
    font-family: var(--font-body);
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 2px;
}

/* Nav Tabs */
.header-nav {
    display: flex;
    gap: 8px;
}

.nav-tab {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    font-family: var(--font-header);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.nav-tab.active {
    color: var(--neon-blue);
    background: rgba(0, 210, 255, 0.08);
    border-color: rgba(0, 210, 255, 0.2);
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.05);
}

/* Connection Badge */
.connection-status-container {
    flex-grow: 1;
    display: flex;
    justify-content: center;
}

.connection-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.connection-badge.offline {
    background: rgba(255, 170, 0, 0.08);
    border: 1px solid rgba(255, 170, 0, 0.25);
    color: var(--neon-orange);
    box-shadow: 0 0 10px rgba(255, 170, 0, 0.05);
}

.connection-badge.online {
    background: rgba(0, 255, 136, 0.08);
    border: 1px solid rgba(0, 255, 136, 0.25);
    color: var(--neon-green);
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.05);
}

.pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.offline .pulse-dot {
    background: var(--neon-orange);
    animation: blink 1.5s infinite;
}

.online .pulse-dot {
    background: var(--neon-green);
    animation: blink 1.5s infinite;
}

/* ==========================================================================
   WORKSPACE CONTAINER
   ========================================================================== */
.workspace-container {
    padding: 24px;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

/* ==========================================================================
   TAB 1: CONTROL ROOM LAYOUT
   ========================================================================== */
.control-room-grid {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 24px;
}

/* --- Left Column: Vessel Panel --- */
.vessel-column {
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.vessel-outer {
    width: 190px;
    height: 320px;
    border: 6px solid rgba(255, 255, 255, 0.15);
    border-radius: 95px; /* cylindrical glass style */
    position: relative;
    margin: 20px 0;
    background: rgba(0, 0, 0, 0.25);
    box-shadow: 
        inset 0 0 30px rgba(0,0,0,0.8),
        0 10px 25px rgba(0,0,0,0.5);
    overflow: hidden;
}

.heating-jacket {
    width: 100%;
    height: 100%;
    border-radius: 89px;
    transition: background 1s ease, box-shadow 1s ease;
    position: relative;
}

/* Ambient glow states based on heating/cooling */
.heating-jacket.cooling {
    background: radial-gradient(circle at center, rgba(0, 210, 255, 0.08) 0%, transparent 70%);
    box-shadow: inset 0 0 20px rgba(0, 210, 255, 0.15);
}

.heating-jacket.heating {
    background: radial-gradient(circle at center, rgba(255, 51, 102, 0.08) 0%, transparent 70%);
    box-shadow: inset 0 0 20px rgba(255, 51, 102, 0.15);
}

.heating-jacket.neutral {
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.02) 0%, transparent 70%);
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.05);
}

/* Dynamic Fluid layer */
.fluid-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 65%; /* live variable */
    background: linear-gradient(180deg, rgba(0, 255, 136, 0.15) 0%, rgba(0, 255, 136, 0.05) 100%);
    border-top: 2px solid rgba(0, 255, 136, 0.3);
    transition: height 0.5s ease, background 1s ease, border-color 1s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.phase-indicator {
    background: rgba(13, 16, 22, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-secondary);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* Impeller animations */
.impeller-shaft {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 80%;
    background: linear-gradient(90deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.4) 50%, rgba(255,255,255,0.05) 100%);
    z-index: 2;
}

.impeller-blades {
    position: absolute;
    bottom: 25%;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 10px;
    background: linear-gradient(90deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0.6) 50%, rgba(255,255,255,0.2) 100%);
    border-radius: 4px;
    z-index: 3;
    transform-origin: center;
}

.impeller-rotating {
    animation: rotate-impeller 2s infinite linear;
}

/* Bubbles generator */
.bubble-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.bubble {
    position: absolute;
    bottom: -10px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    animation: bubble-up 4s infinite ease-in;
}

/* Probes */
.sensor-probe {
    position: absolute;
    top: 15%;
    width: 3px;
    height: 45%;
    background: #6b7280;
    border-radius: 2px;
}
.probe-ph { left: 30%; height: 50%; background: var(--neon-green); opacity: 0.65; }
.probe-temp { left: 40%; height: 42%; background: var(--neon-red); opacity: 0.65; }
.probe-DO { left: 70%; height: 48%; background: var(--neon-blue); opacity: 0.65; }

/* Telemetry lists */
.telemetry-panel {
    width: 100%;
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.telemetry-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    transition: background 0.2s ease;
}

.telemetry-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.tel-label {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.tel-val {
    font-family: var(--font-header);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.tel-val small {
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* --- Right Column: Panels --- */
.control-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Top control Panel */
.panel-top-controls {
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.autopilot-selector {
    display: flex;
    align-items: center;
    gap: 12px;
}

.selector-label {
    font-family: var(--font-header);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-group {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    padding: 4px;
    border-radius: 10px;
    display: flex;
    gap: 4px;
}

.btn-toggle {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-header);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-toggle:hover {
    color: var(--text-primary);
}

.btn-toggle.active {
    background: var(--bg-dark);
    color: var(--neon-blue);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.5);
    border: 1px solid rgba(0, 210, 255, 0.15);
}

.sim-speed-controller {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: var(--font-header);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.08);
}

.btn-icon.btn-success {
    background: rgba(0, 255, 136, 0.08);
    border-color: rgba(0, 255, 136, 0.25);
    color: var(--neon-green);
}
.btn-icon.btn-success:hover {
    background: rgba(0, 255, 136, 0.15);
}

.btn-icon.btn-danger {
    background: rgba(255, 51, 102, 0.08);
    border-color: rgba(255, 51, 102, 0.25);
    color: var(--neon-red);
}
.btn-icon.btn-danger:hover {
    background: rgba(255, 51, 102, 0.15);
}

.speed-dropdown {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: var(--font-header);
    font-size: 0.82rem;
    font-weight: 500;
    padding: 7px 10px;
    border-radius: 8px;
    cursor: pointer;
    outline: none;
}

/* Sliders Panel */
.panel-sliders {
    padding: 24px;
}

.sliders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.slider-wrapper {
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.02);
    padding: 14px 16px;
    border-radius: 12px;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.slider-title {
    font-family: var(--font-header);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.slider-val-badge {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-color);
    font-family: var(--font-header);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
    padding: 3px 8px;
    border-radius: 6px;
}

.slider-val-badge small {
    font-size: 0.6rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.slider-body {
    display: flex;
    align-items: center;
    gap: 12px;
}

.slider-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
}

.slider-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.control-slider {
    flex-grow: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    outline: none;
}

.control-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--text-primary);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    transition: background 0.2s ease, transform 0.2s ease;
}

.control-slider::-webkit-slider-thumb:hover {
    background: var(--neon-blue);
    transform: scale(1.2);
    box-shadow: 0 0 10px var(--neon-blue-glow);
}

/* Custom chart wrapper */
.panel-charts {
    padding: 24px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.chart-legend {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.legend-item {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
}

.legend-color {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.legend-color.biomass { background: #3498db; }
.legend-color.product { background: #2ecc71; }
.legend-color.glucose { background: #f1c40f; }
.legend-color.DO { background: #00ffff; }

.chart-body {
    width: 100%;
    overflow-x: auto;
}

#live-trend-chart {
    width: 100%;
    height: 240px;
    display: block;
}

/* ==========================================================================
   TAB 2: SAFETY SHIELD CONSOLE LAYOUT
   ========================================================================== */
.safety-grid {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 24px;
}

.safety-status-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.shield-status-card {
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.card-title-centered {
    font-family: var(--font-header);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title-centered i {
    color: var(--neon-blue);
    text-shadow: 0 0 10px var(--neon-blue-glow);
}

.status-indicator-large {
    font-family: var(--font-header);
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: 2px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Large Glow Text colors */
.text-glow-green { color: var(--neon-green); text-shadow: 0 0 25px var(--neon-green-glow); }
.text-glow-orange { color: var(--neon-orange); text-shadow: 0 0 25px var(--neon-orange-glow); }
.text-glow-red { color: var(--neon-red); text-shadow: 0 0 25px var(--neon-red-glow); }

.shield-status-card.state-safe { border-color: rgba(0, 255, 136, 0.25); background: radial-gradient(circle at center, rgba(0, 255, 136, 0.03) 0%, var(--bg-panel) 80%); }
.shield-status-card.state-breakthrough { border-color: rgba(255, 170, 0, 0.25); background: radial-gradient(circle at center, rgba(255, 170, 0, 0.03) 0%, var(--bg-panel) 80%); }
.shield-status-card.state-override { border-color: rgba(255, 51, 102, 0.25); background: radial-gradient(circle at center, rgba(255, 51, 102, 0.03) 0%, var(--bg-panel) 80%); animation: border-pulse-red 2s infinite ease-in-out; }

.status-explanation {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Tier 1 Redlines Card */
.redlines-card {
    padding: 24px;
}

.redline-gauge-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.gauge-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gauge-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.gauge-bar-outer {
    position: relative;
    height: 10px;
    background: rgba(0,0,0,0.3);
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.gauge-bar-danger-low {
    position: absolute;
    left: 0;
    width: 25%;
    height: 100%;
    background: rgba(255, 51, 102, 0.2);
    border-right: 1px dashed rgba(255, 51, 102, 0.4);
}

.gauge-bar-safe {
    position: absolute;
    left: 25%;
    width: 50%;
    height: 100%;
    background: rgba(0, 255, 136, 0.15);
}

.gauge-bar-danger-high {
    position: absolute;
    left: 75%;
    width: 25%;
    height: 100%;
    background: rgba(255, 51, 102, 0.2);
    border-left: 1px dashed rgba(255, 51, 102, 0.4);
}

.gauge-indicator {
    position: absolute;
    width: 4px;
    height: 140%;
    background: var(--text-primary);
    border-radius: 2px;
    box-shadow: 0 0 8px #fff;
    top: -20%;
    transition: left 0.3s ease;
}

.gauge-bounds {
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-muted);
}

/* Event overrides Log Table */
.safety-log-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.log-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.btn-small-danger {
    background: rgba(255, 51, 102, 0.08);
    border: 1px solid rgba(255, 51, 102, 0.2);
    color: var(--neon-red);
    font-family: var(--font-header);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-small-danger:hover {
    background: rgba(255, 51, 102, 0.15);
}

.log-table-container {
    flex-grow: 1;
    overflow-y: auto;
    max-height: 480px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(0,0,0,0.15);
}

.log-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.log-table th, .log-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.8rem;
}

.log-table th {
    background: rgba(0, 0, 0, 0.25);
    font-family: var(--font-header);
    font-weight: 600;
    color: var(--text-secondary);
    position: sticky;
    top: 0;
}

.log-table td {
    color: var(--text-primary);
}

.table-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 40px !important;
}

/* Event badges */
.badge-status {
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-header);
    font-size: 0.68rem;
    font-weight: 700;
}

.badge-status.safe { background: rgba(0, 255, 136, 0.08); border: 1px solid rgba(0, 255, 136, 0.15); color: var(--neon-green); }
.badge-status.breakthrough { background: rgba(255, 170, 0, 0.08); border: 1px solid rgba(255, 170, 0, 0.15); color: var(--neon-orange); }
.badge-status.overridden { background: rgba(255, 51, 102, 0.08); border: 1px solid rgba(255, 51, 102, 0.15); color: var(--neon-red); }

/* ==========================================================================
   TAB 3: DATASET ANALYST LAYOUT
   ========================================================================== */
.analyst-grid {
    display: grid;
    grid-template-columns: 460px 1fr;
    gap: 24px;
}

/* Uploader zone Card */
.upload-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.drop-zone {
    flex-grow: 1;
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    margin: 10px 0 20px 0;
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--neon-blue);
    background: rgba(0, 210, 255, 0.02);
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.02);
}

.cloud-icon {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.drop-zone:hover .cloud-icon {
    color: var(--neon-blue);
    transform: translateY(-4px);
    text-shadow: 0 0 15px var(--neon-blue-glow);
}

.drop-text-primary {
    font-family: var(--font-header);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.drop-text-secondary {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.hidden-input {
    display: none;
}

.upload-presets-section {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

.preset-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    display: block;
    margin-bottom: 10px;
}

.preset-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-preset {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-preset:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-hover);
}

.upload-status {
    background: rgba(0, 210, 255, 0.05);
    border: 1px solid rgba(0, 210, 255, 0.15);
    color: var(--neon-blue);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 500;
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Scorecard detailed panel */
.score-card {
    padding: 30px;
}

.scorecard-placeholder {
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-muted);
    gap: 16px;
}

.placeholder-icon {
    font-size: 3rem;
    opacity: 0.25;
}

.scorecard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
    margin-bottom: 24px;
}

.sc-filename {
    font-family: var(--font-header);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--neon-blue);
}

.grade-section {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}

.grade-circle {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-header);
    font-size: 2.2rem;
    font-weight: 800;
    border: 2px solid transparent;
}

/* Glowing Neon Circles */
.bg-glow-green { background: rgba(0, 255, 136, 0.08); border-color: rgba(0, 255, 136, 0.25); color: var(--neon-green); box-shadow: 0 0 20px var(--neon-green-glow); }
.bg-glow-orange { background: rgba(255, 170, 0, 0.08); border-color: rgba(255, 170, 0, 0.25); color: var(--neon-orange); box-shadow: 0 0 20px var(--neon-orange-glow); }
.bg-glow-red { background: rgba(255, 51, 102, 0.08); border-color: rgba(255, 51, 102, 0.25); color: var(--neon-red); box-shadow: 0 0 20px var(--neon-red-glow); }

.grade-text {
    display: flex;
    flex-direction: column;
}

.grade-score {
    font-family: var(--font-header);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.grade-title {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Breakdown Progress Bars */
.quality-bars-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.q-bar-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.q-bar-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.q-bar-val {
    font-family: var(--font-header);
    font-weight: 700;
    color: var(--text-primary);
}

.q-bar-track {
    height: 6px;
    background: rgba(255,255,255,0.03);
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.q-bar-fill {
    height: 100%;
    background: var(--neon-blue);
    border-radius: 3px;
    box-shadow: 0 0 8px var(--neon-blue-glow);
    transition: width 0.8s cubic-bezier(0.1, 0.8, 0.2, 1);
}

.scorecard-footer {
    border-top: 1px solid var(--border-color);
    margin-top: 24px;
    padding-top: 16px;
    font-size: 0.72rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.scorecard-footer strong {
    color: var(--text-primary);
}

/* ==========================================================================
   TAB 4: DIAGNOSTICS
   ========================================================================== */
.diagnostics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
}

.diag-card {
    padding: 24px;
}

.diag-table {
    width: 100%;
    border-collapse: collapse;
}

.diag-table td {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 0.82rem;
}

.diag-table td:first-child {
    font-family: var(--font-header);
    font-weight: 600;
    color: var(--text-secondary);
    width: 200px;
}

.diag-table td:last-child {
    color: var(--text-primary);
}

.diag-table code {
    background: rgba(0,0,0,0.3);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    font-size: 0.78rem;
    color: var(--neon-blue);
}

/* ==========================================================================
   ANIMATION KEYFRAMES
   ========================================================================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

@keyframes pulse-slow {
    0%, 100% { opacity: 1; filter: drop-shadow(0 0 5px var(--neon-green-glow)); }
    50% { opacity: 0.7; filter: drop-shadow(0 0 1px transparent); }
}

@keyframes rotate-impeller {
    from { transform: translateX(-50%) rotate(0deg); }
    to { transform: translateX(-50%) rotate(360deg); }
}

@keyframes bubble-up {
    0% { transform: translateY(0) scale(0.6); opacity: 0; }
    10% { opacity: 0.8; }
    90% { opacity: 0.8; }
    100% { transform: translateY(-280px) scale(1.1); opacity: 0; }
}

@keyframes border-pulse-red {
    0%, 100% { border-color: rgba(255, 51, 102, 0.25); box-shadow: 0 0 20px rgba(255, 51, 102, 0.05); }
    50% { border-color: rgba(255, 51, 102, 0.6); box-shadow: 0 0 25px rgba(255, 51, 102, 0.15); }
}

/* General classes */
.hidden { display: none !important; }
.text-neon-green { color: var(--neon-green) !important; text-shadow: 0 0 10px var(--neon-green-glow); }
.text-neon-red { color: var(--neon-red) !important; text-shadow: 0 0 10px var(--neon-red-glow); }

/* ==========================================================================
   TAB 5: GEMINI COPILOT LAYOUT
   ========================================================================== */
.copilot-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
    height: calc(100vh - 140px);
    min-height: 580px;
}

.copilot-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.settings-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.settings-group label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.input-password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.settings-input {
    width: 100%;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 12px;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.8rem;
    outline: none;
    transition: all 0.2s ease;
}

.settings-input:focus {
    border-color: var(--neon-blue);
    box-shadow: 0 0 8px var(--neon-blue-glow);
}

.copilot-chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    border-radius: 16px;
    overflow: hidden;
}

.chat-header-bar {
    padding: 16px 24px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header-bar h3 {
    font-family: var(--font-header);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-header-bar h3 i {
    color: var(--neon-blue);
    text-shadow: 0 0 8px var(--neon-blue-glow);
}

.chat-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    background: rgba(0, 210, 255, 0.08);
    border: 1px solid rgba(0, 210, 255, 0.2);
    color: var(--neon-blue);
}

.chat-messages {
    flex-grow: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: rgba(0,0,0,0.1);
}

.chat-message {
    max-width: 80%;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease forwards;
}

.chat-message.user {
    align-self: flex-end;
}

.chat-message.ai {
    align-self: flex-start;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 0.85rem;
    line-height: 1.5;
    word-break: break-word;
}

.chat-message.user .message-bubble {
    background: linear-gradient(135deg, rgba(0, 210, 255, 0.15) 0%, rgba(0, 110, 255, 0.1) 100%);
    border: 1px solid rgba(0, 210, 255, 0.2);
    color: var(--text-primary);
    border-bottom-right-radius: 2px;
}

.chat-message.ai .message-bubble {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: #e5e7eb;
    border-bottom-left-radius: 2px;
}

.chat-message.ai .message-bubble p {
    margin-bottom: 8px;
}

.chat-message.ai .message-bubble p:last-child {
    margin-bottom: 0;
}

.chat-message.ai .message-bubble ul, .chat-message.ai .message-bubble ol {
    margin-left: 20px;
    margin-top: 6px;
    margin-bottom: 6px;
}

.chat-message.ai .message-bubble li {
    margin-bottom: 4px;
}

.chat-message.ai .message-bubble code {
    background: rgba(0,0,0,0.4);
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--neon-blue);
    border: 1px solid rgba(255,255,255,0.05);
}

.message-meta {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 4px;
    padding: 0 4px;
}

.chat-message.user .message-meta {
    align-self: flex-end;
}

.chat-message.ai .message-meta {
    align-self: flex-start;
}

.chat-loading {
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    border-bottom-left-radius: 2px;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.dot-flashing {
    position: relative;
    width: 6px;
    height: 6px;
    border-radius: 3px;
    background-color: var(--text-secondary);
    animation: dot-flashing 1s infinite linear alternate;
    animation-delay: .5s;
}

.dot-flashing::before, .dot-flashing::after {
    content: '';
    display: inline-block;
    position: absolute;
    top: 0;
}

.dot-flashing::before {
    left: -10px;
    width: 6px;
    height: 6px;
    border-radius: 3px;
    background-color: var(--text-secondary);
    animation: dot-flashing 1s infinite linear alternate;
    animation-delay: 0s;
}

.dot-flashing::after {
    left: 10px;
    width: 6px;
    height: 6px;
    border-radius: 3px;
    background-color: var(--text-secondary);
    animation: dot-flashing 1s infinite linear alternate;
    animation-delay: 1s;
}

@keyframes dot-flashing {
    0% { background-color: var(--text-secondary); }
    50%, 100% { background-color: rgba(255,255,255, 0.1); }
}

.chat-input-area {
    padding: 16px 24px;
    background: rgba(0, 0, 0, 0.25);
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-presets-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.chat-presets-bar::-webkit-scrollbar {
    height: 4px;
}

.btn-quick-prompt {
    flex-shrink: 0;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-quick-prompt:hover {
    background: rgba(0, 210, 255, 0.05);
    border-color: rgba(0, 210, 255, 0.3);
    color: var(--text-primary);
}

.chat-input-wrapper {
    display: flex;
    gap: 12px;
}

.chat-input {
    flex-grow: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    outline: none;
    transition: all 0.2s ease;
}

.chat-input:focus {
    border-color: var(--neon-blue);
    box-shadow: 0 0 10px var(--neon-blue-glow);
}

.btn-send {
    background: linear-gradient(135deg, var(--neon-blue) 0%, #006eff 100%);
    border: none;
    color: #fff;
    padding: 0 20px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    box-shadow: 0 0 10px var(--neon-blue-glow);
}

.btn-send:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 15px var(--neon-blue-glow);
}

.btn-send:active {
    transform: translateY(1px);
}

