/* REK FM - Personal DJ System Styles */

/* CSS Variables */
:root {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-tertiary: #0f3460;
    --accent: #e94560;
    --accent-hover: #ff6b6b;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    --success: #4ade80;
    --warning: #fbbf24;
    --error: #ef4444;
    --border-radius: 8px;
    --transition: 0.2s ease;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

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

/* App Container */
.app-container {
    max-width: 600px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}


/* Screen States */
.screen {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.screen.hidden {
    display: none;
}

/* Auth Screen */
.auth-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    text-align: center;
}

.logo {
    margin-bottom: 3rem;
}

.logo-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 1rem;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.tagline {
    color: var(--text-secondary);
    font-size: 1rem;
}

.auth-buttons {
    width: 100%;
    max-width: 280px;
    display: flex;
    justify-content: center;
}

.signin-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.signin-form input {
    padding: 0.875rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
}

.signin-form input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(108, 92, 231, 0.2);
}

.signin-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.signin-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.signin-btn:active {
    transform: translateY(0);
}

.auth-note {
    margin-top: 2rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}


/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--bg-tertiary);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-small {
    font-size: 1.5rem;
}

.brand {
    font-weight: 700;
    font-size: 1.125rem;
    letter-spacing: 0.05em;
}

.broadcast-indicator {
    margin-left: 0.5rem;
    font-size: 1rem;
    filter: hue-rotate(90deg) saturate(2);
}

.broadcast-indicator.off {
    filter: hue-rotate(-30deg) saturate(2);
}

.dj-name-header {
    color: var(--text-primary);
    font-size: 0.875rem;
    background: #22c55e;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    margin-left: 0.5rem;
}

.dj-name-header.off {
    background: #ef4444;
}

/* Toggle button colors - green when active */
#dj-toggle-btn.active,
#caller-toggle-btn.active,
#billboard-btn.active,
#favorites-btn.active,
#shuffle-btn.active,
#repeat-btn.active,
#news-toggle-btn.active {
    background: #22c55e;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-settings {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
}
.btn-settings:hover { color: var(--text-primary); }

.settings-panel {
    position: absolute;
    top: 3.2rem;
    right: 0.5rem;
    width: 320px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    font-weight: 600;
}
.settings-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
}
.settings-nav {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.settings-nav-item {
    display: block;
    padding: 0.5rem 0.6rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: 6px;
    cursor: pointer;
    background: transparent;
    border: none;
    text-align: left;
    width: 100%;
    font-family: inherit;
}
.settings-nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}
.settings-divider {
    border-top: 1px solid var(--border-color);
    margin: 0.6rem 0;
}
.rss-config-fullpage {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg-primary);
    z-index: 200;
    display: flex;
    flex-direction: column;
}
.rss-config-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}
.rss-config-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}
.rss-back-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.95rem;
    padding: 0.3rem 0;
}
.rss-back-btn:hover { color: var(--text-primary); }
.rss-config-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem;
}
.rss-feeds-list-full {
    margin-bottom: 1rem;
}
.rss-feed-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}
.rss-feed-info {
    flex: 1;
    min-width: 0;
}
.rss-feed-name {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 0.2rem;
}
.rss-feed-url {
    font-size: 0.7rem;
    font-family: monospace;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rss-feed-remove {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.2rem;
    line-height: 1;
    flex-shrink: 0;
}
.rss-feed-remove:hover { color: var(--error); }
.rss-add-section {
    padding-top: 0.5rem;
}
.rss-feed-input-full {
    width: 100%;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    font-family: monospace;
    box-sizing: border-box;
}
.rss-feed-input-full:focus {
    outline: none;
    border-color: var(--success);
}
.settings-textarea {
    width: 100%;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.5rem;
    font-size: 0.8rem;
    font-family: monospace;
    resize: vertical;
    box-sizing: border-box;
}
.settings-hint {
    color: var(--text-muted);
    font-size: 0.7rem;
    margin: 0.3rem 0 0.5rem;
}
.btn-settings-save {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.4rem 1rem;
    cursor: pointer;
    font-size: 0.8rem;
}
.btn-settings-save:hover { background: #22c55e; }

.user-email {
    color: var(--text-secondary);
    font-size: 0.75rem;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-logout {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.375rem 0.75rem;
    border-radius: var(--border-radius);
    font-size: 0.75rem;
    cursor: pointer;
}

.btn-logout:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.25rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

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

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

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

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

.btn.transport {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    min-width: 50px;
    font-size: 1.5rem;
    line-height: 1;
}

.btn.transport:hover {
    background: var(--bg-secondary);
}

.btn.transport.primary {
    background: var(--bg-tertiary);
}

.btn.transport.primary:hover {
    background: var(--bg-secondary);
}

.btn.transport-sm {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    min-width: 40px;
    font-size: 1.1rem;
    padding: 0.5rem;
    line-height: 1;
}

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

.btn.transport-sm.active {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.caller-select {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.35rem 0.5rem;
    font-size: 0.75rem;
    cursor: pointer;
    max-width: 130px;
}
.caller-select:hover { color: var(--text-primary); }
.caller-select.has-selection { color: var(--accent-primary); border-color: var(--accent-primary); }

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition);
}

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

.btn-icon.active {
    color: #e74c3c;
}


/* Now Playing Section */
.now-playing {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 1rem;
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
}

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

.track-meta-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    text-align: right;
}

.track-album-container {
    margin: 0.25rem 0;
}

.track-year-genre {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.track-artist {
    margin: 0.25rem 0;
}

.artist-tag {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    font-size: 0.9rem;
    padding: 0.25rem 0.5rem;
}

.artist-tag:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.artist-tag.active {
    background: var(--accent) !important;
    color: var(--text-primary) !important;
    border-color: var(--accent) !important;
}

/* Active state for all track tags */
.track-tag.active {
    background: var(--accent) !important;
    color: var(--text-primary) !important;
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.3);
}

.album-art {
    width: 80px;
    height: 80px;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.album-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.album-placeholder {
    font-size: 2.5rem;
    opacity: 0.5;
}

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

.track-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.track-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.track-title-right {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.track-title-right .track-duration {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-right: 0.25rem;
}

.track-artist {
    color: var(--accent);
    font-size: 0.9375rem;
    margin: 0.25rem 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-meta {
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.track-actions {
    display: flex;
    gap: 0.25rem;
}

/* Progress Section */
.progress-section {
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
}

.progress-bar {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-tertiary);
    border-radius: 3px;
    cursor: default;
    pointer-events: none;
}

.progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: var(--accent);
    border-radius: 50%;
    cursor: default;
}

.progress-bar::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--accent);
    border-radius: 50%;
    cursor: default;
    border: none;
}

.time-display {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}


/* Playback Controls */
.active-filters {
    padding: 0.5rem 1rem;
    text-align: center;
}

.filter-bubbles {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-bubble {
    background: #dc3545;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #dc3545;
}

.filter-bubble:hover {
    background: #c82333;
    border-color: #c82333;
    transform: translateY(-1px);
}

.filter-count {
    color: #888;
    font-size: 0.85rem;
    margin-left: 0.5rem;
}

.filter-bubble-favorites {
    background: #dc3545 !important;
    color: white !important;
}

.controls {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--bg-tertiary);
}

.controls-main {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
}

.controls-secondary {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
}

/* Song Request Box */
.request-section {
    padding: 1rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.request-container {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.request-box {
    position: relative;
    flex: 1;
    max-width: 600px;
}

.btn-play-next {
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.btn-play-next:hover {
    background: #00a8e8;
    transform: translateY(-1px);
}

.btn-play-next:active {
    transform: translateY(0);
}

.btn-play-now {
    padding: 0.75rem 1.5rem;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.btn-play-now:hover {
    background: #45a049;
    transform: translateY(-1px);
}

.btn-play-now:active {
    transform: translateY(0);
}

#request-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.2s;
}

#request-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 191, 255, 0.1);
}

#request-input::placeholder {
    color: var(--text-secondary);
}

.request-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.request-results.visible {
    display: block;
}

.request-result-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s;
}

.request-result-item:last-child {
    border-bottom: none;
}

.request-result-item:hover {
    background: var(--bg-primary);
}

.request-result-title {
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.request-result-meta {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.request-no-results {
    padding: 1rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Other Users Playing */
/* Others Playing Ticker */
.others-ticker {
    background: #000;
    padding: 0.35rem 0;
    overflow: hidden;
    white-space: nowrap;
}

.news-ticker {
    background: #0a1a0a;
    padding: 0.35rem 0;
    overflow: hidden;
    white-space: nowrap;
    border-top: 1px solid #1a3a1a;
}
.news-ticker .ticker-text {
    color: var(--success);
    animation-duration: 240s;
}

.ticker-text {
    display: inline-block;
    color: #00bfff;
    font-size: 0.8rem;
    animation: ticker-scroll 20s linear infinite;
    padding-left: 100%;
}

@keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

.power-btn {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    position: relative;
}

.power-btn:hover {
    background: var(--bg-primary);
}

.power-btn.active {
    color: var(--success);
}

.power-light {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
}

.power-btn.active .power-light {
    background: var(--success);
    box-shadow: 0 0 6px var(--success);
}

.caller {
    background: var(--bg-tertiary);
}

.caller:hover {
    background: var(--warning);
    color: #000;
}

/* Filters Section */
.filters {
    padding: 0.5rem 1rem;
    background: var(--bg-primary);
}

.filter-drawer {
    margin-bottom: 0.5rem;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.875rem;
    transition: var(--transition);
}

.filter-header:hover {
    background: var(--bg-tertiary);
}

.filter-header .arrow {
    font-size: 0.625rem;
    transition: transform var(--transition);
}

.filter-drawer.open .filter-header .arrow {
    transform: rotate(180deg);
}

.filter-content {
    display: none;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    margin-top: 2px;
    max-height: 200px;
    overflow-y: auto;
}

.filter-drawer.open .filter-content {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-chip {
    padding: 0.375rem 0.75rem;
    background: var(--bg-tertiary);
    border: none;
    border-radius: 1rem;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    cursor: pointer;
    transition: var(--transition);
}

.filter-chip:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.filter-chip.active {
    background: var(--accent);
    color: var(--text-primary);
}

.filter-chip.disabled {
    opacity: 0.3;
    pointer-events: none;
}


/* Queue Section */
.queue-section {
    padding: 1rem;
    background: var(--bg-primary);
}

.queue-list {
    background: #0a0a0a;
    border-radius: var(--border-radius);
    padding: 0.75rem;
    border: 1px solid #333;
    max-height: 200px;
    overflow-y: auto;
}

.queue-item {
    color: #00bfff;
    padding: 0.5rem;
    border-bottom: 1px solid #1a1a1a;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.queue-item:last-child {
    border-bottom: none;
}

.queue-item-dj {
    opacity: 0.6;
}

.queue-item-info {
    flex: 1;
}

.queue-item-title {
    font-weight: 500;
}

.queue-item-artist {
    opacity: 0.7;
    font-size: 0.8rem;
}

.queue-item-remove {
    background: none;
    border: none;
    color: #ff4444;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    font-size: 1rem;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.queue-item-remove:hover {
    opacity: 1;
}

.queue-empty {
    color: #666;
    text-align: center;
    padding: 1rem;
    font-style: italic;
}

/* DJ Dialogue Section - Terminal Log */
.dialogue-section {
    padding: 1rem;
    background: var(--bg-primary);
}

.section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dialogue-box {
    background: #0a0a0a;
    border-radius: var(--border-radius);
    padding: 0.75rem;
    min-height: 400px;
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid #333;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
}

.log-line {
    color: #00ff00;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.log-time {
    color: #666;
}

.log-entry {
    color: #00ff00;
    line-height: 1.5;
    margin-bottom: 0.25rem;
    font-family: 'Courier New', monospace;
}

.log-entry .log-time {
    color: #666;
    margin-right: 0.5rem;
}

.dialogue-placeholder {
    color: #00ff00;
    font-style: italic;
}

.dialogue-text {
    line-height: 1.8;
    color: #00ff00;
    white-space: pre-wrap;
}

.dialogue-loading {
    color: #ffff00;
    animation: blink 1s infinite;
}

@keyframes blink {
    50% { opacity: 0.5; }
}

/* Library Section */
.library-section {
    flex: 1;
    padding: 1rem;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
}

.library-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.search-box input {
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 0.875rem;
    width: 180px;
}

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

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

.library-stats {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.library-list {
    flex: 1;
    overflow-y: auto;
    min-height: 200px;
    max-height: 500px; /* Increased to show more tracks */
}

.track-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem; /* Reduced vertical padding */
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    margin-bottom: 0.35rem; /* Reduced margin */
    cursor: pointer;
    transition: var(--transition);
}

.track-item:hover {
    background: var(--bg-tertiary);
}

.track-item.playing {
    border-left: 3px solid var(--accent);
}

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

.track-item-title {
    font-size: 0.875rem; /* Slightly smaller */
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.15rem; /* Tighter spacing */
}

.track-item-artist {
    font-size: 0.75rem; /* Smaller */
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.15rem; /* Tighter spacing */
}

.track-item-tags {
    font-size: 0.7rem; /* Smaller tags */
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-item-duration {
    font-size: 0.7rem; /* Smaller */
    color: var(--text-muted);
    margin-left: 0.5rem;
    flex-shrink: 0; /* Don't shrink duration */
}

.library-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding-top: 0.75rem;
    margin-top: auto;
}

.library-pagination .btn {
    font-size: 0.875rem !important;
}

#page-info {
    font-size: 0.875rem;
    color: var(--text-secondary);
}


/* Status Bar */
.status-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--bg-tertiary);
    font-size: 0.8125rem;
}

.status-center {
    display: flex;
    justify-content: center;
}

.feedback-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.5rem 1.5rem;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
}

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

.status-indicator {
    font-size: 0.625rem;
}

.status-indicator.connected {
    color: var(--success);
}

.status-indicator.disconnected {
    color: var(--error);
}

.status-indicator.connecting {
    color: var(--warning);
    animation: pulse 1s infinite;
}

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

.status-right {
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 26, 46, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-overlay.hidden {
    display: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--bg-tertiary);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

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

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

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Responsive */
@media (max-width: 480px) {
    .header-right .user-email {
        display: none;
    }
    
    .controls {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0.75rem;
    }
    
    .controls-main {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 1rem;
        width: 100%;
    }
    
    .controls-secondary {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 0.75rem;
        width: 100%;
    }

/* Mobile Landscape */
@media (max-width: 768px) and (orientation: landscape) {
    .controls {
        flex-direction: row;
        gap: 0.5rem;
        padding: 0.5rem;
    }
    
    .controls-main {
        display: flex;
        gap: 0.75rem;
    }
    
    .controls-secondary {
        display: flex;
        gap: 0.5rem;
    }
    
    .btn {
        padding: 0.625rem 1rem;
        font-size: 1.125rem;
    }
    
    .btn.transport-sm {
        padding: 0.5rem;
    }
    
    .search-box input {
        width: 140px;
    }
    
    .now-playing {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
        gap: 0.5rem;
    }
    
    .now-playing .album-art {
        width: 140px;
        height: 140px;
        margin: 0 auto;
    }
    
    .track-info {
        text-align: center;
    }
    
    .track-title {
        font-size: 1rem;
        white-space: normal;
    }
    
    .track-title-row {
        justify-content: center;
    }
    
    .track-year-genre {
        justify-content: center;
    }
    
    .track-actions {
        justify-content: center;
    }
    
    .filters {
        padding: 0.5rem;
    }
    
    .filter-header {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
    
    .dialogue-box {
        height: 150px;
        min-height: 150px;
        max-height: 200px;
    }
    
    .library-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .search-box {
        width: 100%;
    }
    
    .search-box input {
        width: 100%;
    }
}

/* Clear filters button */
.clear-filters {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.5rem;
    font-size: 0.875rem;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus States */
button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Feedback Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.modal-content {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    position: relative;
    z-index: 1001;
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.modal-content h3 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    text-align: center;
}

.modal-content select,
.modal-content textarea {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: inherit;
    box-sizing: border-box;
}

.modal-content textarea {
    resize: vertical;
    min-height: 100px;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

/* No results styling */
.no-results {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.no-results p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.clear-filters-inline {
    font-size: 1rem;
    padding: 0.5rem 1rem;
    margin: 0 auto;
}

/* Track tags */
.track-item-tags {
    margin-top: 0.25rem;
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.track-tag {
    font-size: 0.75rem;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}

.genre-tag {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-color: var(--border);
}

.genre-tag:hover {
    background: var(--bg-secondary);
}

.year-tag {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-color: var(--border);
}

.year-tag:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.album-tag {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-color: var(--border);
}

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

.artist-tag {
    background: var(--bg-secondary);
    color: var(--accent);
    border-color: var(--border);
    font-size: 0.8125rem;
}

.artist-tag:hover {
    background: var(--accent);
    color: var(--text-primary);
}

.tag-separator {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin: 0 0.25rem;
    cursor: default;
}

.track-duration {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}
