:root {
    --bg-color: #000000;
    --text-color: #ffffff;
    --accent-color: #e6c200;
    --player-bg: #111111;
    --button-hover: #333333;
    --error-color: #ff4d4d;
    --success-color: #2ecc71;
    --progress-bg: rgba(255, 255, 255, 0.2);
    --progress-fill: var(--accent-color);
    --filter-panel-bg: #121212;
    --filter-option-bg: rgba(255, 255, 255, 0.1);
    --filter-option-active: rgba(230, 194, 0, 0.3);
}

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

body {
    font-family: 'Arial', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    width: 100%;
    max-width: 600px;
    text-align: center;
    padding: 20px;
}

header {
    margin-bottom: 20px;
}

h1 {
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 10px;
}

.subtitle {
    color: #999;
    font-size: 1rem;
}

.search-filter-container {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    align-items: center;
}

#search-input {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 20px;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    outline: none;
}

#search-input:focus {
    background-color: rgba(255, 255, 255, 0.15);
}

.search-btn, .clear-btn {
    padding: 8px 15px;
    border: none;
    border-radius: 20px;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s;
}

.search-btn:hover, .clear-btn:hover {
    background-color: var(--accent-color);
    color: #000;
}

.player-container {
    background-color: var(--player-bg);
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 30px;
    position: relative;
    min-height: 250px;
}

.track-info {
    margin-bottom: 20px;
    transition: opacity 0.3s ease;
}

h2 {
    font-size: 1.8rem;
    margin-bottom: 5px;
    color: var(--accent-color);
}

h3 {
    font-size: 1.2rem;
    margin: 15px 0 10px;
    color: var(--accent-color);
    text-align: left;
}

.track-metadata {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.track-metadata span {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 0.9rem;
}

.track-description {
    margin-top: 15px;
    font-size: 0.9rem;
    color: #ccc;
    max-height: 100px;
    overflow-y: auto;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
}

/* Progress bar styles */
.progress-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 0 5px;
}

#current-time, #duration {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    width: 40px;
}

.progress-slider {
    flex: 1;
    height: 5px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--progress-bg);
    border-radius: 5px;
    outline: none;
    margin: 0 10px;
    cursor: pointer;
}

.progress-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--progress-fill);
    cursor: pointer;
}

.progress-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--progress-fill);
    cursor: pointer;
    border: none;
}

.progress-slider:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.controls {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    gap: 15px;
}

button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color);
    transition: all 0.3s ease;
}

button:hover:not(:disabled) {
    color: var(--accent-color);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.play-btn, .nav-btn, .share-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-btn:hover:not(:disabled),
.nav-btn:hover:not(:disabled),
.share-btn:hover:not(:disabled) {
    background-color: var(--button-hover);
}

.filter-btn {
    width: auto;
    padding: 8px 15px;
    border-radius: 20px;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--accent-color);
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.filter-btn:hover:not(:disabled),
.filter-btn.active {
    background-color: var(--accent-color);
    color: #000;
}

/* Filter indicator */
.filter-indicator {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--accent-color);
    display: none;
}

.filter-btn.has-filters .filter-indicator {
    display: block;
}

.share-btn:active, .filter-btn:active {
    transform: scale(0.95);
}

/* Share button: styled like the search/clear buttons, with just the label colored */
.share-btn {
    width: auto;
    padding: 8px 15px;
    border-radius: 20px;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--accent-color);
    white-space: nowrap;
}

.share-btn:hover:not(:disabled) {
    background-color: var(--accent-color);
    color: #000;
}

/* Filter panel styles */
.filter-panel {
    background-color: var(--filter-panel-bg);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    text-align: left;
    display: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.filter-panel.active {
    display: block;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.filter-option {
    background-color: var(--filter-option-bg);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-option:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.filter-option.active {
    background-color: var(--filter-option-active);
    color: var(--accent-color);
}

.filter-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.btn {
    padding: 8px 15px;
    border-radius: 20px;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s;
}

.btn:hover {
    background-color: var(--accent-color);
    color: #000;
}

/* Year input fields styling */
.year-inputs-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 15px 0;
    width: 100%;
}

.year-input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    min-width: 120px;
}

.year-input-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.year-input {
    padding: 8px 10px;
    border: none;
    border-radius: 5px;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--accent-color);
    font-size: 0.9rem;
    font-weight: bold;
    width: 100%;
}

.year-input:focus {
    background-color: rgba(255, 255, 255, 0.15);
    outline: 1px solid var(--accent-color);
}

/* Hide spinner buttons on number inputs */
.year-input::-webkit-inner-spin-button, 
.year-input::-webkit-outer-spin-button { 
    -webkit-appearance: none; 
    margin: 0; 
}

.year-input {
    -moz-appearance: textfield; /* Firefox */
}

/* Clear dropdown */
.clear-dropdown {
    position: absolute;
    background-color: var(--filter-panel-bg);
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    z-index: 100;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 150px;
}

.clear-option {
    padding: 10px 15px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.clear-option:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--accent-color);
}

footer {
    color: #666;
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.contact a {
    color: var(--accent-color);
    text-decoration: none;
}

.contact a:hover {
    text-decoration: underline;
}

/* Loading indicator */
.loading-indicator {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    z-index: 10;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--accent-color);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error and success messages */
.audio-error, .error-message {
    background-color: rgba(255, 77, 77, 0.2);
    color: var(--error-color);
    padding: 10px;
    border-radius: 5px;
    margin-top: 15px;
    font-size: 0.9rem;
}

.success-message, .share-success {
    background-color: rgba(46, 204, 113, 0.2);
    color: var(--success-color);
    padding: 10px;
    border-radius: 5px;
    margin-top: 15px;
    font-size: 0.9rem;
    position: absolute;
    bottom: 20px;
    left: 30px;
    right: 30px;
    text-align: center;
    animation: fadeInOut 3s forwards;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(10px); }
    10% { opacity: 1; transform: translateY(0); }
    80% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-10px); }
}

/* Debug panel for development */
.debug-panel {
    background-color: rgba(0, 0, 0, 0.7);
    color: #ccc;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px;
    font-family: monospace;
    font-size: 12px;
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

/* Show debug panel when debug mode is active */
body.debug-mode .debug-panel {
    display: block;
}

/* Search results dropdown */
.search-results {
    position: absolute;
    top: 110px;
    left: 20px;
    right: 20px;
    background-color: var(--player-bg);
    border-radius: 5px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: none;
}

.search-results.active {
    display: block;
}

.search-result-item {
    padding: 10px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    text-align: left;
}

.search-result-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.search-result-item .result-title {
    font-weight: bold;
    color: var(--accent-color);
}

.search-result-item .result-ensemble {
    font-size: 0.9rem;
    color: #ccc;
}

.search-result-item .result-meta {
    font-size: 0.8rem;
    color: #888;
    margin-top: 5px;
}

/* Filter animation */
.filter-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    margin-bottom: 0;
}

.filter-panel.active {
    max-height: 500px;
    margin-bottom: 30px;
}

/* Filter indicator pulse animation */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.filter-indicator {
    animation: pulse 1.5s infinite;
}

/* Media queries for responsiveness */
@media (max-width: 600px) {
    .container {
        padding: 10px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .search-filter-container {
        flex-wrap: wrap;
    }
    
    #search-input {
        flex-basis: calc(100% - 110px);
    }
    
    .filter-btn {
        order: -1;
    }
    
    .search-btn, .clear-btn {
        flex-basis: calc(50% - 15px);
    }
    
    .controls {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    .progress-container {
        margin-bottom: 15px;
    }
    
    .year-inputs-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .year-input-group {
        width: 100%;
    }
    
    .filter-options {
        gap: 5px;
    }
    
    .filter-option {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
}
