/* Theme Variables */
:root {
    /* Dark theme (default) */
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-tertiary: #0f3460;
    --text-primary: #eee;
    --text-secondary: #888;
    --text-tertiary: #666;
    --accent-primary: #e94560;
    --accent-hover: #d63750;
    --border-color: #333;
    --border-hover: #444;
    --error-bg: #3d1f2b;
    --error-text: #ff6b8a;
}

/* Light theme */
.light-theme {
    --bg-primary: #f5f5f5;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e8e8e8;
    --text-primary: #1a1a1a;
    --text-secondary: #666;
    --text-tertiary: #999;
    --accent-primary: #e94560;
    --accent-hover: #d63750;
    --border-color: #ddd;
    --border-hover: #ccc;
    --error-bg: #ffe8ec;
    --error-text: #c92a2a;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 1rem;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 0.5rem;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

header > div {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

header h1 {
    font-size: 2.5rem;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
}

header h1 .version {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    vertical-align: middle;
}

header p {
    color: var(--text-secondary);
}

/* Header controls container */
.header-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
}

/* Format selector */
.format-selector {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px;
}

.format-selector:hover {
    border-color: var(--accent-primary);
}

.format-selector:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.theme-toggle {
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    transition: all 0.2s;
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.theme-toggle:hover {
    border-color: var(--accent-primary);
    transform: scale(1.1);
}

.search-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.search-form input {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.search-form input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.search-form button {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    min-height: 44px;
    min-width: 44px;
}

.search-form button:hover {
    background: var(--accent-hover);
}

.status {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: none;
}

.status.info {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

.status.error {
    background: var(--error-bg);
    border: 1px solid var(--accent-primary);
    color: var(--error-text);
}

/* Tabs */
.search-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: -2px;
}

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

.tab-btn.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

/* Back to Albums button (shown when viewing album tracks) */
.back-to-albums-btn {
    display: none;
    width: 100%;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.back-to-albums-btn::before {
    content: '\2190';
    margin-right: 0.5rem;
}

.back-to-albums-btn:hover {
    border-color: var(--accent-primary);
    background: var(--bg-tertiary);
}

.results {
    display: none;
    flex-direction: column;
    gap: 0.75rem;
}

.results.active {
    display: flex;
}

.track {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    gap: 0.75rem;
}

.track:hover {
    border-color: var(--border-hover);
}

.track-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.track-cover {
    width: 80px;
    height: 80px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-tertiary);
}

.track-info {
    flex: 1;
    min-width: 0;
}

.track-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    word-break: break-word;
}

.track-artist {
    color: var(--text-secondary);
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    word-break: break-word;
}

.track-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 0.25rem;
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

.track-duration {
    color: var(--text-tertiary);
}

.track-views {
    color: var(--text-tertiary);
}

/* Track actions container */
.track-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

/* Play button */
.play-btn {
    padding: 0;
    font-size: 1.2rem;
    font-weight: 600;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    min-height: 44px;
    min-width: 44px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    text-indent: 2px;
}

.play-btn:hover:not(:disabled) {
    background: var(--accent-primary);
    color: white;
    transform: scale(1.05);
}

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

.copy-url-btn {
    padding: 0;
    font-size: 1.2rem;
    font-weight: 600;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px;
    min-width: 44px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.copy-url-btn:hover:not(:disabled) {
    background: var(--accent-primary);
    color: white;
    transform: scale(1.05);
}

.copy-url-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.download-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
    min-height: 44px;
    min-width: 100px;
    flex-shrink: 0;
}

.download-btn:hover:not(:disabled) {
    background: var(--accent-primary);
    color: white;
}

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

/* Save to Computer button variant */
.download-btn.save-btn {
    background: var(--accent-primary);
    color: white;
    animation: pulse 2s ease-in-out infinite;
}

.download-btn.save-btn:hover:not(:disabled) {
    background: var(--accent-hover);
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

/* Albums Grid */
.albums-grid {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.albums-grid.active {
    display: grid;
}

.album-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
}

.album-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.album-cover {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: var(--bg-tertiary);
}

.album-info {
    padding: 1rem;
    flex: 1;
}

.album-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.album-artist {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.album-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

.album-actions {
    padding: 0 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.view-album-btn,
.download-album-btn {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.view-album-btn {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.view-album-btn:hover:not(:disabled) {
    background: var(--accent-primary);
    color: white;
}

.download-album-btn {
    background: var(--accent-primary);
    color: white;
}

.download-album-btn:hover:not(:disabled) {
    background: var(--accent-hover);
}

.view-album-btn:disabled,
.download-album-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Responsive Design - Mobile First */

/* Very small screens (< 480px) */
@media (max-width: 480px) {
    header h1 {
        font-size: 1.75rem;
    }

    .format-selector {
        flex: 1;
    }

    .search-form {
        flex-direction: column;
    }

    .search-form button {
        width: 100%;
    }
}

/* Small screens (< 640px) */
@media (max-width: 640px) {
    .albums-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.75rem;
    }

    .track {
        padding: 0.75rem;
        flex-direction: column;
        align-items: stretch;
    }

    .track-main {
        margin-bottom: 0.75rem;
    }

    .track-cover {
        width: 60px;
        height: 60px;
    }

    .track-actions {
        width: 100%;
        flex-direction: row;
        justify-content: stretch;
    }

    .play-btn, .copy-url-btn {
        flex: 0 0 auto;
    }

    .download-btn {
        flex: 1;
        min-width: unset;
    }
}

/* Tablet (640px - 1024px) */
@media (min-width: 640px) {
    .container {
        padding: 0 1rem;
    }

    .track {
        padding: 1.25rem;
    }

    header h1 {
        font-size: 2.5rem;
    }
}

/* Desktop (> 1024px) */
@media (min-width: 1024px) {
    body {
        padding: 2rem;
    }
}

/* Desktop - single line for cleaner look */
@media (min-width: 1024px) {
    .track-title,
    .track-artist {
        white-space: nowrap;
        text-overflow: ellipsis;
        -webkit-line-clamp: 1;
    }
}

/* GitHub Star Button */
.github-star {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
    border: 2px solid var(--border-color);
    min-height: 44px;
}

.github-star:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
    transform: scale(1.05);
}

/* Queue Section */
.queue-section {
    margin: 2rem 0;
    display: none;
}

.queue-section.show {
    display: block;
}

.queue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.queue-header h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
}

.clear-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 36px;
}

.clear-btn:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.queue-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.queue-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Job Cards */
.job-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    transition: border-color 0.3s;
}

.job-card.queued {
    border-color: #3498db;
}

.job-card.downloading {
    border-color: #f39c12;
}

.job-card.completed {
    border-color: #2ecc71;
}

.job-card.failed {
    border-color: #e74c3c;
}

.job-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
    gap: 1rem;
}

.job-info {
    flex: 1;
    min-width: 0;
}

.job-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.job-artist {
    color: var(--text-secondary);
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.job-status {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}

.status-queued {
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
}

.status-downloading {
    background: rgba(243, 156, 18, 0.2);
    color: #f39c12;
}

.status-completed {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}

.status-failed {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

/* Progress Bar */
.progress-bar {
    height: 32px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    margin: 0.75rem 0;
    position: relative;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-hover));
    transition: width 0.3s ease;
    border-radius: 6px;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
    white-space: nowrap;
    z-index: 1;
}

/* Job Error */
.job-error {
    background: var(--error-bg);
    color: var(--error-text);
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    margin: 0.5rem 0;
    word-break: break-word;
}

/* Job Actions */
.download-file-btn,
.clear-job-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 0.5rem;
    margin-right: 0.5rem;
    border: none;
    min-height: 36px;
}

.download-file-btn {
    background: var(--accent-primary);
    color: white;
    text-decoration: none;
    display: inline-block;
}

.download-file-btn:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
}

.clear-job-btn {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.clear-job-btn:hover {
    background: var(--accent-primary);
    color: white;
}

/* Mobile Queue Adjustments */
@media (max-width: 640px) {
    .queue-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .queue-header h2 {
        font-size: 1.25rem;
    }

    .clear-btn {
        width: 100%;
    }

    .job-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .job-status {
        align-self: flex-start;
    }

    .progress-text {
        font-size: 0.75rem;
    }

    .download-file-btn,
    .clear-job-btn {
        width: 100%;
        margin-right: 0;
        margin-bottom: 0.25rem;
    }
}

/* Settings button - matches theme toggle style */
.icon-btn {
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    transition: all 0.2s;
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    border-color: var(--accent-primary);
    transform: scale(1.1);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

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

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

/* Settings */
.settings-section {
    margin-bottom: 2rem;
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-section h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
}

.settings-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.settings-description a {
    color: var(--accent-primary);
    text-decoration: none;
}

.settings-description a:hover {
    text-decoration: underline;
}

.cookie-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-indicator.status-success {
    background: #22c55e;
}

.status-indicator.status-warning {
    background: #f59e0b;
}

.status-indicator.status-error {
    background: #ef4444;
}

.status-indicator.status-none {
    background: var(--text-tertiary);
}

.status-text {
    font-size: 0.95rem;
}

.cookie-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
}

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

/* --- Explore Tab --- */

.explore-section {
    display: none;
}
.explore-section.active {
    display: block;
}

.explore-loading, .explore-error {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}
.explore-error {
    color: var(--error-text);
}

/* Section headers */
.explore-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.explore-section-header h2 {
    margin: 0;
    font-size: 1.25rem;
}
.explore-section-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Country selector */
.country-selector {
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.85rem;
}

/* Download All button */
.download-all-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
    min-height: 44px;
    min-width: 100px;
}
.download-all-btn:hover:not(:disabled) {
    background: var(--accent-primary);
    color: white;
}
.download-all-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Charts section */
.explore-charts-section {
    margin-bottom: 2rem;
}
.explore-charts-empty {
    padding: 1.5rem;
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
}
.chart-tracks-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.chart-track {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    background: var(--bg-secondary);
}
.chart-track:hover {
    background: var(--bg-hover, var(--bg-secondary));
}
.chart-rank {
    font-size: 1rem;
    font-weight: 700;
    min-width: 2rem;
    text-align: center;
    color: var(--text-secondary);
}
.chart-thumb {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}
.chart-track-info {
    flex: 1;
    min-width: 0;
}
.chart-track-title {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chart-track-artist {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chart-track-meta {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-top: 0.1rem;
}
.chart-trend {
    font-size: 0.85rem;
    min-width: 1.5rem;
    text-align: center;
}
.chart-trend.trend-up { color: #22c55e; }
.chart-trend.trend-down { color: #ef4444; }
.chart-trend.trend-neutral { color: var(--text-secondary); }
.chart-track-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.4rem;
    align-items: center;
    flex-shrink: 0;
}
.chart-track-actions .play-btn,
.chart-track-actions .copy-url-btn {
    min-height: 32px;
    min-width: 32px;
    max-height: 32px;
    max-width: 32px;
    font-size: 0.9rem;
    padding: 0;
}
.chart-track-actions .download-btn {
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
    min-height: 32px;
    min-width: unset;
}

/* Cron config button */
.cron-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    min-height: 44px;
}
.cron-btn:hover:not(:disabled) {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}
.cron-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.cron-btn.cron-copied {
    background: #22c55e;
    color: white;
    border-color: #22c55e;
}
/* Inline variant for breadcrumb rows */
.cron-btn-inline {
    margin-left: auto;
    padding: 0.3rem 0.75rem;
    font-size: 0.85rem;
    min-height: 32px;
}

/* Moods & Genres section */
.explore-moods-section {
    margin-top: 1.5rem;
}
.mood-section {
    margin-bottom: 1.5rem;
}
.mood-section h2 {
    font-size: 1.15rem;
    margin: 0 0 0.75rem 0;
}
.mood-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.5rem;
}
.mood-category-card {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    text-align: center;
    font-size: 0.9rem;
    transition: background 0.15s, border-color 0.15s;
}
.mood-category-card:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
}

/* Mood playlists grid */
.mood-playlists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}
.mood-playlist-card {
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    overflow: hidden;
}
.mood-playlist-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}
.mood-playlist-info {
    padding: 0.75rem;
}
.mood-playlist-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
}
.mood-playlist-author {
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.mood-playlist-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0 0.75rem 0.75rem;
}
.mood-playlist-actions button {
    flex: 1;
    padding: 0.4rem 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.8rem;
}
.mood-playlist-actions button:hover {
    border-color: var(--accent-primary);
}
.mood-playlist-actions .download-playlist-btn {
    background: var(--accent-primary);
    color: #fff;
    border-color: var(--accent-primary);
}

/* Breadcrumb navigation */
.explore-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
.breadcrumb-link {
    background: none;
    border: none;
    color: var(--accent-primary);
    cursor: pointer;
    padding: 0;
    font-size: inherit;
}
.breadcrumb-link:hover {
    text-decoration: underline;
}
.breadcrumb-sep {
    color: var(--text-secondary);
}
.breadcrumb-current {
    color: var(--text-primary);
    font-weight: 500;
}

/* Playlist tracks header */
.explore-playlist-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.explore-playlist-header h2 {
    margin: 0;
    font-size: 1.25rem;
}
.explore-track-count {
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.explore-tracks-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Responsive */
@media (max-width: 600px) {
    .mood-categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    .mood-playlists-grid {
        grid-template-columns: 1fr;
    }
    .explore-section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .chart-track {
        padding: 0.4rem 0.5rem;
    }
}
