:root {
    --primary-dark: #0a0e27;
    --secondary-dark: #141b2d;
    --tertiary-dark: #1e2640;
    --accent-blue: #4a90e2;
    --accent-purple: #6c5ce7;
    --accent-cyan: #00d4ff;
    --text-primary: #e8eaed;
    --text-secondary: #9aa0a6;
    --border-color: rgba(74, 144, 226, 0.2);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --border-radius: 12px;
    --border-radius-sm: 8px;
}

* {
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary-dark) 50%, #0f1419 100%);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
    color: var(--text-primary);
}

/* Canvas Styling */
#eclipseCanvas {
    height: 800px;
    width: 1100px !important;
    background: radial-gradient(circle at center, #000000 0%, #0a0a0a 100%);
    border-radius: var(--border-radius);
}

/* Card Overrides */
.card {
    background: var(--tertiary-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%) !important;
    border-bottom: none;
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
    padding: 1rem 1.5rem;
}

.card-body {
    background: var(--secondary-dark);
    color: var(--text-primary);
    padding: 1.5rem;
}

/* Button Styling */
.btn {
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border: none;
    transition: all 0.2s ease;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
    color: white;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.btn-light {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    box-shadow: 0 2px 8px rgba(71, 85, 105, 0.3);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-light:hover {
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(71, 85, 105, 0.4);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-icon {
    background: var(--secondary-dark);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    flex-shrink: 0;
}

.btn-icon:hover:not(:disabled) {
    background: var(--secondary-dark);
    border-color: var(--accent-blue);
    color: var(--accent-cyan);
    transform: translateY(-1px);
}

.btn-icon:active:not(:disabled) {
    transform: translateY(0);
}

/* Badge Styling */
.badge {
    padding: 0.5rem 0.875rem;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
}

.badge.bg-light {
    background: var(--tertiary-dark) !important;
    color: var(--accent-cyan) !important;
    border: 1px solid var(--border-color);
}

#timeInfo {
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    min-width: 7.5rem;
    justify-content: center;
}

/* Form Controls */
.form-control,
.form-control-sm {
    background: var(--secondary-dark);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--border-radius-sm);
    transition: all 0.2s ease;
}

.file-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.file-input-label {
    font-size: 0.625rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
    font-weight: 500;
}

.form-control:focus,
.form-control-sm:focus {
    background: var(--tertiary-dark);
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.15);
    color: var(--text-primary);
}

.form-check-input {
    background-color: var(--secondary-dark);
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-check-input:checked {
    background-color: var(--accent-blue);
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.15);
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.15);
}

.form-check-label {
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
}

/* Audio Player */
#audioPlayer {
    border-radius: var(--border-radius-sm);
    background: var(--secondary-dark);
    box-shadow: none;
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    width: 100%;
    height: 2.75rem;
    display: block;
}

#audioPlayer::-webkit-media-controls-panel {
    background: var(--tertiary-dark);
}

#audioPlayer::-webkit-media-controls-play-button,
#audioPlayer::-webkit-media-controls-pause-button {
    background-color: var(--accent-blue);
    border-radius: 50%;
}

#audioPlayer::-webkit-media-controls-current-time-display,
#audioPlayer::-webkit-media-controls-time-remaining-display {
    color: var(--text-primary);
}

#audioPlayer::-webkit-media-controls-timeline {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

#audioPlayer::-webkit-media-controls-timeline::-webkit-slider-thumb {
    background: white;
}

#audioPlayer::-webkit-media-controls-volume-slider {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

/* Track Info Section */
#trackInfo {
    text-align: left;
    font-size: 14px;
    line-height: 1.6;
}

#trackInfo.hidden {
    display: none !important;
}

/* Debug Info */
#debugInfo {
    background: var(--primary-dark);
    border-radius: var(--border-radius-sm);
    padding: 1rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* Debug Section */
.debug-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(74, 144, 226, 0.05);
    border-radius: var(--border-radius-sm);
    border-left: 4px solid var(--accent-blue);
    transition: all 0.2s ease;
}

.debug-section:hover {
    background: rgba(74, 144, 226, 0.08);
    border-left-color: var(--accent-cyan);
}

.debug-section h4 {
    color: var(--accent-cyan);
    margin-bottom: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Track Item */
.track-item {
    margin: 0.75rem 0;
    padding: 1rem;
    background: rgba(30, 38, 64, 0.5);
    border-left: 4px solid;
    border-radius: var(--border-radius-sm);
    transition: all 0.2s ease;
}

.track-item:hover {
    background: rgba(30, 38, 64, 0.8);
    transform: translateX(4px);
}

/* Cluster Stats */
.cluster-stats {
    margin: 0.5rem 0;
    padding: 0.75rem 1rem;
    background: rgba(74, 144, 226, 0.08);
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    border: 1px solid var(--border-color);
}

/* Custom Scrollbar */
#trackInfo::-webkit-scrollbar,
#debugInfo::-webkit-scrollbar {
    width: 10px;
}

#trackInfo::-webkit-scrollbar-track,
#debugInfo::-webkit-scrollbar-track {
    background: var(--primary-dark);
    border-radius: 5px;
}

#trackInfo::-webkit-scrollbar-thumb,
#debugInfo::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
    border-radius: 5px;
    border: 2px solid var(--primary-dark);
}

#trackInfo::-webkit-scrollbar-thumb:hover,
#debugInfo::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--accent-cyan) 0%, var(--accent-blue) 100%);
}

/* Utilities */
.text-white {
    color: var(--text-primary) !important;
}

.shadow-lg {
    box-shadow: var(--shadow-lg) !important;
}

/* Header Controls */
.header-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem 1.5rem;
    background: var(--tertiary-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

.audio-container {
    flex: 1;
    display: flex;
    align-items: center;
}

/* Container Spacing */
.container-fluid {
    padding: 1.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #eclipseCanvas {
        width: 100% !important;
        height: 500px;
    }
    
    .container-fluid {
        padding: 1rem;
    }
    
    .btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
}
