/* ============================================
   CSS VARIABLES - DARK MODE
   ============================================ */
:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #1E1E1E;
    --bg-tertiary: #383838;
    --bg-elevated: #4a4a4a;
    --text-primary: #ffffff;
    --text-secondary: #d0d0d0;  /* Improved contrast from #c0c0c0 */
    --text-muted: #9a9a9a;      /* Improved contrast from #808080 */
    --accent: #e91e8c;
    --accent-hover: #ff2d9d;
    --accent-glow: rgba(233, 30, 140, 0.3);
    --border: #555555;
    --success: #1db954;
    --apple-music-color: #fc3c44;
    --spotify-color: #1DB954;
    --deezer-color: #FF6600;
    --delete-color: #dc3545;
    --gold: #f5c518;
    --gold-bg: rgba(245, 197, 24, 0.12);
    --silver: #b4b8c4;
    --silver-bg: rgba(180, 184, 196, 0.10);
    --bronze: #cd7f32;
    --bronze-bg: rgba(205, 127, 50, 0.10);
    --focus-ring: rgba(233, 30, 140, 0.6);
}

/* ============================================
   BASE STYLES
   ============================================ */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ============================================
   GLOBAL FOCUS STYLES (Accessibility)
   ============================================ */
*:focus {
    outline: none;
}

*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px var(--focus-ring);
}

/* Skip to main content link for keyboard users */
.skip-link {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    z-index: 10000;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 10px;
}

/* ============================================
   APP LAYOUT
   ============================================ */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    width: 280px;
    background-color: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
}

.logo {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent), #ff6b35);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.nav-section {
    padding: 0 12px;
    margin-bottom: 16px;
}

/* Sidebar section headers for clear grouping */
.sidebar-section-header {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-secondary);  /* Improved from --text-muted for better contrast */
    padding: 8px 16px 6px;
    margin: 0;
}

/* Sidebar divider - consistent pattern */
.sidebar-divider {
    height: 1px;
    background: var(--border);
    margin: 12px 16px 4px;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 8px 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
    text-decoration: none;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    font-size: 14px;
    font-weight: 500;
    position: relative;
}

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

.nav-item.active {
    background-color: var(--bg-elevated);
    color: var(--text-primary);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background-color: var(--accent);
    border-radius: 0 2px 2px 0;
}

.nav-item i:first-child {
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

/* Icon combo for sparkles + music note - sidebar */
.nav-item .icon-combo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    flex-shrink: 0;
}

.nav-item .icon-combo i:first-child {
    font-size: 11px;
}

.nav-item .icon-combo i:last-child {
    font-size: 7px;
    margin-left: -2px;
}

.nav-item span:not(.nav-badge) {
    flex: 1;
    white-space: nowrap;
}

.nav-badge {
    background-color: var(--accent);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: auto;
    min-width: 20px;
    text-align: center;
}

.pin-icon {
    font-size: 12px;
    opacity: 0.4;
    transform: rotate(45deg);
    transition: all 0.3s;
    margin-left: 8px;
    cursor: pointer;
    padding: 4px;
    z-index: 2;
    position: relative;
}

.pin-icon:hover {
    opacity: 0.8;
    color: var(--accent);
}

.pin-icon.active,
.pin-icon.pinned {
    color: var(--accent);
    opacity: 1;
    transform: rotate(0deg);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    margin: 0 12px 24px 12px;
    background-color: var(--bg-tertiary);
    border-radius: 12px;
}

/* Credits hint in sidebar */
.credits-hint {
    margin: 16px 16px 0;
    padding: 12px 14px;
    background-color: rgba(255, 46, 157, 0.08);
    border: 1px solid rgba(255, 46, 157, 0.15);
    border-radius: 10px;
}

.credits-hint__title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.credits-hint__title span {
    color: var(--accent);
    font-weight: 700;
}

.credits-hint__reset {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 400;
    margin-left: auto;
}

.credits-hint__text {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.credits-hint__icons {
    color: var(--accent);
    font-size: 11px;
}

.credits-hint__icons .fa-music {
    font-size: 0.8em;
    margin-left: 1px;
}

.credits-hint--empty {
    background-color: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

.credits-hint--empty .credits-hint__title {
    color: var(--text-muted);
}

.credits-hint--empty .credits-hint__title span {
    color: var(--text-muted);
}

/* Song Discovery tooltip on the button itself */
.song-discovery-tooltip {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 16px;
    width: 220px;
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    pointer-events: none;
}

.song-discovery-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: var(--border);
}

#whatsPlayingButton:hover .song-discovery-tooltip,
#whatsPlayingButton:focus-visible .song-discovery-tooltip {
    opacity: 1;
    visibility: visible;
}

.song-discovery-tooltip__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.song-discovery-tooltip__text {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 8px;
}

.song-discovery-tooltip__credits {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
}

/* Activity feed in sidebar - compact to reduce vertical space */
.activity-feed {
    margin: 0 16px;
    padding: 8px 0;
    min-height: 32px;
    display: flex;
    align-items: center;
}

.activity-feed__message {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.activity-feed__message.visible {
    opacity: 1;
}

.activity-feed__icon {
    font-size: 11px;
    flex-shrink: 0;
    line-height: 1.4;
    color: var(--accent);
}

.activity-feed__text {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
}

.activity-feed__text strong {
    color: var(--text-primary);
    font-weight: 600;
}

.activity-feed__text .activity-station {
    color: var(--accent);
}

.sidebar-spacer {
    flex: 1;
}

/* Sidebar footer section */
.sidebar-footer-section {
    padding-bottom: 12px;
}

/* Help links - smaller and more compact */
.help-links .nav-item {
    font-size: 0.8rem;
    padding: 6px 12px;
    gap: 8px;
}

.help-links .nav-item i:first-child {
    width: 16px;
    font-size: 0.75rem;
}

/* Sidebar social links */
.sidebar-social {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-top: 1px solid var(--border);
    margin: 0 12px 12px 12px;
}

.sidebar-social .social-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 16px;
    border-radius: 6px;
}

.sidebar-social .social-icon:hover {
    color: var(--accent);
    background-color: var(--bg-tertiary);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-left: 280px;
    height: 100vh;
    overflow: hidden;
}

.user-avatar {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1;
}

.user-stats {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-rank {
    font-size: 10px;
    color: var(--accent);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   CONTENT AREA
   ============================================ */
.content-area {
    flex: 1;
    display: flex;
    gap: 24px;
    padding: 32px;
    overflow: hidden;
    height: 100vh;
}

/* ============================================
   NOW PLAYING SECTION
   ============================================ */
.now-playing {
    width: 380px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    align-self: flex-start;
    max-height: 100vh;
    overflow-y: auto;
}

.player-card {
    background-color: var(--bg-secondary);
    border-radius: 16px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    /* Fixed height to prevent layout shift */
    height: 680px;
    max-height: 680px;
    overflow: hidden;
    transition: height 0.3s ease, max-height 0.3s ease;
}

.player-card.expanded {
    height: auto;
    max-height: 900px;
    overflow: visible;
}

.station-artwork {
    width: 220px;
    height: 220px;
    background: linear-gradient(135deg, hsl(330, 90%, 61%), hsl(350, 72%, 80%));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    transition: background 0.8s ease, transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.station-artwork:hover:not(.loading) {
    transform: scale(1.02);
    box-shadow: 0 8px 32px rgba(233, 30, 140, 0.3);
}

.station-artwork:active:not(.loading) {
    transform: scale(0.98);
}

/* Disable click interactions while loading */
.station-artwork.loading {
    cursor: wait;
    pointer-events: none;
}

/* Smooth color cycling during loading */
.station-artwork.color-cycling {
    transition: background 0.8s ease;
}

/* Loading message overlay inside artwork */
.loading-message-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
    z-index: 2;
}

.loading-message-overlay p {
    font-size: 13px;
    font-weight: 400;
    font-style: italic;
    color: #fff;
    margin: 0;
    line-height: 1.4;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
    animation: fade-swap 1s ease-in-out;
}

.station-artwork::before {
    content: '';
    position: absolute;
    inset: 0;
    background: transparent;
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Hide the overlay when station is playing */
.station-artwork.has-station::before {
    opacity: 0;
}

/* Pink glowing dot indicator when station is playing */
.station-artwork::after {
    content: '';
    position: absolute;
    bottom: 10px;
    left: 10px;
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    opacity: 0;
    box-shadow: 0 0 0 0 var(--accent);
    transition: opacity 0.3s ease;
    animation: none;
    z-index: 10;
}

/* Show the pink dot when audio is playing */
.station-artwork.playing::after {
    opacity: 1;
    box-shadow: 0 0 3px rgba(233, 30, 140, 0.6);
}

/* Welcome message for default state */
.welcome-message {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    text-align: center;
    z-index: 1;
}

.welcome-message {
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.welcome-message:hover {
    transform: scale(1.05);
}

.welcome-message:active {
    transform: scale(0.98);
}

.welcome-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.welcome-text span {
    display: block;
}

/* Loading spinner inside artwork */
.loading-spinner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.spinner-ring {
    position: absolute;
    width: 80px;
    height: 80px;
    border: 4px solid transparent;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin-ring 1.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

.spinner-ring:nth-child(2) {
    width: 60px;
    height: 60px;
    border-top-color: #ff4da6;
    animation-delay: -0.3s;
    animation-duration: 1.2s;
}

.spinner-ring:nth-child(3) {
    width: 40px;
    height: 40px;
    border-top-color: #ff6b35;
    animation-delay: -0.6s;
    animation-duration: 0.9s;
}

@keyframes spin-ring {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Station name container inside artwork */
.station-name-container {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 2;
    text-align: center;
}

.station-name-container .station-name {
    font-size: 18px;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    margin: 0;
    line-height: 1.3;
    max-height: 100%;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    word-break: break-word;
}

.station-info {
    text-align: center;
    width: 100%;
    /* Fixed height to prevent layout shift */
    min-height: 100px;
    display: flex;
    flex-direction: column;
}

.station-meta {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 24px;
}

.station-desc-viewport {
    height: 90px;
    overflow-y: auto;
    margin-top: 0;
    flex-shrink: 0;
    transition: height 0.3s ease;
}

.station-desc-viewport.expanded {
    height: auto;
    max-height: 200px;
}

.station-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    text-align: center;
    /* Limit to 4 lines with ellipsis by default */
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.station-description.loading {
    color: var(--accent);
    font-style: italic;
    animation: pulse-text 1.5s ease-in-out infinite;
}

@keyframes pulse-text {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

@keyframes fade-swap {
    0% { opacity: 0; transform: translateY(4px); }
    20% { opacity: 1; transform: translateY(0); }
    80% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0.7; transform: translateY(-2px); }
}

.station-desc-viewport.expanded .station-description {
    display: block;
    -webkit-line-clamp: unset;
}

.expand-desc-btn {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 12px;
    padding: 4px;
    margin-top: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
}

.expand-desc-btn:hover {
    color: var(--accent-hover);
    transform: scale(1.1);
}

.expand-desc-btn i {
    transition: transform 0.3s ease;
}

.expand-desc-btn.expanded i {
    transform: rotate(180deg);
}

/* Custom scrollbar for description */
.station-desc-viewport::-webkit-scrollbar {
    width: 4px;
}

.station-desc-viewport::-webkit-scrollbar-track {
    background: transparent;
}

.station-desc-viewport::-webkit-scrollbar-thumb {
    background: var(--bg-elevated);
    border-radius: 2px;
}

/* ============================================
   STREAMING INDICATOR
   ============================================ */
.streaming-indicator {
    display: inline-flex;
    align-items: center;
    opacity: 1;
    transition: opacity 0.3s;
}

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

.dot {
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    opacity: 0.3;
}

/* Static dots (default - no station playing) */
.streaming-indicator .dot {
    opacity: 0.3;
    animation: none;
}

/* Loading state - windmill rotation */
.streaming-indicator.loading .streaming-dots {
    position: relative;
    width: 26px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.streaming-indicator.loading .dot {
    position: absolute;
    opacity: 1;
    animation: none;
    width: 6px;
    height: 6px;
}

/* Position dots in a triangle, then rotate the whole container */
.streaming-indicator.loading .dot:nth-child(1) {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.streaming-indicator.loading .dot:nth-child(2) {
    bottom: 0;
    left: 3px;
}

.streaming-indicator.loading .dot:nth-child(3) {
    bottom: 0;
    right: 3px;
}

.streaming-indicator.loading .streaming-dots {
    animation: dot-windmill 2s infinite linear;
}

@keyframes dot-windmill {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(720deg);
    }
}

/* Playing state - bounce animation */
.streaming-indicator.active .dot {
    animation: bounce 1s infinite;
    opacity: 1;
}

.streaming-indicator.active .dot:nth-child(2) {
    animation-delay: 0.2s;
}

.streaming-indicator.active .dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* ============================================
   PLAYER CONTROLS
   ============================================ */
.player-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
}

.control-buttons {
    display: flex;
    align-items: center;
    gap: 16px;
}

.control-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background-color: var(--bg-tertiary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
    color: var(--text-primary);
    font-size: 18px;
}

.control-btn:hover {
    background-color: var(--bg-elevated);
    transform: scale(1.05);
}

/* Control button labels - visible on hover */
.control-btn[data-label]::after {
    content: attr(data-label);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--bg-elevated);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
    z-index: 100;
    border: 1px solid var(--border);
}

.control-btn[data-label]:hover::after,
.control-btn[data-label]:focus-visible::after {
    opacity: 1;
    visibility: visible;
}

.control-btn.primary {
    width: 88px;
    height: 88px;
    background: linear-gradient(135deg, var(--accent), #ff4da6);
    box-shadow: 0 8px 32px var(--accent-glow);
    font-size: 32px;
}

.control-btn.primary:hover {
    transform: scale(1.08);
    box-shadow: 0 12px 40px var(--accent-glow);
}

/* Primary button is THE hero - make it stand out more */
.control-btn.primary::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #ff4da6);
    opacity: 0.3;
    z-index: -1;
    animation: hero-pulse 2s ease-in-out infinite;
}

@keyframes hero-pulse {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.1); opacity: 0.15; }
}

.control-btn .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background-color: var(--accent);
    color: white;
    font-size: 10px;
    font-weight: 600;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-secondary);
}

/* Song identifier spinner - centered inside the identify button */
.song-identifier-spinner {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
    z-index: 10;
}

/* Hide icons and show spinner when identifying */
#whatsPlayingButton.identifying > i,
#whatsPlayingButton.identifying > .badge {
    visibility: hidden;
}

#whatsPlayingButton.identifying .song-identifier-spinner {
    display: block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Tooltip for Identify Song button - using data-label pattern now */
#whatsPlayingButton {
    position: relative;
}

/* ============================================
   VOLUME CONTROL
   ============================================ */
.volume-control {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 0 8px;
    color: var(--text-secondary);
}

.volume-control i {
    font-size: 16px;
    flex-shrink: 0;
}

/* Make volume icon a clickable mute button */
.volume-mute-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: -8px;
}

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

.volume-mute-btn[aria-pressed="true"] {
    color: var(--accent);
}

.volume-slider-container {
    flex: 1;
    position: relative;
}

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

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* ============================================
   STATION ACTIONS
   ============================================ */
.station-actions {
    display: flex;
    gap: 12px;
    width: 100%;
}

.action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background-color: var(--bg-tertiary);
    border: none;
    border-radius: 24px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn i {
    font-size: 14px;
}

.action-btn:hover {
    background-color: var(--bg-elevated);
}

.action-btn.active,
.action-btn.saved {
    color: var(--accent);
    background-color: rgba(233, 30, 140, 0.15);
}

.action-btn.active i,
.action-btn.saved i {
    color: var(--accent);
}

/* ============================================
   DISCOVERY SECTION
   ============================================ */
.discovery-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: 620px;
    overflow: hidden;
    position: sticky;
    top: 0;
    align-self: flex-start;
    max-height: 100vh;
    height: 680px;
}

/* Tab Toggle Button Bar */
.tab-toggle-bar {
    display: flex;
    gap: 8px;
    padding: 14px 16px;
    background-color: var(--bg-secondary);
    border-radius: 12px 12px 0 0;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.tab-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 7px 16px;
    background-color: transparent;
    border: 1px solid var(--border);
    border-radius: 50px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-family: inherit;
}

.tab-toggle-btn i {
    font-size: 12px;
}

.tab-toggle-btn .icon-combo {
    display: inline-flex;
    align-items: center;
}

.tab-toggle-btn .icon-combo i:first-child {
    font-size: 11px;
}

.tab-toggle-btn .icon-combo i:last-child {
    font-size: 8px;
    margin-left: 1px;
}

.tab-toggle-btn:hover {
    color: var(--text-primary);
    border-color: var(--text-muted);
    background-color: var(--bg-tertiary);
}

.tab-toggle-btn.active {
    color: #ffffff;
    background-color: #FF2E9D;
    border-color: #FF2E9D;
    font-weight: 500;
}

/* Tab glow animation for feedback when saving/discovering */
.tab-toggle-btn.tab-glow {
    animation: tabGlow 1.5s ease-out;
}

@keyframes tabGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(233, 30, 140, 0.7);
    }
    30% {
        box-shadow: 0 0 12px 4px rgba(233, 30, 140, 0.6);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(233, 30, 140, 0);
    }
}

/* Legacy - keep for any remaining references */
.section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.section-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
}

/* ============================================
   TAB CONTENT
   ============================================ */
.tab-content {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.tab-content.active {
    display: flex;
}

/* ============================================
   DISCOVERY TABLE
   ============================================ */
.discovery-table {
    flex: 1;
    background-color: var(--bg-secondary);
    border-radius: 0 0 12px 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Legacy table-header kept for any JS references */
.table-header {
    display: none;
}

/* Tab description / subheading */
.tab-description {
    padding: 12px 20px;
    font-size: 12px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    background-color: var(--bg-secondary);
}

/* Songs tab header with toggle */
.songs-tab-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tab-description-text {
    flex: 1;
}

.songs-toggle {
    display: flex;
    background-color: var(--bg-tertiary);
    border-radius: 4px;
    padding: 2px;
    gap: 2px;
}

.songs-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 3px 8px;
    height: 22px;
    background: transparent;
    border: none;
    border-radius: 3px;
    color: var(--text-muted);
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.songs-toggle-btn i {
    font-size: 9px;
}

.songs-toggle-btn span {
    font-weight: 500;
}

.songs-toggle-btn:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

.songs-toggle-btn.active {
    background-color: var(--accent);
    color: white;
}

@media (max-width: 480px) {
    .songs-toggle-btn span {
        display: none;
    }

    .songs-toggle-btn {
        padding: 3px 6px;
    }
}

/* Songs views */
.songs-view {
    display: none;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.songs-view.active {
    display: flex;
}

/* Community song rows - 3 columns (track info, station, links) */
.song-row-community {
    grid-template-columns: 2fr 1fr 80px !important;
}

/* My songs rows - 5 columns (time ago, track info, station, links, delete) */
.song-row-my {
    grid-template-columns: 60px 2fr 1fr 80px 40px !important;
}

/* ============================================
   SAVED STATIONS STYLES (matching History design)
   ============================================ */
/* Saved station row: time ago first, then station name, then stats, then heart */
#saved-tab .table-row {
    display: grid;
    grid-template-columns: 50px 1fr 60px 36px;
    gap: 12px;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid rgba(85, 85, 85, 0.3);
}

#saved-tab .table-row:last-child {
    border-bottom: none;
}

#saved-tab .table-row.clickable-row {
    cursor: pointer;
}

#saved-tab .table-row:hover {
    background-color: var(--bg-tertiary);
}

.saved-time-ago {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.saved-station-name {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.saved-station-name .station-chip {
    max-width: fit-content;
}

/* Saved stations description with column headers */
.saved-description {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.saved-col-headers {
    display: flex;
    gap: 16px;
    margin-right: 42px;
}

.saved-col-headers span {
    font-size: 10px;
    color: var(--text-secondary);
    text-align: right;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: help;
}

.saved-col-headers span i {
    font-size: 9px;
    color: var(--accent);
    margin-right: 4px;
}

.saved-stats-row {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: flex-end;
}

.saved-stat-item {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
    text-align: right;
}

/* Saved heart / remove button */
.saved-heart {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: all 0.2s ease;
    color: var(--text-muted);
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.saved-heart:hover {
    color: #FF2E9D;
    background-color: rgba(255, 46, 157, 0.1);
}

.saved-heart.liked {
    color: #FF2E9D;
}

.saved-heart.liked:hover {
    opacity: 0.7;
}

/* Time ago cell (for songs) */
.time-ago-cell {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}

/* Listened cell with icon */
.listened-cell {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.listened-cell i {
    font-size: 11px;
    color: var(--text-muted);
}

/* Saved ago cell */
.saved-ago-cell {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}

/* Row actions cell */
.row-actions-cell {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

/* Icon button for actions */
.icon-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 13px;
    transition: all 0.2s;
    opacity: 0;
}

.table-row:hover .icon-btn {
    opacity: 1;
}

.icon-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.icon-btn.delete-btn:hover {
    color: var(--delete-color);
}

.station-name-cell-wrapper {
    min-width: 0;
}

.table-body {
    flex: 1;
    overflow-y: scroll;
    scrollbar-gutter: stable;
}

/* Table legend for explaining icons */
.table-legend {
    display: flex;
    gap: 20px;
    padding: 12px 20px;
    border-top: 1px solid rgba(85, 85, 85, 0.3);
    font-size: 11px;
    color: var(--text-muted);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-item i {
    font-size: 12px;
}

/* Load More button */
.load-more-container {
    padding: 16px 20px;
    text-align: center;
}

.load-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.load-more-btn:hover:not(:disabled) {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-color: var(--accent);
}

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

.load-more-btn i {
    font-size: 11px;
}

.table-row {
    display: grid;
    grid-template-columns: 2fr 1.5fr 120px 80px;
    gap: 16px;
    padding: 14px 20px;
    align-items: center;
    transition: background-color 0.15s, transform 0.15s;
    border-bottom: 1px solid rgba(85, 85, 85, 0.3);
    cursor: pointer;
    position: relative;
}

.table-row:last-child {
    border-bottom: none;
}

/* All grid cells must have min-width:0 so text truncation works */
.table-row > *,
.table-header > * {
    min-width: 0;
}

.table-row:hover {
    background-color: var(--bg-tertiary);
    border-radius: 8px;
}

/* Play indicator on hover */
.table-row::before {
    content: '\f04b';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    color: var(--accent);
    font-size: 10px;
    transition: opacity 0.15s;
}

.table-row:hover::before {
    opacity: 1;
}

.table-row.active {
    background-color: rgba(233, 30, 140, 0.1);
    position: relative;
}

.table-row.active::before {
    opacity: 1;
    animation: pulse-icon 1.5s ease-in-out infinite;
}

/* Lighten the radio icon on active rows */
.table-row.active .station-chip__icon {
    filter: brightness(1.4);
    animation: icon-glow 1.5s ease-in-out infinite;
}

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

@keyframes icon-glow {
    0%, 100% {
        filter: brightness(1.4);
    }
    50% {
        filter: brightness(1.8);
    }
}

/* Row number - hidden by default (removed numbering) */
.row-number {
    display: none;
}

.track-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.track-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-artist {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.station-tag {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: color 0.2s;
}

.station-tag:hover {
    color: var(--accent);
}

.station-cell {
    display: flex;
    align-items: center;
    min-width: 0;
}

/* Saved stations specific */
.station-name-cell {
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: color 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.station-name-cell:hover {
    color: var(--accent);
}

.station-timer-cell {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 13px;
    color: var(--text-muted);
}

/* Track links */
.track-links {
    display: flex;
    gap: 8px;
}

.link-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--bg-tertiary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    text-decoration: none;
}

.link-btn:hover {
    background-color: var(--bg-elevated);
    transform: scale(1.1);
}

.link-btn i {
    font-size: 14px;
}

.link-btn.apple i {
    color: var(--apple-music-color);
}

.link-btn.spotify i {
    color: var(--spotify-color);
}

/* Legacy streaming link styles */
.streaming-link-community {
    margin-right: 8px;
    text-decoration: none;
    font-size: 16px;
    transition: all 0.2s;
    display: inline-block;
}

.streaming-link-community.fa-apple { color: var(--apple-music-color); }
.streaming-link-community.fa-apple:hover { color: #ff5a5f; transform: scale(1.1); }
.streaming-link-community.fa-spotify { color: var(--spotify-color); }
.streaming-link-community.fa-spotify:hover { color: #1ed760; transform: scale(1.1); }
.streaming-link-community.fa-deezer { color: var(--deezer-color); }
.streaming-link-community.fa-deezer:hover { color: #ff8800; transform: scale(1.1); }

/* Row actions */
.row-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.remove-btn,
.song-delete-icon,
.station-delete-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s;
    color: var(--text-muted);
    font-size: 14px;
}

.table-row:hover .remove-btn,
.table-row:hover .song-delete-icon,
.table-row:hover .station-delete-icon {
    opacity: 1;
}

.remove-btn:hover,
.song-delete-icon:hover,
.station-delete-icon:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--delete-color);
}

/* Station action button in table */
.station-action-button {
    background-color: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.station-action-button:hover {
    background-color: var(--bg-elevated);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

/* Empty state */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px;
    color: var(--text-muted);
    grid-column: 1 / -1;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 14px;
    text-align: center;
}

/* Loading placeholder */
.loading-placeholder,
.table-center-placeholder {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-style: italic;
    grid-column: 1 / -1;
}

/* ============================================
   ANIMATIONS
   ============================================ */
.bounce-animation {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 8px 32px var(--accent-glow); }
    70% { transform: scale(1.05); box-shadow: 0 8px 32px var(--accent-glow), 0 0 0 15px rgba(233, 30, 140, 0); }
    100% { transform: scale(1); box-shadow: 0 8px 32px var(--accent-glow); }
}

.new-song-row,
.community-song-row {
    animation: fadeInScale 0.5s ease-out forwards;
}

@keyframes fadeInScale {
    0% { opacity: 0; transform: scale(0.95); }
    100% { opacity: 1; transform: scale(1); }
}

/* ============================================
   NOTIFICATIONS (Toast-style)
   ============================================ */
.song-notification-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    pointer-events: auto;
    background-color: rgba(0, 0, 0, 0.7);
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.song-notification {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    padding: 32px 28px 28px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    animation: modalFadeIn 0.3s ease-out forwards;
    max-width: 600px;
    width: 90%;
    pointer-events: auto;
    position: relative;
}

.notification-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 28px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    line-height: 1;
    padding: 0;
}

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

.notification-icon {
    font-size: 48px;
    color: var(--accent);
    margin-bottom: 8px;
}

.song-notification-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    text-align: center;
}

.song-notification-artist {
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 400;
    text-align: center;
    margin-bottom: 8px;
}

.notification-station {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-links {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 8px 0;
}

.notification-links a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 18px;
    transition: all 0.2s;
}

.notification-links a:hover {
    background-color: var(--bg-elevated);
    transform: scale(1.1);
}

.notification-links a .fa-apple {
    color: var(--apple-music-color);
}

.notification-links a .fa-spotify {
    color: var(--spotify-color);
}

.notification-links a .fa-deezer {
    color: var(--deezer-color);
}

.notification-redirect-btn {
    background-color: var(--accent);
    color: var(--text-primary);
    border: none;
    padding: 12px 32px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
}

.notification-redirect-btn:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(233, 30, 140, 0.3);
}

@keyframes toastSlide {
    0% { opacity: 0; transform: translateY(-20px); }
    8% { opacity: 1; transform: translateY(0); }
    85% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-20px); }
}

@keyframes modalFadeIn {
    0% { opacity: 0; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}

/* ============================================
   MODALS
   ============================================ */
.result-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--bg-secondary);
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    max-width: 500px;
    width: 90%;
    border: 1px solid var(--border);
}

.result-modal h2 {
    margin-top: 0;
    color: var(--text-primary);
    font-size: 20px;
}

.result-modal h3 {
    color: var(--accent);
    margin-top: 0;
    margin-bottom: 16px;
}

.result-modal p {
    margin: 10px 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.modal-close {
    position: absolute;
    right: 15px;
    top: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
}

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

/* Share Modal - Compact Design */
.share-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.share-modal-content {
    background-color: var(--bg-secondary);
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    position: relative;
    max-width: 340px;
    width: 90%;
    border: 1px solid var(--border);
    animation: modalSlideIn 0.25s ease;
}

.share-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.share-modal-close:hover {
    color: var(--text-primary);
    background-color: var(--bg-tertiary);
}

.share-modal-title {
    margin: 0 0 20px 0;
    text-align: center;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    padding-right: 20px;
}

.copy-link-container {
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.copy-link-input {
    flex-grow: 1;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 13px;
    min-width: 0;
}

.copy-button {
    padding: 10px 14px;
    background-color: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    font-weight: 600;
    font-size: 13px;
    flex-shrink: 0;
}

.copy-button:hover {
    background-color: var(--accent-hover);
}

.copy-button.copied-state {
    background-color: var(--success) !important;
}

.share-icons-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.share-icon-link {
    text-decoration: none;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: transform 0.2s;
}

.share-icon-link:hover {
    transform: translateY(-2px);
}

.share-icon {
    font-size: 18px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.share-icon:hover {
    background-color: var(--bg-elevated);
}

.share-icon-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: scale(0.95) translateY(-10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Shared Station Welcome Popup */
.shared-station-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.shared-station-popup {
    background-color: var(--bg-secondary);
    padding: 32px;
    border-radius: 20px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
    text-align: center;
    max-width: 320px;
    width: 90%;
    border: 1px solid var(--border);
    animation: modalSlideIn 0.3s ease;
}

.shared-station-popup__icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent), #ff4da6);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 28px;
    color: white;
}

.shared-station-popup__label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.shared-station-popup__name {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
    line-height: 1.3;
}

.shared-station-popup__play {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--accent), #ff4da6);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.shared-station-popup__play:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.shared-station-popup__play i {
    font-size: 14px;
}



/* ============================================
   LEADERBOARD
   ============================================ */
/* ============================================
   UNIFIED STATION CHIP
   ============================================ */
.station-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px 5px 5px;
    background: var(--bg-elevated);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    max-width: 100%;
    min-width: 0;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
}
.station-chip:hover {
    background: rgba(233, 30, 140, 0.08);
    border-color: rgba(233, 30, 140, 0.25);
    transform: translateY(-1px);
}
.station-chip:hover .station-chip__name {
    color: var(--accent);
}
.station-chip__icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #ff6b35);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.station-chip__icon i {
    font-size: 9px;
    color: white;
}
.station-chip__name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s;
}

/* Compact variant for discovery tables */
.station-chip--compact {
    padding: 3px 10px 3px 3px;
    gap: 6px;
}
.station-chip--compact .station-chip__icon {
    width: 20px;
    height: 20px;
}
.station-chip--compact .station-chip__icon i {
    font-size: 8px;
}
.station-chip--compact .station-chip__name {
    font-size: 12px;
}

/* ============================================
   RANK MEDAL BADGES
   ============================================ */
.rank-medal {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    margin: 0 auto;
}
.rank-medal--gold {
    background: var(--gold-bg);
    color: var(--gold);
    border: 1.5px solid rgba(245, 197, 24, 0.3);
}
.rank-medal--silver {
    background: var(--silver-bg);
    color: var(--silver);
    border: 1.5px solid rgba(180, 184, 196, 0.2);
}
.rank-medal--bronze {
    background: var(--bronze-bg);
    color: var(--bronze);
    border: 1.5px solid rgba(205, 127, 50, 0.2);
}



/* ============================================
   LEADERBOARD STYLES
   ============================================ */
/* Leaderboard row: single row layout for cleaner design */
#leaderboard-tab .table-row {
    display: grid;
    grid-template-columns: 1fr auto 36px;
    gap: 12px;
    align-items: center;
    padding: 12px 20px;
}

#leaderboard-tab .table-row.clickable-row {
    cursor: pointer;
}

.leaderboard-station-name {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.leaderboard-station-name .station-chip {
    max-width: fit-content;
}

.leaderboard-rank {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 18px;
    text-align: center;
}

#leaderboard-tab .table-row:hover {
    background-color: var(--bg-tertiary);
}

/* Leaderboard description with column headers */
.leaderboard-description {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.leaderboard-col-headers {
    display: grid;
    grid-template-columns: 60px 76px 56px 50px;
    gap: 16px;  /* Increased gap to prevent column misreading */
    margin-right: 42px;
}

.leaderboard-col-headers span {
    font-size: 10px;
    color: var(--text-secondary);
    text-align: right;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: help;
    padding-left: 4px;  /* Visual separation */
    border-left: 1px solid transparent;  /* Potential future separator */
}

.leaderboard-col-headers span i {
    font-size: 9px;
    color: var(--accent);
    margin-right: 4px;
}

.leaderboard-stats-row {
    display: grid;
    grid-template-columns: 60px 76px 56px 50px;
    gap: 16px;  /* Match header gap */
    align-items: center;
    flex-shrink: 0;
}

.leaderboard-stat-item {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
    text-align: right;
}

/* Heart / save button */
.leaderboard-heart {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: all 0.2s ease;
    color: var(--text-muted);
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.leaderboard-heart:hover {
    color: #FF2E9D;
    background-color: rgba(255, 46, 157, 0.1);
}

.leaderboard-heart.liked {
    color: #FF2E9D;
}

.leaderboard-heart.liked:hover {
    opacity: 0.7;
}

/* Add subtle divider between leaderboard rows */
#leaderboard-tab .table-row {
    border-bottom: 1px solid rgba(85, 85, 85, 0.3);
}

#leaderboard-tab .table-row:last-child {
    border-bottom: none;
}

/* ============================================
   HISTORY STYLES
   ============================================ */
/* History row: time ago first, then station name, then stats, then heart */
#history-tab .table-row {
    display: grid;
    grid-template-columns: 50px 1fr 60px 36px;
    gap: 12px;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid rgba(85, 85, 85, 0.3);
}

#history-tab .table-row:last-child {
    border-bottom: none;
}

#history-tab .table-row.clickable-row {
    cursor: pointer;
}

#history-tab .table-row:hover {
    background-color: var(--bg-tertiary);
}

.history-time-ago {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.history-station-name {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.history-station-name .station-chip {
    max-width: fit-content;
}

/* History description with column headers */
.history-description {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Refresh button for history */
.refresh-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 6px;
    margin-left: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    font-size: 12px;
    vertical-align: middle;
}

.refresh-btn:hover {
    color: var(--accent);
    background-color: rgba(255, 46, 157, 0.1);
}

.refresh-btn.spinning i {
    animation: spin 0.8s linear infinite;
}

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

.history-col-headers {
    display: flex;
    gap: 16px;
    margin-right: 42px;
}

.history-col-headers span {
    font-size: 10px;
    color: var(--text-secondary);
    text-align: right;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: help;
}

.history-col-headers span i {
    font-size: 9px;
    color: var(--accent);
    margin-right: 4px;
}

.history-stats-row {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
}

.history-stat-item {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
    text-align: right;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.history-stat-item i {
    font-size: 11px;
    color: var(--accent);
}

/* History heart / save button */
.history-heart {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: all 0.2s ease;
    color: var(--text-muted);
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.history-heart:hover {
    color: #FF2E9D;
    background-color: rgba(255, 46, 157, 0.1);
}

.history-heart.liked {
    color: #FF2E9D;
}

.history-heart.liked:hover {
    opacity: 0.7;
}

@media (max-width: 768px) {
    /* Toggle bar compact on mobile */
    .tab-toggle-bar {
        gap: 4px;
        padding: 10px 12px;
    }

    .tab-toggle-btn {
        padding: 8px 12px;
        font-size: 12px;
        gap: 5px;
    }

    .tab-toggle-btn span {
        display: none;
    }

    .tab-toggle-btn i {
        font-size: 15px;
    }

    /* Hide column headers and stats on mobile - cleaner layout */
    .leaderboard-col-headers,
    .leaderboard-stats-row,
    .history-col-headers,
    .history-stats-row,
    .history-time-ago,
    .saved-col-headers,
    .saved-stats-row,
    .saved-time-ago {
        display: none !important;
    }

    /* Leaderboard rows - simple layout: station name + heart */
    #leaderboard-tab .table-row {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 14px;
    }

    .leaderboard-station-name {
        flex: 1;
        min-width: 0;
    }

    .leaderboard-station-name .station-chip {
        max-width: 100%;
    }

    .leaderboard-station-name .station-chip__name {
        white-space: normal;
        word-break: break-word;
        line-height: 1.3;
    }

    .leaderboard-heart {
        flex-shrink: 0;
    }

    /* History rows - simple layout: station name + heart */
    #history-tab .table-row {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 14px;
    }

    .history-station-name {
        flex: 1;
        min-width: 0;
    }

    .history-station-name .station-chip {
        max-width: 100%;
    }

    .history-station-name .station-chip__name {
        white-space: normal;
        word-break: break-word;
        line-height: 1.3;
    }

    .history-heart {
        flex-shrink: 0;
    }

    /* Make station chip more compact on mobile but allow text to wrap */
    .station-chip {
        padding: 4px 8px 4px 4px;
        gap: 6px;
    }
    .station-chip__icon {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
    }
    .station-chip__icon i {
        font-size: 8px;
    }
    .station-chip__name {
        font-size: 12px;
    }

    /* Community songs rows */
    .song-row-community {
        grid-template-columns: 1fr 80px 60px !important;
    }

    .song-row-community .station-cell {
        display: none;
    }

    /* My songs rows */
    .song-row-my {
        grid-template-columns: 50px 1fr 60px 36px !important;
    }

    .song-row-my .station-cell {
        display: none;
    }

    /* Saved station rows - simple layout: station name + heart */
    #saved-tab .table-row {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 14px;
    }

    .saved-station-name {
        flex: 1;
        min-width: 0;
    }

    .saved-station-name .station-chip {
        max-width: 100%;
    }

    .saved-station-name .station-chip__name {
        white-space: normal;
        word-break: break-word;
        line-height: 1.3;
    }

    .saved-heart {
        flex-shrink: 0;
    }

    /* Make action icons always visible on touch devices */
    .icon-btn,
    .remove-btn,
    .song-delete-icon,
    .station-delete-icon {
        opacity: 0.6;
    }
}

@media (max-width: 480px) {
    .tab-toggle-bar {
        gap: 3px;
        padding: 8px 10px;
    }

    .tab-toggle-btn {
        padding: 7px 10px;
    }

    /* Smaller padding on very small screens */
    #leaderboard-tab .table-row,
    #history-tab .table-row,
    #saved-tab .table-row {
        padding: 10px 12px;
    }

    .leaderboard-heart,
    .history-heart,
    .saved-heart {
        font-size: 14px;
        padding: 5px;
    }

    .rank-medal {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: var(--bg-elevated);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-muted);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1200px) {
    .main-content {
        height: auto;
        overflow: visible;
    }

    .content-area {
        flex-direction: column;
        height: auto;
        overflow: visible;
        padding-bottom: 32px;
    }

    .now-playing {
        width: 100%;
        max-width: 420px;
        margin: 0 auto;
        position: static;
        max-height: none;
        overflow: visible;
    }

    .discovery-section {
        position: static;
        max-height: none;
        max-width: none;
        height: auto;
        overflow: visible;
        width: 100%;
    }

    .tab-content {
        overflow: visible;
    }

    .discovery-table {
        overflow: visible;
    }

    .table-body {
        overflow: visible;
    }
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .content-area {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .main-content {
        height: auto;
        overflow: visible;
    }

    .content-area {
        gap: 20px;
        height: auto;
        overflow: visible;
        padding-bottom: 20px;
    }

    .now-playing,
    .discovery-section {
        position: static;
        max-height: none;
        height: auto;
        overflow: visible;
    }

    .player-card {
        padding: 24px;
        height: auto;
        max-height: none;
        min-height: auto;
    }

    .station-artwork {
        width: 180px;
        height: 180px;
    }

    .control-btn.primary {
        width: 70px;
        height: 70px;
        font-size: 24px;
    }

    .control-btn {
        width: 46px;
        height: 46px;
        font-size: 16px;
    }

    .section-title {
        font-size: 22px;
    }

    .table-header,
    .table-row {
        grid-template-columns: 1.5fr 1fr 80px 50px;
        gap: 12px;
        padding: 10px 16px;
    }

    .song-row-new {
        grid-template-columns: 1.5fr 1fr 80px !important;
    }

    #mySongsTableBody .song-row-new {
        grid-template-columns: 1.5fr 1fr 80px 40px !important;
    }

}

@media (max-width: 480px) {
    /* Hide station cell on very small screens */
    .song-row-community .station-cell,
    .song-row-my .station-cell {
        display: none;
    }

    /* Generic table row rules - but not for our stacked layouts */
    .table-header {
        grid-template-columns: 1fr 60px 40px;
        gap: 8px;
        padding: 9px 12px;
    }

    /* Community songs on very small screens */
    .song-row-community {
        grid-template-columns: 1fr 60px !important;
    }

    /* My songs - hide time ago on very small */
    .song-row-my {
        grid-template-columns: 1fr 60px 36px !important;
    }

    .song-row-my .time-ago-cell {
        display: none;
    }

    .station-name {
        font-size: 18px;
    }

    .station-artwork {
        width: 160px;
        height: 160px;
    }

    .station-artwork i {
        font-size: 48px;
    }

    .action-btn span {
        display: none;
    }

    .action-btn {
        padding: 12px 20px;
    }
}

/* ============================================
   MOBILE MENU TOGGLE (add via JS if needed)
   ============================================ */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #ff4da6);
    border: none;
    cursor: pointer;
    z-index: 200;
    box-shadow: 0 4px 20px var(--accent-glow);
    color: white;
    font-size: 24px;
}

@media (max-width: 1024px) {
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* ============================================
   USER PROFILE SECTION (Updated)
   ============================================ */
.user-profile {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    margin: 0 12px 16px 12px;
    background-color: var(--bg-tertiary);
    border-radius: 10px;
    position: relative;
}

.user-profile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.display-username {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
}

.user-profile-main {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.login-logout-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
    padding: 2px 6px;
    transition: all 0.2s;
    font-family: inherit;
    white-space: nowrap;
}

.login-logout-btn:hover {
    color: var(--accent);
}

/* ============================================
   AUTH MODAL (Login/Signup)
   ============================================ */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.auth-modal-content {
    background-color: var(--bg-secondary);
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    position: relative;
    max-width: 420px;
    width: 90%;
    border: 1px solid var(--border);
}

.auth-modal-content h2 {
    margin: 0 0 8px 0;
    color: var(--text-primary);
    font-size: 24px;
    text-align: center;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    text-align: center;
    margin-bottom: 24px;
}

.close-modal {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.social-login-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 20px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.social-login-btn:hover {
    background-color: var(--bg-elevated);
    border-color: var(--text-muted);
}

.social-login-btn.google i {
    color: #ea4335;
    font-size: 18px;
}

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

.auth-divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    color: var(--text-muted);
    font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: var(--border);
}

.auth-divider span {
    padding: 0 16px;
}

#emailLoginForm {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    width: 100%;
}

#emailLoginForm input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.2s;
}

#emailLoginForm input:focus {
    outline: none;
    border-color: var(--accent);
}

#emailLoginForm input::placeholder {
    color: var(--text-muted);
}

.auth-error {
    background-color: rgba(220, 53, 69, 0.1);
    border: 1px solid var(--delete-color);
    color: var(--delete-color);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
}

.auth-submit-btn {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--accent), #ff4da6);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.auth-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--accent-glow);
}

.auth-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.forgot-password-link {
    display: block;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 16px;
    text-decoration: none;
    transition: color 0.2s;
}

.forgot-password-link:hover {
    color: var(--accent);
}

.auth-switch {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 20px;
}

.auth-switch a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* ============================================
   ACCOUNT MODAL
   ============================================ */
.account-modal-content {
    max-width: 420px;
    padding: 24px 28px;
    max-height: 85vh;
    overflow-y: auto;
}

.account-modal-content h2 {
    margin: 0 0 16px 0;
    color: var(--text-primary);
    font-size: 20px;
}

.account-modal-content h3 {
    margin: 0 0 10px 0;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
}

.hidden {
    display: none !important;
}

/* Account Login Prompt */
.account-login-prompt {
    text-align: center;
    padding: 30px 20px;
}

.account-login-prompt i {
    font-size: 48px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.account-login-prompt p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* Account Sections */
.account-section {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.account-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Account Rows */
.account-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
}

.account-label {
    color: var(--text-muted);
    font-size: 13px;
}

.account-value {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.account-edit-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.account-edit-btn:hover {
    color: var(--accent);
    background-color: var(--bg-tertiary);
}

/* Email Verification Notice */
.verification-notice {
    background-color: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 8px;
    padding: 12px;
    margin: 12px 0;
}

.verification-message {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffc107;
    font-size: 13px;
    margin-bottom: 8px;
}

.verification-message i {
    font-size: 16px;
}

.resend-verification-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background-color: rgba(255, 193, 7, 0.2);
    border: 1px solid rgba(255, 193, 7, 0.4);
    border-radius: 6px;
    color: #ffc107;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.resend-verification-btn:hover {
    background-color: rgba(255, 193, 7, 0.3);
    border-color: #ffc107;
}

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

/* Account Stats Grid */
.account-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.stat-box {
    background-color: var(--bg-tertiary);
    border-radius: 8px;
    padding: 10px 6px;
    text-align: center;
}

.stat-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 2px;
}

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

/* Account Action Buttons */
.account-action-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.account-action-btn:hover {
    background-color: var(--bg-elevated);
    border-color: var(--text-muted);
}

.account-action-btn.danger {
    color: var(--delete-color);
    border-color: var(--delete-color);
    background-color: rgba(220, 53, 69, 0.1);
}

.account-action-btn.danger:hover {
    background-color: rgba(220, 53, 69, 0.2);
}

/* Danger Zone */
.danger-zone {
    border-top: 1px solid var(--delete-color) !important;
    padding-top: 16px !important;
    margin-top: 16px !important;
    border-bottom: none !important;
}

/* Back Button */
.back-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    padding: 0;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
    font-family: inherit;
}

.back-btn:hover {
    color: var(--accent);
}

/* Form Description */
.form-description {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
}

/* Form Feedback */
.form-feedback {
    font-size: 13px;
    margin: 12px 0;
    padding: 10px 14px;
    border-radius: 6px;
    display: none;
}

.form-feedback:not(:empty) {
    display: block;
}

.form-feedback.success {
    color: var(--success);
    background-color: rgba(29, 185, 84, 0.1);
    border: 1px solid var(--success);
}

.form-feedback.error {
    color: var(--delete-color);
    background-color: rgba(220, 53, 69, 0.1);
    border: 1px solid var(--delete-color);
}

/* Delete Warning */
.delete-warning {
    background-color: rgba(220, 53, 69, 0.1);
    border: 1px solid var(--delete-color);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.delete-warning i {
    color: var(--delete-color);
    font-size: 24px;
    margin-bottom: 12px;
    display: block;
}

.delete-warning p {
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-size: 14px;
}

.delete-warning ul {
    color: var(--text-muted);
    font-size: 13px;
    margin: 0;
    padding-left: 20px;
}

.delete-warning li {
    margin-bottom: 4px;
}

.delete-confirm-text {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 12px;
}

.delete-confirm-text strong {
    color: var(--delete-color);
}

/* Danger Button */
.danger-btn {
    background: var(--delete-color) !important;
    border: none;
}

.danger-btn:hover {
    background: #c82333 !important;
}

.danger-btn:disabled {
    background: var(--bg-tertiary) !important;
    color: var(--text-muted) !important;
    cursor: not-allowed;
}

/* Account Modal Input Styling */
#accountModal input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.2s;
}

#accountModal input:focus {
    outline: none;
    border-color: var(--accent);
}

#accountModal input::placeholder {
    color: var(--text-muted);
}

/* ============================================
   MODAL RESPONSIVE STYLES
   ============================================ */

/* Tablet - reduce padding slightly */
@media (max-width: 768px) {
    .auth-modal-content {
        padding: 32px 24px;
        width: 92%;
    }

    .account-modal-content {
        max-width: 90%;
        padding: 20px;
    }

    .auth-modal-content h2 {
        font-size: 22px;
    }

    .account-modal-content h2 {
        font-size: 18px;
    }

    .account-stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }

    .stat-box {
        padding: 8px 4px;
    }

    .stat-value {
        font-size: 14px;
    }

    .stat-label {
        font-size: 9px;
    }
}

/* Mobile - optimize for small screens */
@media (max-width: 480px) {
    .auth-modal {
        padding: 12px;
        align-items: flex-start;
        padding-top: 40px;
    }

    .auth-modal-content {
        padding: 20px 16px;
        width: 100%;
        max-width: 100%;
        border-radius: 12px;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
    }

    .account-modal-content {
        max-width: 100%;
        padding: 18px 14px;
    }

    .auth-modal-content h2 {
        font-size: 18px;
        margin-bottom: 6px;
    }

    .account-modal-content h2 {
        font-size: 16px;
        margin-bottom: 12px;
    }

    .account-modal-content h3 {
        font-size: 13px;
        margin-bottom: 8px;
    }

    .auth-subtitle {
        font-size: 12px;
        margin-bottom: 16px;
    }

    .close-modal {
        top: 10px;
        right: 10px;
        font-size: 22px;
        width: 26px;
        height: 26px;
    }

    /* Form elements sizing */
    .social-login-btn,
    .auth-submit-btn,
    .account-action-btn {
        padding: 10px 14px;
        font-size: 13px;
    }

    #emailLoginForm input,
    #accountModal input {
        padding: 10px 12px;
        font-size: 13px;
    }

    /* Account rows */
    .account-row {
        padding: 5px 0;
    }

    .account-label,
    .account-value {
        font-size: 12px;
    }

    /* Stats grid - keep 4 columns compact */
    .account-stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 4px;
    }

    .stat-box {
        padding: 8px 2px;
    }

    .stat-value {
        font-size: 13px;
    }

    .stat-label {
        font-size: 8px;
    }

    /* Verification notice */
    .verification-notice {
        padding: 8px;
        margin: 8px 0;
    }

    .verification-message {
        font-size: 11px;
    }

    .verification-message i {
        font-size: 12px;
    }

    .resend-verification-btn {
        padding: 8px 12px;
        font-size: 11px;
    }

    /* Account section spacing */
    .account-section {
        margin-bottom: 12px;
        padding-bottom: 12px;
    }

    .account-login-prompt {
        padding: 16px 12px;
    }

    .account-login-prompt i {
        font-size: 32px;
        margin-bottom: 10px;
    }

    .account-login-prompt p {
        font-size: 13px;
        margin-bottom: 12px;
    }

    /* Form feedback */
    .form-feedback {
        font-size: 11px;
        padding: 6px 10px;
        margin: 8px 0;
    }

    /* Delete warning */
    .delete-warning {
        padding: 12px;
        margin-bottom: 12px;
    }

    .delete-warning i {
        font-size: 18px;
        margin-bottom: 8px;
    }

    .delete-warning p {
        font-size: 12px;
        margin-bottom: 8px;
    }

    .delete-warning ul {
        font-size: 11px;
    }

    .delete-confirm-text {
        font-size: 12px;
        margin-bottom: 8px;
    }

    .danger-zone {
        padding-top: 12px !important;
        margin-top: 12px !important;
    }
}

/* ============================================
   IMPROVED EMPTY STATES
   ============================================ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 32px;
    color: var(--text-muted);
    text-align: center;
}

.empty-state__icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.empty-state__icon i {
    font-size: 32px;
    color: var(--text-muted);
}

.empty-state__title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state__text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    max-width: 280px;
    margin-bottom: 20px;
}

.empty-state__cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--accent), #ff4da6);
    color: white;
    border: none;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.empty-state__cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--accent-glow);
}

/* ============================================
   STATION NAME TOOLTIP (full name on hover)
   ============================================ */
.station-chip__name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s;
    position: relative;
}

/* Show full name tooltip on hover for truncated names */
.station-chip[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-elevated);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 1000;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
}

/* Extra small screens - ultra compact */
@media (max-width: 360px) {
    .auth-modal {
        padding: 8px;
        padding-top: 40px;
    }

    .auth-modal-content,
    .account-modal-content {
        padding: 20px 16px;
    }

    .account-stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }

    .stat-box {
        padding: 10px 6px;
    }

    .stat-value {
        font-size: 18px;
    }

    .stat-label {
        font-size: 10px;
    }

    .account-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .account-value {
        width: 100%;
    }
}
