/* CarTalk-AMP - Modern Retro Winamp Style */

:root {
    --bg-dark: #0a0a0f;
    --bg-main: #1a1a24;
    --bg-panel: #12121a;
    --bg-input: #0d0d12;
    --border-dark: #2a2a3a;
    --border-light: #3a3a4a;
    --accent: #00ff88;
    --accent-dim: #00aa5a;
    --accent-glow: rgba(0, 255, 136, 0.3);
    --text-primary: #e0e0e0;
    --text-secondary: #888;
    --text-muted: #555;
    --lcd-bg: #001408;
    --lcd-text: #00ff88;
    --orange: #ff8800;
    --red: #ff4455;
    --yellow: #ffcc00;
}

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

body {
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    background: linear-gradient(180deg, #0a0a12 0%, #12121f 50%, #0a0a12 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 30px 20px;
    color: var(--text-primary);
}

/* Main Container */
.winamp-container {
    width: 100%;
    max-width: 480px;
    background: linear-gradient(180deg, #2a2a3a 0%, #1a1a24 3%, #1a1a24 97%, #0a0a12 100%);
    border-radius: 12px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.8),
        0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    overflow: hidden;
    border: 1px solid var(--border-dark);
}

/* Title Bar */
.title-bar {
    background: linear-gradient(180deg, #3a3a4a 0%, #2a2a3a 50%, #1a1a24 100%);
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-dark);
}

.title-bar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.winamp-dots {
    display: flex;
    gap: 4px;
}

.winamp-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 6px var(--accent);
}

.winamp-dots span:nth-child(2) { background: var(--yellow); box-shadow: 0 0 6px var(--yellow); }
.winamp-dots span:nth-child(3) { background: var(--red); box-shadow: 0 0 6px var(--red); }

.title-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 3px;
}

.title-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.episode-count {
    font-size: 10px;
    color: var(--accent);
    background: var(--bg-input);
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid var(--border-dark);
}

.window-controls {
    display: flex;
    gap: 4px;
}

.win-btn {
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 4px;
    background: var(--bg-panel);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.win-btn:hover {
    background: var(--border-light);
}

.win-btn.close:hover {
    background: var(--red);
    color: white;
}

/* Player Display */
.player-display {
    background: var(--bg-panel);
    margin: 12px;
    border-radius: 8px;
    display: flex;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border-dark);
}

.display-left {
    flex: 0 0 140px;
}

.album-art {
    position: relative;
    width: 140px;
    height: 140px;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid var(--border-dark);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.album-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.album-art:hover img {
    transform: scale(1.05);
}

.image-nav {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.album-art:hover .image-nav {
    opacity: 1;
}

.img-btn {
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: var(--text-primary);
    font-size: 10px;
    cursor: pointer;
    transition: all 0.15s;
    backdrop-filter: blur(4px);
}

.img-btn:hover, .img-btn.active {
    background: var(--accent);
    color: var(--bg-dark);
}

.display-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* LCD Screen */
.lcd-screen {
    background: var(--lcd-bg);
    border-radius: 4px;
    padding: 8px 10px;
    border: 1px solid #003311;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5);
}

.bitrate-info {
    display: flex;
    gap: 8px;
    font-size: 10px;
    color: var(--accent-dim);
    margin-bottom: 6px;
}

.bitrate {
    font-weight: bold;
    color: var(--lcd-text);
}

.stereo {
    margin-left: auto;
}

.spectrum-visualizer {
    height: 32px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2px;
}

.spectrum-bar {
    flex: 1;
    background: linear-gradient(to top, 
        var(--accent) 0%, 
        var(--accent) 60%, 
        var(--yellow) 80%, 
        var(--orange) 95%,
        var(--red) 100%);
    border-radius: 1px;
    transition: height 0.08s ease-out;
    min-height: 2px;
}

/* Track Display */
.track-display {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.track-title-wrapper {
    overflow: hidden;
    margin-bottom: 4px;
}

.track-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 11px;
    font-weight: 400;
    color: var(--lcd-text);
    text-shadow: 0 0 8px var(--accent-glow);
    white-space: nowrap;
    letter-spacing: 0.5px;
}

.track-title.scrolling {
    animation: scroll-text 12s linear infinite;
}

@keyframes scroll-text {
    0%, 10% { transform: translateX(0); }
    90%, 100% { transform: translateX(-50%); }
}

.time-display {
    font-family: 'Orbitron', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--lcd-text);
    text-shadow: 0 0 12px var(--accent-glow);
    letter-spacing: 2px;
}

.time-separator {
    color: var(--accent-dim);
    margin: 0 4px;
}

.time-total {
    color: var(--accent-dim);
    font-size: 14px;
}

/* Position Bar */
.position-bar {
    padding: 10px 0 6px 0;
    margin-top: 4px;
}

.position-track {
    position: relative;
    width: 100%;
    height: 16px;
    background: linear-gradient(180deg, #151520 0%, #252538 100%);
    border-radius: 8px;
    border: 1px solid #0a0a0f;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.8), 0 1px 0 rgba(255,255,255,0.05);
    overflow: visible;
}

.position-fill {
    position: absolute;
    top: 3px;
    left: 3px;
    height: 10px;
    width: 0%;
    background: linear-gradient(180deg, #5eff5e 0%, var(--accent) 50%, #009900 100%);
    border-radius: 5px;
    box-shadow: 0 0 6px var(--accent);
    transition: width 0.1s ease;
    pointer-events: none;
    z-index: 1;
}

.position-slider {
    width: 100%;
    height: 16px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
    margin: 0;
    position: relative;
    z-index: 2;
}

.position-slider::-webkit-slider-runnable-track {
    height: 14px;
    background: transparent;
    border-radius: 7px;
    cursor: pointer;
}

.position-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: linear-gradient(180deg, #7fff7f 0%, var(--accent) 40%, #009900 100%);
    border: 2px solid #003300;
    border-radius: 50%;
    margin-top: -2px;
    box-shadow: 0 0 10px var(--accent), 0 2px 4px rgba(0, 0, 0, 0.6);
    cursor: pointer;
    transition: transform 0.1s ease;
}

.position-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    background: linear-gradient(180deg, #aaffaa 0%, #5eff5e 40%, #00bb00 100%);
    box-shadow: 0 0 14px var(--accent), 0 2px 6px rgba(0, 0, 0, 0.6);
}

.position-slider::-webkit-slider-thumb:active {
    transform: scale(0.95);
}

/* Firefox support */
.position-slider::-moz-range-track {
    height: 14px;
    background: transparent;
    border-radius: 7px;
    cursor: pointer;
}

.position-slider::-moz-range-progress {
    height: 10px;
    background: linear-gradient(180deg, #5eff5e 0%, var(--accent) 50%, #009900 100%);
    border-radius: 5px;
    margin: 2px;
}

.position-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: linear-gradient(180deg, #7fff7f 0%, var(--accent) 40%, #009900 100%);
    border: 2px solid #003300;
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent), 0 2px 4px rgba(0, 0, 0, 0.6);
    cursor: pointer;
}

/* Transport Controls */
.controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(180deg, var(--bg-panel) 0%, var(--bg-main) 100%);
    border-top: 1px solid var(--border-dark);
    border-bottom: 1px solid var(--border-dark);
}

.transport-controls {
    display: flex;
    gap: 6px;
}

.transport-btn {
    width: 38px;
    height: 32px;
    border: none;
    background: linear-gradient(180deg, #3a3a4a 0%, #2a2a3a 100%);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.transport-btn svg {
    width: 16px;
    height: 16px;
    fill: var(--text-secondary);
    transition: fill 0.15s;
}

.transport-btn:hover {
    background: linear-gradient(180deg, #4a4a5a 0%, #3a3a4a 100%);
}

.transport-btn:hover svg {
    fill: var(--text-primary);
}

.transport-btn:active {
    transform: scale(0.95);
}

.transport-btn.play-btn {
    width: 44px;
    background: linear-gradient(180deg, var(--accent-dim) 0%, #006644 100%);
}

.transport-btn.play-btn svg {
    fill: white;
}

.transport-btn.play-btn:hover {
    background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dim) 100%);
}

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

.mode-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-input);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.mode-btn svg {
    width: 18px;
    height: 18px;
    fill: var(--text-muted);
}

.mode-btn:hover {
    background: var(--border-dark);
}

.mode-btn:hover svg {
    fill: var(--accent);
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.volume-icon {
    width: 18px;
    height: 18px;
    fill: var(--text-muted);
}

.volume-slider {
    width: 70px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-input);
    border-radius: 2px;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 6px var(--accent-glow);
}

/* Search Section */
.search-section {
    padding: 12px 16px;
    background: var(--bg-main);
}

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

.search-icon {
    position: absolute;
    left: 12px;
    width: 18px;
    height: 18px;
    fill: var(--text-muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 10px 12px 10px 40px;
    font-size: 13px;
    font-family: inherit;
    background: var(--bg-input);
    border: 1px solid var(--border-dark);
    border-radius: 6px;
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-input:focus {
    border-color: var(--accent-dim);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Playlist Section */
.playlist-section {
    background: var(--bg-dark);
}

.playlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border-dark);
}

.playlist-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 2px;
}

.playlist-count {
    font-size: 10px;
    color: var(--text-muted);
}

.episode-list {
    max-height: 350px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-dim) var(--bg-dark);
}

.episode-list::-webkit-scrollbar {
    width: 8px;
}

.episode-list::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

.episode-list::-webkit-scrollbar-thumb {
    background: var(--border-dark);
    border-radius: 4px;
}

.episode-list::-webkit-scrollbar-thumb:hover {
    background: var(--accent-dim);
}

.search-results-header {
    padding: 10px 16px;
    background: rgba(0, 255, 136, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-dark);
}

.result-count {
    font-size: 11px;
    color: var(--accent);
}

.clear-search {
    font-size: 11px;
    color: var(--red);
    text-decoration: none;
    padding: 4px 12px;
    border-radius: 4px;
    transition: all 0.15s;
    background: transparent;
    border: 1px solid var(--red);
    cursor: pointer;
    font-family: inherit;
}

.clear-search:hover {
    background: var(--red);
    color: white;
}

.episode-items {
    list-style: none;
}

.episode-item {
    padding: 10px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: all 0.15s;
}

.episode-item:hover {
    background: rgba(0, 255, 136, 0.03);
}

/* Summary shown via button click, not hover - works on mobile too */

.episode-item.playing {
    background: linear-gradient(90deg, rgba(0, 255, 136, 0.08) 0%, transparent 100%);
}

.episode-item.playing .episode-title {
    color: var(--accent);
}

.episode-item.no-results {
    color: var(--text-muted);
    text-align: center;
    padding: 40px 20px;
    cursor: default;
    font-size: 13px;
}

.episode-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.episode-number {
    font-size: 10px;
    color: var(--text-muted);
    background: var(--bg-panel);
    padding: 3px 8px;
    border-radius: 4px;
    min-width: 45px;
    text-align: center;
    flex-shrink: 0;
}

.episode-title {
    flex: 1;
    color: var(--text-primary);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.episode-duration {
    font-size: 11px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.info-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
    padding: 0;
}

.info-btn svg {
    width: 18px;
    height: 18px;
    fill: var(--text-muted);
    transition: fill 0.15s;
}

.info-btn:hover {
    background: var(--bg-panel);
}

.info-btn:hover svg,
.info-btn.active svg {
    fill: var(--accent);
}

.info-btn.active {
    background: rgba(0, 255, 136, 0.1);
}

.episode-summary {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.6;
    background: var(--bg-input);
    border-radius: 4px;
    border-left: 2px solid var(--accent-dim);
    transition: all 0.25s ease;
    padding: 0;
    margin-top: 0;
}

.episode-summary.show {
    max-height: 200px;
    opacity: 1;
    padding: 10px 12px;
    margin-top: 10px;
}

.pagination {
    padding: 16px;
    text-align: center;
}

.load-more-btn {
    background: linear-gradient(180deg, var(--bg-panel) 0%, var(--bg-dark) 100%);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    padding: 14px 40px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    transition: all 0.2s;
    width: 100%;
    max-width: 300px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.load-more-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
}

.load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.load-more-btn .page-info {
    font-size: 11px;
    color: var(--text-muted);
}

/* Footer */
.player-footer {
    height: 8px;
    background: linear-gradient(180deg, var(--bg-dark) 0%, #050508 100%);
    display: flex;
    justify-content: center;
    align-items: center;
}

.footer-grip {
    width: 40px;
    height: 3px;
    background: var(--border-dark);
    border-radius: 2px;
}

/* Responsive */
@media (max-width: 520px) {
    body {
        padding: 10px;
    }
    
    .winamp-container {
        max-width: 100%;
    }
    
    .player-display {
        flex-direction: column;
        align-items: center;
    }
    
    .display-left {
        flex: none;
    }
    
    .display-right {
        width: 100%;
    }
    
    .controls {
        flex-direction: column;
        gap: 12px;
    }
    
    .secondary-controls {
        width: 100%;
        justify-content: center;
    }
}
