/* Reset and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-primary: hsl(225, 20%, 6%);
    --bg-secondary: hsl(225, 18%, 10%);
    --card-bg: rgba(22, 26, 38, 0.65);
    --card-bg-hover: rgba(28, 33, 48, 0.8);
    --border-color: rgba(255, 255, 255, 0.06);
    --border-glow: rgba(0, 242, 254, 0.12);
    
    --text-primary: hsl(210, 25%, 96%);
    --text-secondary: hsl(210, 12%, 70%);
    --text-muted: hsl(210, 8%, 45%);
    
    --accent-cyan: hsl(185, 100%, 48%);
    --accent-blue: hsl(210, 100%, 55%);
    --accent-orange: hsl(24, 100%, 50%);
    --accent-red: hsl(355, 95%, 55%);
    --accent-green: hsl(145, 80%, 48%);
    --accent-yellow: hsl(45, 100%, 50%);
    --accent-purple: hsl(275, 90%, 65%);
    
    --font-sans: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.7);
    
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.5;
    overflow-x: hidden;
    background-image: 
        radial-gradient(at 0% 0%, rgba(0, 242, 254, 0.03) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(255, 92, 0, 0.02) 0px, transparent 50%);
    background-attachment: fixed;
    min-height: 100vh;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* App Layout Grid */
.app-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    grid-template-rows: 64px 1fr;
    grid-template-areas: 
        "header header"
        "sidebar main";
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* Header */
.app-header {
    grid-area: header;
    background: rgba(10, 12, 18, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 100;
}

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

.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.3);
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: linear-gradient(to right, #fff, var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    background: rgba(0, 242, 254, 0.1);
    border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan);
    border-radius: 12px;
    font-weight: 600;
    letter-spacing: 1px;
}

.file-status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    transition: var(--transition-fast);
}

.file-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--accent-red);
    box-shadow: 0 0 8px var(--accent-red);
}

.file-status-dot.loaded {
    background-color: var(--accent-green);
    box-shadow: 0 0 8px var(--accent-green);
}

/* Sidebar */
.app-sidebar {
    grid-area: sidebar;
    background: rgba(14, 17, 26, 0.5);
    border-right: 1px solid var(--border-color);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow: hidden;
    backdrop-filter: blur(8px);
}

/* Cards & Containers */
.glass-panel {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
}

.glass-panel:hover {
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-md);
}

/* File Upload Component */
.upload-zone {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.01);
    transition: var(--transition-smooth);
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--accent-cyan);
    background: rgba(0, 242, 254, 0.03);
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.05);
}

.upload-icon {
    font-size: 2rem;
    color: var(--accent-cyan);
    margin-bottom: 12px;
    display: block;
}

.upload-text {
    font-weight: 500;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.upload-subtext {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Sensor PID Selector Group */
.sensor-selection-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    min-height: 0;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.panel-actions {
    display: flex;
    gap: 8px;
}

.panel-btn {
    background: transparent;
    border: none;
    color: var(--accent-cyan);
    font-size: 0.75rem;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition-fast);
}

.panel-btn:hover {
    color: #fff;
    text-decoration: underline;
}

.search-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition-fast);
}

.search-input:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 8px rgba(0, 242, 254, 0.15);
}

/* Collapsible Sensor Lists by Unit */
.sensor-list-container {
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 4px;
}

.sensor-group {
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.15);
    overflow: hidden;
    flex-shrink: 0;
    transition: var(--transition-smooth);
}

.sensor-group-header {
    background: rgba(255, 255, 255, 0.02);
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    font-size: 0.85rem;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: var(--transition-fast);
}

.sensor-group-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.group-count {
    background: rgba(0, 242, 254, 0.15);
    color: var(--accent-cyan);
    border: 1px solid rgba(0, 242, 254, 0.3);
    padding: 1px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
}

.sensor-group-items {
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sensor-group.collapsed .sensor-group-items {
    display: none;
}

.sensor-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition-fast);
    padding: 6px 8px;
    border-radius: 4px;
    border-left: 3px solid transparent;
}

.sensor-checkbox-label:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.03);
}

.sensor-checkbox-label.highlighted {
    background: rgba(0, 242, 254, 0.08);
    border-left-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.sensor-checkbox {
    appearance: none;
    width: 16px;
    height: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.sensor-checkbox:checked {
    background-color: var(--accent-cyan);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 8px rgba(0, 242, 254, 0.3);
}

.sensor-checkbox:checked::after {
    content: "✓";
    font-size: 11px;
    color: #000;
    font-weight: bold;
}

.sensor-legend-color {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

/* Main Dashboard Area */
.app-main {
    grid-area: main;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    height: 100%;
}

/* Playback Control Bar */
.playback-control-bar {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    outline: none;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-sm);
}

.btn-icon.active {
    background: var(--accent-cyan);
    color: #000;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.3);
}

.timeline-scrubber-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.time-scrubber {
    flex: 1;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.08);
    outline: none;
    cursor: pointer;
}

.time-scrubber::-webkit-slider-thumb {
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent-cyan);
    box-shadow: 0 0 10px var(--accent-cyan);
    cursor: pointer;
    transition: var(--transition-fast);
}

.time-scrubber::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.time-display {
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
    min-width: 130px;
    text-align: right;
}

.speed-select-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.speed-select-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.speed-select {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    outline: none;
    cursor: pointer;
}

/* Gauge Instrument Cluster */
.gauge-cluster {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.gauge-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.gauge-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gauge-config-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.75rem;
    transition: var(--transition-fast);
}

.gauge-config-btn:hover {
    color: var(--accent-cyan);
}

.gauge-svg-container {
    position: relative;
    width: 140px;
    height: 140px;
}

.gauge-radial {
    transform: rotate(-220deg);
    transform-origin: 50% 50%;
}

.gauge-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.04);
    stroke-width: 8;
    stroke-dasharray: 280;
    stroke-dashoffset: 80;
}

.gauge-fill {
    fill: none;
    stroke: url(#gaugeGradientCyan);
    stroke-width: 8;
    stroke-dasharray: 280;
    stroke-dashoffset: 280; /* Calculated dynamically: 280 - (percent * 2) */
    stroke-linecap: round;
    transition: stroke-dashoffset 0.1s ease-out;
}

/* Specific colors for specific gauges */
.gauge-card.rpm .gauge-fill {
    stroke: url(#gaugeGradientOrange);
}
.gauge-card.speed .gauge-fill {
    stroke: url(#gaugeGradientBlue);
}
.gauge-card.aux-1 .gauge-fill {
    stroke: url(#gaugeGradientMagenta);
}
.gauge-card.aux-2 .gauge-fill {
    stroke: url(#gaugeGradientPurple);
}

.gauge-needle {
    width: 2px;
    height: 55px;
    background: var(--accent-red);
    position: absolute;
    bottom: 50%;
    left: calc(50% - 1px);
    transform-origin: bottom center;
    transform: rotate(-130deg); /* Range: -130deg to 130deg */
    transition: transform 0.1s ease-out;
    box-shadow: 0 0 8px var(--accent-red);
    border-radius: 2px;
}

.gauge-center-cap {
    width: 12px;
    height: 12px;
    background: #252b41;
    border: 2px solid var(--text-secondary);
    border-radius: 50%;
    position: absolute;
    top: calc(50% - 6px);
    left: calc(50% - 6px);
    box-shadow: var(--shadow-sm);
}

.gauge-value-display {
    position: absolute;
    bottom: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gauge-value {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: monospace;
    line-height: 1.1;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.gauge-unit {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

/* Config drop-down menu for customizable gauges */
.gauge-dropdown {
    position: absolute;
    top: 32px;
    right: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 10;
    display: none;
    max-height: 160px;
    overflow-y: auto;
    width: 160px;
}

.gauge-dropdown.show {
    display: block;
}

.gauge-dropdown-item {
    padding: 8px 12px;
    font-size: 0.75rem;
    text-align: left;
    cursor: pointer;
    transition: var(--transition-fast);
}

.gauge-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent-cyan);
}

/* Timeline Chart Area */
.chart-card {
    position: relative;
    min-height: 380px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chart-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-title {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.chart-controls {
    display: flex;
    gap: 8px;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.chart-wrapper {
    position: relative;
    flex: 1;
    height: 320px;
    width: 100%;
}

/* Metrics Grid */
.metrics-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.metric-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-left: 3px solid var(--accent-blue);
    position: relative;
}

.metric-panel::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(0, 242, 254, 0.01), transparent);
    pointer-events: none;
}

.metric-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.metric-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    word-break: break-all;
}

.metric-sparkline {
    width: 80px;
    height: 24px;
}

.metric-values {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 4px;
}

.metric-subval {
    display: flex;
    flex-direction: column;
}

.metric-subval-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.metric-subval-number {
    font-family: monospace;
    font-size: 0.85rem;
    font-weight: 600;
}

.metric-avg-container {
    grid-column: span 3;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    padding-top: 6px;
    margin-top: 2px;
}

.metric-avg-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.metric-avg-value {
    font-family: monospace;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
}

/* Bottom Data Grid Panel */
.data-table-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-title {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.table-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.table-search-input {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    outline: none;
    width: 200px;
    transition: var(--transition-fast);
}

.table-search-input:focus {
    border-color: var(--accent-cyan);
}

.table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.15);
    max-height: 250px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    text-align: left;
}

.data-table th, .data-table td {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.data-table th {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1;
}

.data-table tbody tr {
    cursor: pointer;
    transition: var(--transition-fast);
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.data-table tbody tr.active-row {
    background: rgba(0, 242, 254, 0.08);
}

.data-table td {
    font-family: monospace;
    color: var(--text-secondary);
}

.data-table td.null-value {
    color: var(--text-muted);
}

.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.pagination-buttons {
    display: flex;
    gap: 8px;
}

.btn-small {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-small:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.btn-small:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-small.active {
    background: var(--accent-cyan) !important;
    color: #000 !important;
    font-weight: 600;
}

.data-table tbody tr.clutch-active {
    background: rgba(255, 75, 75, 0.06);
}

.data-table tbody tr.clutch-active.active-row {
    background: rgba(255, 75, 75, 0.16) !important;
}

.data-table tbody tr.clutch-active td {
    color: hsl(0, 100%, 75%);
}

/* Maximized Chart Layout */
.app-main.chart-maximized > *:not(.playback-control-bar):not(.chart-card) {
    display: none !important;
}

.app-main.chart-maximized .chart-card {
    flex: 1;
    min-height: 0;
    height: auto;
}

.app-main.chart-maximized .chart-wrapper {
    height: 100%;
    flex: 1;
}

.btn-secondary.active {
    background: var(--accent-cyan);
    color: #000;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.3);
}

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

/* Help Guide Button & Modal Styles */
.btn-help {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-help:hover {
    background: rgba(0, 242, 254, 0.06);
    border-color: var(--accent-cyan);
    color: #fff;
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.2);
}

.btn-help svg {
    color: var(--accent-cyan);
}

/* Modal Overlay */
.help-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(6, 8, 12, 0.75);
    backdrop-filter: blur(14px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Modal Window */
.help-modal {
    width: 860px;
    max-width: 95%;
    height: 560px;
    max-height: 90vh;
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(0, 242, 254, 0.04);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(20px);
}

/* Header */
.help-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.15);
}

.help-modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
}

.help-icon-badge {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(0, 242, 254, 0.1);
    border: 1px solid rgba(0, 242, 254, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-cyan);
}

.help-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    transition: var(--transition-fast);
}

.help-close-btn:hover {
    color: var(--accent-red);
    transform: scale(1.1);
}

/* Body Layout */
.help-modal-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar Tabs */
.help-modal-tabs {
    width: 220px;
    background: rgba(0, 0, 0, 0.2);
    border-right: 1px solid rgba(255, 255, 255, 0.04);
    padding: 20px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    flex-shrink: 0;
}

.help-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 10px 16px;
    border-radius: 8px;
    text-align: left;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    border-left: 3px solid transparent;
}

.help-tab-btn:hover {
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
}

.help-tab-btn.active {
    background: rgba(0, 242, 254, 0.06);
    color: var(--accent-cyan);
    font-weight: 600;
    border-left-color: var(--accent-cyan);
}

/* Content Pane */
.help-modal-content-pane {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.05);
}

.help-tab-content {
    display: none;
}

.help-tab-content.active {
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: modalContentFade 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.help-tab-content h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: #fff;
    border-left: 3px solid var(--accent-cyan);
    padding-left: 10px;
    line-height: 1.2;
}

.help-tab-content p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.help-tab-content ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.help-tab-content li {
    font-size: 0.85rem;
    color: var(--text-secondary);
    position: relative;
    padding-left: 18px;
    line-height: 1.5;
}

.help-tab-content li::before {
    content: "•";
    color: var(--accent-cyan);
    position: absolute;
    left: 4px;
    font-weight: bold;
}

.help-tab-content code {
    font-family: monospace;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.04);
    padding: 2px 6px;
    border-radius: 4px;
    color: #fff;
    font-size: 0.8rem;
}

/* Steps Block */
.help-step-box {
    display: flex;
    gap: 14px;
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    padding: 14px 18px;
    align-items: center;
}

.step-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent-cyan);
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.3);
}

/* Code Snippet Box */
.help-snippet {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 16px;
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
    white-space: pre-wrap;
}

/* Keyframes */
@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalContentFade {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive Overrides */
@media (max-width: 768px) {
    .help-modal {
        height: 90vh;
    }
    .help-modal-body {
        flex-direction: column;
    }
    .help-modal-tabs {
        width: 100%;
        flex-direction: row;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.04);
        padding: 10px;
        height: auto;
        overflow-x: auto;
        white-space: nowrap;
    }
    .help-tab-btn {
        border-left: none;
        border-bottom: 3px solid transparent;
        padding: 8px 12px;
    }
    .help-tab-btn.active {
        border-bottom-color: var(--accent-cyan);
        background: rgba(0, 242, 254, 0.04);
    }
}
