/* ============================================
   CSS VARIABLES - DARK MODE
   ============================================ */
:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #1E1E1E;
    --bg-tertiary: #383838;
    --bg-elevated: #4a4a4a;
    --text-primary: #ffffff;
    --text-secondary: #c0c0c0;
    --text-muted: #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);
}

/* ============================================
   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;
}

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

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    width: 260px;
    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: 24px;
}

.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;
}

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

.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;
}

.sidebar-spacer {
    flex: 1;
}

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

/* 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: 260px;
    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: 32px;
    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;
}

/* 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;
}

/* 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-text {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.4;
}

/* 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-btn.primary {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--accent), #ff4da6);
    box-shadow: 0 8px 32px var(--accent-glow);
    font-size: 28px;
}

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

.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 */
.song-identifier-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    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;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Tooltip for Identify Song button */
#whatsPlayingButton {
    position: relative;
}

#whatsPlayingButton::after {
    content: "Identify Song";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    color: var( --text-secondary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    pointer-events: none;
    margin-bottom: 8px;
    z-index: 100;
}

#whatsPlayingButton:hover::after {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   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;
}

.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;
    overflow: hidden;
    position: sticky;
    top: 0;
    align-self: flex-start;
    max-height: 100vh;
}

/* Table title section inside the table */
.table-title-section {
    padding: 14px 20px;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.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: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.table-header {
    display: grid;
    grid-template-columns: 48px 2fr 1.5fr 120px 80px;
    gap: 16px;
    padding: 14px 20px;
    background-color: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

/* 4-column layout for community tab */
#community-tab .table-header {
    grid-template-columns: 48px 2fr 1.5fr 120px;
}

#community-tab .table-row {
    grid-template-columns: 48px 2fr 1.5fr 120px;
}

.table-body {
    flex: 1;
    overflow-y: auto;
}

.table-row {
    display: grid;
    grid-template-columns: 48px 2fr 1.5fr 120px 80px;
    gap: 16px;
    padding: 12px 20px;
    align-items: center;
    border-bottom: 1px solid var(--border);
    transition: background-color 0.15s;
}

/* 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);
}

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

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

.row-number {
    font-size: 14px;
    color: var(--text-muted);
    text-align: center;
}

.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);
}

/* 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
   ============================================ */
.song-notification-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    pointer-events: none;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.song-notification {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    padding: 32px 36px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    animation: slideIn 4s ease-in-out forwards;
    max-width: 420px;
    width: 90%;
    pointer-events: auto;
}

.song-notification i {
    font-size: 48px;
    color: var(--accent);
    background: linear-gradient(135deg, var(--accent), #ff4da6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.song-notification-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    gap: 8px;
}

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

.song-notification-artist {
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 500;
}

.notification-station {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    width: 100%;
}

.notification-links {
    margin-top: 16px;
    display: flex;
    justify-content: center;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    width: 100%;
}

.notification-links a {
    width: 44px;
    height: 44px;
    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);
}

@keyframes slideIn {
    0% { opacity: 0; transform: translateY(-30px) scale(0.95); }
    10% { opacity: 1; transform: translateY(0) scale(1); }
    90% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-30px) scale(0.95); }
}

/* ============================================
   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-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.share-modal-content {
    background-color: var(--bg-secondary);
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    position: relative;
    max-width: 500px;
    width: 90%;
    max-height: 90%;
    overflow-y: auto;
    border: 1px solid var(--border);
}

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

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

.share-modal-title {
    margin-top: 0;
    margin-bottom: 25px;
    text-align: center;
    color: var(--text-primary);
    font-size: 24px;
}

.copy-link-container {
    margin: 0 0 25px 0;
    padding: 15px;
    background-color: var(--bg-tertiary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.copy-link-input {
    flex-grow: 1;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background-color: var(--bg-elevated);
    color: var(--text-primary);
    font-size: 14px;
}

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

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

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

.share-icons-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
}

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

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

.share-icon {
    font-size: 36px;
    padding: 18px;
    background-color: var(--accent);
    color: white;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.share-icon:hover {
    background-color: var(--accent-hover);
    box-shadow: 0 4px 16px var(--accent-glow);
}

.share-icon-label {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}



/* ============================================
   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 TAB SWITCHER
   ============================================ */
.leaderboard-tab-switcher {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--bg-primary);
    border-radius: 10px;
}
.leaderboard-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 7px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.leaderboard-tab-btn:hover {
    color: var(--text-secondary);
    background: var(--bg-tertiary);
}
.leaderboard-tab-btn.active {
    background: var(--accent);
    color: white;
}
.leaderboard-tab-btn.active:hover {
    background: var(--accent-hover);
    color: white;
}
.leaderboard-tab-btn i {
    font-size: 11px;
}

/* ============================================
   LEADERBOARD STYLES
   ============================================ */
.leaderboard-table-header {
    grid-template-columns: 48px 1fr 120px;
}

#leaderboard-tab .table-row {
    grid-template-columns: 48px 1fr 120px;
}

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

.leaderboard-station-name {
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.leaderboard-username {
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.leaderboard-stat {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    white-space: nowrap;
    text-align: right;
}

/* Legacy rank-badge (kept for compatibility) */
.rank-badge {
    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-badge.gold {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #1a1a1a;
}

.rank-badge.silver {
    background: linear-gradient(135deg, #C0C0C0, #A8A8A8);
    color: #1a1a1a;
}

.rank-badge.bronze {
    background: linear-gradient(135deg, #CD7F32, #B87333);
    color: #1a1a1a;
}

.rank-badge.default {
    color: var(--text-muted);
}

/* Leaderboard sub-content visibility */
.leaderboard-content {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}
.leaderboard-content.active {
    display: flex;
}

@media (max-width: 768px) {
    /* Make leaderboard title section stack vertically on mobile */
    .table-title-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 12px 16px;
    }

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

    .leaderboard-tab-switcher {
        width: 100%;
        gap: 2px;
    }

    .leaderboard-tab-btn {
        flex: 1;
        padding: 6px 10px;
        font-size: 11px;
    }

    .leaderboard-table-header,
    #leaderboard-tab .table-row {
        grid-template-columns: 40px 1fr 90px;
        gap: 10px;
        padding: 10px 14px;
    }

    /* Make station chip more compact on mobile */
    .station-chip {
        padding: 4px 8px 4px 4px;
        gap: 6px;
    }
    .station-chip__icon {
        width: 20px;
        height: 20px;
    }
    .station-chip__icon i {
        font-size: 8px;
    }
    .station-chip__name {
        font-size: 12px;
    }

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

@media (max-width: 480px) {
    /* Further optimize leaderboard header for small screens */
    .table-title-section {
        padding: 10px 12px;
        gap: 8px;
    }

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

    .leaderboard-tab-btn {
        padding: 5px 8px;
        font-size: 10px;
        gap: 4px;
    }

    .leaderboard-tab-btn i {
        font-size: 10px;
    }

    .leaderboard-table-header,
    #leaderboard-tab .table-row {
        grid-template-columns: 32px 1fr 72px;
        gap: 8px;
        padding: 9px 12px;
    }

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

    .leaderboard-stat {
        font-size: 12px;
    }
}

/* ============================================
   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;
        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;
        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: 40px 1.5fr 1fr 100px 60px;
        gap: 12px;
        padding: 10px 16px;
    }

    #community-tab .table-header,
    #community-tab .table-row {
        grid-template-columns: 40px 1.5fr 1fr 100px;
    }
}

@media (max-width: 480px) {
    /* Hide the 3rd column (station/tag) on very small screens */
    .table-header span:nth-child(3),
    .table-row > *:nth-child(3) {
        display: none;
    }

    .table-header,
    .table-row {
        grid-template-columns: 32px 1fr 64px 44px;
        gap: 8px;
        padding: 9px 12px;
    }

    #community-tab .table-header,
    #community-tab .table-row {
        grid-template-columns: 32px 1fr 64px;
        gap: 8px;
        padding: 9px 12px;
    }

    .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: row;
    align-items: center;
    gap: 10px;
    padding: 30px 12px 8px 12px;
    margin: 0 12px 16px 12px;
    background-color: var(--bg-tertiary);
    border-radius: 10px;
    position: relative;
    min-height: 0;
}

.user-profile-header {
    position: absolute;
    top: 4px;
    left: 12px;
}

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

.user-profile-main {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.login-logout-btn {
    position: absolute;
    top: 6px;
    right: 8px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 10px;
    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;
    }
}

/* 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%;
    }
}
