/* LUMINA Dashboard Styles - Minimal V7 */

:root {
    /* Base Colors - Minimal Palette */
    --bg-primary: #0b0c0e;
    --bg-secondary: #0b0c0e;
    /* Flattened hierarchy */
    --bg-tertiary: #16181c;
    /* Card surface */
    --bg-card: #16181c;
    --bg-hover: #1f2126;

    --text-primary: #e6e8eb;
    --text-secondary: #8c9199;
    --text-muted: #5a5a6a;

    /* Accents - Sober */
    --accent-primary: #ffffff;
    /* White accent for minimal look */
    --accent-secondary: #3b82f6;
    /* Subtle blue */
    --accent-gradient: #ffffff;
    /* No gradient, solid */

    --channel-p: #8b5cf6;
    /* Keep identifying colors but reduced opacity usage */
    --channel-p-bg: rgba(139, 92, 246, 0.1);
    --channel-m: #06b6d4;
    --channel-m-bg: rgba(6, 182, 212, 0.1);

    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;

    --border-color: #272a30;
    --border-radius: 8px;
    /* Tighter radius */
    --border-radius-lg: 12px;
    --border-radius-sm: 6px;

    /* Removed heavy shadows/glows */
    --shadow-sm: none;
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-glow: none;

    /* Sizing */
    --sidebar-width: 260px;
    --header-height: 64px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* App Container */
.app-container {
    display: flex;
    height: 100vh;
    background: var(--bg-primary);
    /* Solid BG */
}

/* Sidebar - Google Premium Style */
.sidebar {
    width: 280px;
    background: var(--bg-primary);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    /* Subtle border */
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    /* Tighter padding */
}

/* Header/Brand */
.sidebar-header {
    padding: 0 12px;
    border-bottom: none;
    /* Removed border */
    margin-bottom: 32px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    /* Ensure no underline */
}

.logo-icon {
    width: 28px;
    /* Match Docs brand-logo height is 28px */
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon img {
    height: 36px;
    width: auto;
    opacity: 0.9;
}

.logo-title {
    font-size: 22px;
    /* Slightly smaller, refined */
    font-weight: 600;
    /* Lighter weight */
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.logo-subtitle {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 400;
    margin-top: 4px;
    letter-spacing: 0.01em;
}

/* Sidebar Section */
.sidebar-section {
    padding: 0;
    /* Remove padding, use margins */
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* Custom Scrollbar Helper */
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.sidebar-section.sidebar-bottom {
    flex: 0 0 auto;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

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

.section-title {
    font-size: 11px;
    /* Match Docs nav-label */
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

/* Sidebar Footer Branding */
.sidebar-footer {
    margin-top: auto;
    padding: 20px;
    text-align: center;
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* Button Icon in Header */
.btn-icon {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.1s;
}

.btn-icon:hover {
    color: var(--text-primary);
    background: transparent;
}

.btn-icon svg {
    width: 14px;
    height: 14px;
}

/* Refined Test Items */
.test-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.test-item {
    display: flex;
    flex-direction: column;
    padding: 12px 18px;
    border-radius: 20px;
    /* Pill shape like Google M3 */
    margin: 0 0 6px 0;
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
}

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

.test-item.active {
    background: rgba(139, 92, 246, 0.15);
    /* Soft accent bg */
    color: var(--channel-p);
    /* Accent text */
}

.test-item.active .test-item-title {
    font-weight: 600;
}

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

.test-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.test-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.test-delete-btn {
    opacity: 0;
    color: var(--error, #ef4444);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.test-item:hover .test-delete-btn {
    opacity: 0.4;
}

.test-delete-btn:hover {
    opacity: 1 !important;
    background: rgba(239, 68, 68, 0.15);
}

.test-icon {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    flex-shrink: 0;
}

.test-icon.pending {
    background: var(--warning);
}

.test-icon.failed {
    background: var(--error);
}

.test-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.test-meta {
    font-size: 11px;
    color: var(--text-muted);
    padding-left: 16px;
}

/* Quick Stats */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.stat-item {
    background: var(--bg-tertiary);
    padding: 16px 0;
    border-radius: var(--border-radius-sm);
    text-align: center;
    border: 1px solid var(--border-color);
}

.stat-value {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
}

.stat-label {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Sidebar Footer */
.version-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    font-size: 11px;
    color: var(--text-muted);
    padding: 0 8px;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
}

.status-dot.online {
    background: var(--success);
    box-shadow: none;
}

/* Main App Layout */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
    width: 100%;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    position: relative;
    padding: 0;
    /* content-wrapper handles padding via containers */
    display: flex;
    flex-direction: column;
}

/* Diagram Styles (Matching Docs Aesthetic) */
.diagram-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 40px 0;
    font-family: 'JetBrains Mono', monospace;
}

.d-node {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    width: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    z-index: 2;
}

.node-icon {
    width: 32px;
    height: 32px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.node-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-primary);
}

.d-arrow {
    width: 1px;
    height: 32px;
    background: var(--border-color);
    position: relative;
}

.d-arrow::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -3px;
    width: 0;
    height: 0;
    border-left: 3px solid transparent;
    border-right: 3px solid transparent;
    border-top: 4px solid var(--border-color);
}

.d-split-group {
    display: flex;
    gap: 32px;
}

.channel-icon {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.p-icon {
    color: var(--channel-p);
    background: rgba(139, 92, 246, 0.1);
}

.m-icon {
    color: var(--channel-m);
    background: rgba(6, 182, 212, 0.1);
}

/* Process Steps (Footer of Modal) */
.process-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    width: 100%;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.step-number {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 600;
}

.step-label {
    font-size: 11px;
    color: var(--text-secondary);
}

.step-arrow,
.step-divider {
    color: var(--text-muted);
    font-size: 12px;
}

/* Main Content */
.content-header {
    height: var(--header-height);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-primary);
}

.header-left {
    display: flex;
    flex-direction: column;
}

.page-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.page-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
}

.header-right {
    display: flex;
    gap: 12px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--border-radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.1s ease;
}

.btn svg {
    width: 14px;
    height: 14px;
}

.btn-primary {
    background: var(--text-primary);
    color: var(--bg-primary);
    border-color: transparent;
    box-shadow: none;
}

.btn-primary:hover {
    background: #fff;
    transform: none;
    box-shadow: none;
    opacity: 0.9;
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--text-secondary);
}

/* Content Body */
.content-body {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: var(--text-muted);
}

.empty-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.2;
}

.empty-icon svg {
    width: 100%;
    height: 100%;
}

.empty-state h2 {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    margin-bottom: 24px;
    overflow: hidden;
    backdrop-filter: none;
}

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

.card-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 24px;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 100px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
}

.badge-primary {
    color: var(--text-primary);
}

.badge-secondary {
    color: var(--text-secondary);
}

/* Prompt Display */
.prompt-display {
    background: var(--bg-primary);
    padding: 20px 24px;
    border-radius: var(--border-radius-sm);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-primary);
    margin-bottom: 28px;
    border: 1px solid var(--border-color);
    border-left: 2px solid var(--text-primary);
}

/* Audio Player */
.audio-player-container {
    margin-bottom: 24px;
}

.audio-player {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.play-btn {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.1s;
}

.play-btn:hover:not(:disabled) {
    background: var(--text-primary);
    color: var(--bg-primary);
    transform: none;
    box-shadow: none;
}

.play-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.play-btn svg {
    width: 14px;
    height: 14px;
}

.play-btn .icon-pause,
.play-btn.playing .icon-play {
    display: none;
}

.play-btn.playing .icon-pause {
    display: block;
}

.waveform {
    flex: 1;
    height: 32px;
    background: var(--bg-secondary);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.waveform .progress-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: var(--text-primary);
    /* Solid color progress */
    width: 0%;
    opacity: 0.2;
}

.time-display {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-muted);
    min-width: 70px;
    text-align: right;
}

.audio-meta {
    display: flex;
    gap: 24px;
    font-size: 12px;
    color: var(--text-secondary);
}

.audio-meta strong {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Attribution Chart */
.chart-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.chart-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    padding: 8px 12px;
    margin: 0 -12px;
    border-radius: var(--border-radius-sm);
    transition: background 0.1s;
}

.chart-bar:hover {
    background: var(--bg-hover);
}

.chart-bar.selected {
    background: var(--bg-hover);
    box-shadow: inset 2px 0 0 var(--text-primary);
    border-radius: 0;
}

.chart-rank {
    width: 24px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-align: center;
}

.chart-song {
    width: 180px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chart-bars {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 12px;
}

.bar-label {
    font-size: 10px;
    color: var(--text-muted);
    width: 12px;
    text-align: center;
}

.bar-track {
    flex: 1;
    height: 6px;
    background: var(--bg-primary);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.bar-fill.channel-p {
    background: var(--channel-p);
}

.bar-fill.channel-m {
    background: var(--channel-m);
}

.bar-fill.negative {
    background: var(--error);
    opacity: 0.6;
}

.chart-value {
    width: 60px;
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    text-align: right;
    color: var(--text-secondary);
}

.chart-legend {
    display: flex;
    gap: 24px;
    justify-content: center;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.legend-color {
    width: 8px;
    height: 8px;
    border-radius: 2px;
}

.legend-color.channel-p {
    background: var(--channel-p);
}

.legend-color.channel-m {
    background: var(--channel-m);
}

/* Tab Buttons */
.header-actions {
    display: flex;
    gap: 2px;
    background: var(--bg-primary);
    padding: 2px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
}

.btn-tab {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 4px;
}

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

.btn-tab.active {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Attribution Table */
.attribution-table table {
    width: 100%;
    border-collapse: collapse;
}

.attribution-table th,
.attribution-table td {
    padding: 10px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.attribution-table th {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
}

.attribution-table td {
    font-size: 13px;
}

.attribution-table tbody tr:hover {
    background: var(--bg-hover);
}

.table-play-btn {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.table-play-btn:hover {
    background: var(--text-primary);
    border-color: var(--text-primary);
    color: var(--bg-primary);
}

/* Metric Cards */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.metric-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.metric-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.metric-icon svg {
    width: 16px;
    height: 16px;
}

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

.metric-value {
    font-size: 18px;
    font-weight: 600;
    font-family: 'JetBrains Mono';
}

.metric-label {
    font-size: 11px;
    color: var(--text-muted);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--bg-card);
    width: 100%;
    max-width: 600px;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    max-height: 85vh;
}

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

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.modal-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
}

.suite-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.suite-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    cursor: pointer;
    transition: border-color 0.1s;
}

.suite-card:hover {
    border-color: var(--text-primary);
}

.suite-icon {
    font-size: 24px;
    margin-bottom: 12px;
}

.suite-card h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
}

.suite-card p {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Hidden utilities */
.hidden {
    display: none !important;
}

/* FIXES for Layout Issues */

/* Channel Panel Columns Header */
.channel-panel-cols {
    display: flex;
    align-items: center;
    padding: 0 12px;
    margin-bottom: 8px;
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.channel-panel-cols span:nth-child(1) {
    width: 24px;
    text-align: center;
    margin-right: 16px;
    /* Matches chart-bar gap */
}

.channel-panel-cols span:nth-child(2) {
    width: 180px;
}

.channel-panel-cols span:nth-child(3) {
    flex: 1;
    /* Spacer matching bars */
}

.channel-panel-cols span:nth-child(4) {
    width: 60px;
    text-align: right;
    margin-right: 12px;
    /* Space before badge */
}

.channel-panel-cols span:nth-child(5) {
    width: 90px;
    text-align: center;
}

/* Tags (Genre/Mood) */
#genreTags,
#trainingTags,
#moodTags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.tag,
.training-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 99px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 11px;
    border: 1px solid var(--border-color);
    white-space: nowrap;
}

/* FIXES PART 2: Icons & Padding */

/* Training Artwork Icon Size */
.training-artwork {
    width: 64px;
    height: 64px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
}

.training-artwork svg {
    width: 32px;
    height: 32px;
    color: var(--text-muted);
    opacity: 0.7;
}

/* Google Premium Semantic Style - NO BOXES */
.semantic-card {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin-bottom: 32px;
}

.semantic-card h4 {
    margin-bottom: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: none;
    /* No Border */
    padding-bottom: 0;
}

.tag-cloud {
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag,
.training-tag {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    /* Micro border */
    color: var(--text-secondary);
    border-radius: 6px;
    /* Soft square */
    padding: 4px 10px;
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Card Refinement - Flat & Clean */
.card {
    background: #0f1012;
    /* Slightly lighter than 0b0c0e */
    border: 1px solid rgba(255, 255, 255, 0.03) !important;
    border-radius: 16px;
    box-shadow: none;
    /* Flat design */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-bottom: 0 !important;
    /* Grid handles spacing */
}

.card-header {
    background: transparent !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    padding: 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: auto;
    /* Let content dictate */
    min-height: 56px;
}

.card-header h3 {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-primary);
    margin: 0;
}

.card-body {
    padding: 24px 32px;
}

/* Soften Headers */
h1,
h2,
h3 {
    letter-spacing: -0.01em;
    color: #f0f0f0;
    /* Soft white */
}

/* Adjust Semantic Grid spacing */
.semantic-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    /* Let cards handle spacing */
}

/* Harmonious Padding for List Headers */
.channel-panel-cols {
    padding: 0 16px;
    /* Increased from 12px */
    margin-top: 24px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.channel-panel-body {
    padding: 8px 0;
}

.chart-bar {
    padding: 10px 16px;
    /* Match header padding */
    margin: 4px 0;
    border-radius: 6px;
}

/* Ensure channel breakdown bars have space */
.channel-breakdown h4 {
    margin-bottom: 20px;
}

/* FIXES PART 3: Dashboard Grid Refactor */

/* Grid Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    /* Main vs Side (360px fixed) */
    gap: 24px;
    margin-top: 24px;
    align-items: start;
}

.grid-main {
    min-width: 0;
    /* Flex/Grid child overflow fix */
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.grid-side {
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: sticky;
    top: 24px;
    /* Sticky inspector */
}

@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        /* Stack on smaller screens */
    }

    .grid-side {
        position: static;
        width: 100%;
    }
}

/* FIXES PART 4: Final Polish (Badges, Stats, Detail Cleanup) */

/* Sidebar "NEW" Badge Softening */
.test-item .badge,
.test-item span[class*="badge"],
.test-item span[class*="label"] {
    font-size: 9px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1) !important;
    /* Soft backdrop */
    color: var(--text-secondary) !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none !important;
}

/* Quick Stats - Remove Boxiness */
.quick-stats {
    background: transparent !important;
    border: none !important;
    padding: 16px 0 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.05) !important;
    margin-top: auto;
    /* Push to bottom */
}

.stat-item {
    padding: 4px 0 !important;
}

.stat-value {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
}

.stat-label {
    text-transform: uppercase;
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

/* Training Player - Flat */
.training-artwork {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.03);
    border: none;
    border-radius: 8px;
}

/* Audio Player Controls - Clean */
.play-btn {
    background: var(--text-primary);
    color: var(--bg-primary);
    /* Invert for play button (White circle, dark icon) */
}

/* Table Cleanliness */
table th {
    font-weight: 500;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
}

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


/* Enhanced Module/Card Styles */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    /* Modern radius */
    box-shadow: none;
    /* Flat design */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-bottom: 0 !important;
    /* Grid handles spacing */
}

.card-header {
    padding: 16px 24px;
    /* Generous header padding */
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.01);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: auto;
    /* Let content dictate */
    min-height: 56px;
}

.card-header h3 {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-primary);
    margin: 0;
}

.card-body {
    padding: 24px;
    /* Breathing room */
}

/* Specific Tweak for Training Player in Side Col */
.training-player-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.audio-player-container {
    padding: 0;
    background: transparent;
    border: none;
}

/* Ensure Charts fit padding */
.chart-bar {
    margin: 4px 0;
    /* Reset negative margins if any existed */
}

/* Metrics Spacing Fix */
.metrics-section {
    margin-top: 32px !important;
}

/* FIXES PART 5: Font Size Standardization */
.channel-label {
    font-size: 11px !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted) !important;
    font-weight: 600;
}

.channel-value {
    font-size: 14px !important;
    /* Reduced from default */
    font-weight: 500;
    color: var(--text-primary);
}

/* FIXES PART 6: New Test Modal Beautification */
.test-options-grid {
    gap: 24px;
    /* More breathing room */
}

.test-option-card {
    background: #131518;
    /* Surface color */
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 24px !important;
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.test-option-card:hover {
    background: #1a1d21;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
}

.test-option-icon {
    font-size: 32px !important;
    /* Bigger Emoji */
    margin-bottom: 20px !important;
}

.test-option-card h4 {
    font-size: 18px !important;
    /* Bigger Title */
    font-weight: 600;
    color: #fff;
    margin-bottom: 12px !important;
    letter-spacing: -0.01em;
}

.test-option-card p {
    font-size: 15px !important;
    /* Bigger Body */
    line-height: 1.6;
    color: #a0a0a0;
    margin-bottom: 24px !important;
}

.test-duration {
    align-self: flex-start;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 12px;
    border-radius: 99px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* FIXES PART 7: Final Polish (Modal, Chart Alignment, Icon) */

/* 1. Modal "Suite Card" Override (The actual class used) */
.suite-card {
    background: #131518;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 24px !important;
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    min-height: 180px;
    justify-content: space-between;
}

.suite-card:hover {
    background: #1a1d21;
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.suite-icon {
    font-size: 28px;
    /* Slightly smaller icon */
    margin-bottom: 16px;
    display: block;
}

.suite-name {
    font-size: 16px;
    /* Harmonized from 18px */
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
}

.suite-desc {
    font-size: 13px;
    /* Harmonized from 15px */
    color: #a0a0a0;
    line-height: 1.5;
    flex: 1;
}

.suite-eta {
    font-size: 10px;
    /* Refined */
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 8px;
    border-radius: 4px;
    align-self: flex-start;
    margin-top: 16px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* 2. Hide Training Icon */
.training-artwork {
    display: none !important;
}

/* 3. Fix Chart Alignment & Spacing */
.chart-meta-inline {
    display: flex;
    align-items: center;
    gap: 24px;
    /* Fix "Too Close" Issue */
    min-width: 200px;
    justify-content: flex-end;
}

.influence-pct {
    min-width: 60px;
    text-align: right;
    font-size: 13px !important;
}

.classification-badge {
    min-width: 90px;
}

/* Align Header Cols to match content */
.channel-panel-cols {
    display: grid;
    /* Grid aligns with row content logically */
    /* Rank (30), Song (1fr), Bar (1fr), Pct (60), Badge (90) */
    /* Wait, Row is Flex. Let's approximate flex widths */
    display: flex;
    padding: 0 16px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 8px;
}

/* Use Nth-child targeting to align headers with flex children */
/* Header Spans: Rank, Song, (Gap), Influence, Class */
.channel-panel-cols span:nth-child(1) {
    width: 30px;
}

/* Rank */
.channel-panel-cols span:nth-child(2) {
    flex: 1;
}

/* Song */
.channel-panel-cols span:nth-child(3) {
    flex: 1;
}

/* Bars Space */
.channel-panel-cols span:nth-child(4) {
    width: 80px;
    text-align: right;
    margin-right: 24px;
}

/* Influence */
.channel-panel-cols span:nth-child(5) {
    width: 90px;
    text-align: center;
}

/* Class */

/* FIXES PART 8: Separate Channel Tables */
.dual-leaderboard {
    display: flex;
    flex-direction: column;
    gap: 40px !important;
    /* Reduced from 64px */
}

/* FIXES PART 9: Table View Spacing & Header Badge */
.dual-tables {
    display: flex;
    flex-direction: column;
    gap: 40px !important;
    /* Match chart view separation */
}

/* Header Flex Layout */
.channel-panel-header,
.channel-table-header {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.channel-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-left: 12px;
}

/* Qualified Count Pill - Right Aligned */
.channel-count {
    margin-left: auto;
    /* Push to right */
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 99px;
    /* Pill */
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* FIXES PART 10: Training Panel Typography */
#trainingSongTitle {
    font-size: 16px !important;
    font-weight: 500 !important;
    line-height: 1.4;
    margin-bottom: 4px;
}

#trainingSongArtist {
    font-size: 13px !important;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* FIXES PART 11: EXTENSIVE HARMONIZATION PASS */

/* 1. Global Scrollbar Polish (Windows/Chrome) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 2. Typographic Standardization */
.stat-value {
    font-family: 'Inter', -apple-system, sans-serif !important;
    /* Remove Mono */
    letter-spacing: -0.02em;
    font-size: 13px !important;
    /* Slightly larger for impact */
    font-weight: 600 !important;
}

table td {
    font-size: 13px !important;
    /* Harmonize with Chart Bars */
    padding: 12px 16px !important;
    /* More breathing room */
    height: 48px;
    /* Consistent row height */
    vertical-align: middle;
}

table th {
    padding: 12px 16px !important;
}

/* 3. Table Play Button Refinement */
.table-play-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    /* Softer corners */
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.table-play-btn:hover {
    background: var(--text-primary);
    color: var(--bg-primary);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.table-play-btn svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

/* 4. Input Fields (Search/Prompt) Harmonization */
input[type="text"],
textarea {
    background: #0f1114 !important;
    /* Darker clean surface */
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 8px !important;
    color: var(--text-primary) !important;
    font-size: 13px !important;
    padding: 10px 16px !important;
    transition: all 0.2s;
}

input[type="text"]:focus,
textarea:focus {
    border-color: rgba(255, 255, 255, 0.3) !important;
    outline: none;
    background: #14161a !important;
}

/* 5. Tooltip/Badge Micro-interactions */
.classification-badge {
    transition: transform 0.2s;
}

.chart-bar:hover .classification-badge {
    transform: scale(1.05);
}

/* 6. Clean up Training Panel Header */
#trainingSongBadge {
    display: none !important;
}

/* FIXES PART 12: Premium Console & Progress View */
#testProgressView {
    padding: 24px 8px;
    /* Restored vertical breathing room */
}

/* 1. Header Polish */
.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.progress-suite-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.progress-eta {
    font-size: 11px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 8px;
    border-radius: 99px;
    color: var(--text-muted);
}

/* 2. Sleek Progress Bar */
.progress-bar-track {
    height: 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 16px;
}

.progress-bar-fill {
    background: linear-gradient(90deg, #8b5cf6, #06b6d4);
    height: 100%;
    transition: width 0.3s ease;
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.3);
}

/* 3. Status Text */
.progress-status {
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 4px;
    font-family: 'Inter', sans-serif;
}

.progress-details {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* 4. Premium Console Log */
.progress-log {
    background: #0b0c0e !important;
    /* Deepest black */
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px;
    height: 240px;
    overflow-y: auto;
    font-family: 'JetBrains Mono', monospace;
}

.progress-log-entry {
    font-size: 11px;
    margin-bottom: 6px;
    line-height: 1.5;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    padding-bottom: 2px;
}

.progress-log-entry:last-child {
    border-bottom: none;
}

.progress-log-entry .timestamp {
    color: #4a4a5a;
    font-weight: 500;
    margin-right: 8px;
    user-select: none;
}

.progress-log-entry .log-txt {
    color: #a0a0a0;
}

.progress-log-entry.error .log-txt {
    color: #ef4444;
}

.progress-log-entry.success .log-txt {
    color: #10b981;
}

/* Scrollbar handle for log */
.progress-log::-webkit-scrollbar {
    width: 6px;
}

.progress-log::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}