/* ============================================
   PURE ENERGY MUSIC — Style System
   ============================================ */

:root {
    /* Colors — Clean Light Theme */
    --bg-darkest: #f5f5f5;
    --bg-dark: #ffffff;
    --bg-card: #ffffff;
    --bg-elevated: #f9f9f9;
    --bg-hover: #f0f0f0;
    --bg-active: #e8e8e8;
    --border: #e0e0e0;
    --border-light: #eeeeee;

    --text-primary: #1a1a1a;
    --text-secondary: #555555;
    --text-tertiary: #888888;
    --text-muted: #bbbbbb;

    --accent: #e91e8b;
    --accent-hover: #d4177d;
    --accent-glow: rgba(233, 30, 139, 0.15);
    --accent-subtle: rgba(233, 30, 139, 0.08);
    --accent-text: #d4177d;

    --danger: #ef4444;
    --danger-hover: #dc2626;
    --success: #16a34a;

    /* Typography */
    --font-display: 'Outfit', sans-serif;
    --font-mono: 'Space Mono', monospace;

    /* Sizing */
    --header-height: 64px;
    --sidebar-width: 260px;
    --now-playing-height: 96px;
    --radius: 8px;
    --radius-sm: 4px;
    --radius-lg: 12px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition: 250ms ease;
    --transition-slow: 400ms ease;
}

/* ============================================
   RESET & BASE
   ============================================ */

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

html {
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-display);
    background: var(--bg-darkest);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

input, button, textarea, select {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    border: none;
    outline: none;
    background: none;
}

button {
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

a {
    color: var(--accent);
    text-decoration: none;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

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

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

.hidden {
    display: none !important;
}

.hidden-input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

/* ============================================
   APP LAYOUT
   ============================================ */

.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* ============================================
   HEADER
   ============================================ */

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    padding: 0 20px;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border);
    z-index: 100;
    flex-shrink: 0;
    gap: 16px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.hamburger-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    border-radius: 1px;
    transition: all var(--transition);
}

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

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

.logo-icon {
    flex-shrink: 0;
    animation: spin-slow 12s linear infinite;
}

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

.logo-text {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    white-space: nowrap;
    color: var(--text-primary);
}

.logo-text span {
    color: var(--accent);
}

.header-center {
    flex: 1;
    max-width: 480px;
    min-width: 0;
}

.search-container {
    position: relative;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    pointer-events: none;
}

.search-input {
    width: 100%;
    height: 38px;
    padding: 0 36px 0 40px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

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

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-subtle);
    background: var(--bg-dark);
}

.search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 1.1rem;
    transition: all var(--transition-fast);
}

.search-clear:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.header-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.85rem;
    transition: all var(--transition-fast);
    white-space: nowrap;
    border: 1px solid var(--border);
}

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

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

.header-btn.btn-accent:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

/* ============================================
   MAIN LAYOUT
   ============================================ */

.main-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ============================================
   SIDEBAR
   ============================================ */

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-dark);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex-shrink: 0;
    padding: 12px 0;
    transition: transform var(--transition-slow);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.15);
    z-index: 199;
    opacity: 0;
    transition: opacity var(--transition);
}

.sidebar-overlay.active {
    opacity: 1;
}

.sidebar-section {
    padding: 8px 0;
}

.sidebar-section + .sidebar-section {
    border-top: 1px solid var(--border);
}

.sidebar-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-tertiary);
}

.sidebar-stores {
    margin-top: auto;
}

.store-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: all var(--transition-fast);
    border-radius: var(--radius-sm);
}

.store-link:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.store-link svg {
    opacity: 0.6;
    flex-shrink: 0;
}

.store-link:hover svg {
    opacity: 1;
}

.new-playlist-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    transition: all var(--transition-fast);
}

.new-playlist-btn:hover {
    background: var(--bg-hover);
    color: var(--accent);
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 16px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    text-align: left;
    position: relative;
}

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

.sidebar-item.active {
    color: var(--accent);
    background: var(--accent-subtle);
}

.sidebar-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 3px;
    background: var(--accent);
    border-radius: 0 2px 2px 0;
}

.sidebar-count {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
}

.playlist-list {
    display: flex;
    flex-direction: column;
}

.playlist-sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 16px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    text-align: left;
    position: relative;
    cursor: pointer;
}

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

.playlist-sidebar-item.active {
    color: var(--accent);
    background: var(--accent-subtle);
}

.playlist-sidebar-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 3px;
    background: var(--accent);
    border-radius: 0 2px 2px 0;
}

.playlist-sidebar-item svg {
    flex-shrink: 0;
    opacity: 0.6;
}

.playlist-sidebar-item .sidebar-count {
    margin-left: auto;
}

/* ============================================
   CONTENT AREA
   ============================================ */

.content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 20px;
    position: relative;
    background: var(--bg-darkest);
    background-image: 
        radial-gradient(ellipse at 70% 0%, rgba(233, 30, 139, 0.03) 0%, transparent 60%),
        radial-gradient(ellipse at 0% 100%, rgba(233, 30, 139, 0.02) 0%, transparent 50%);
}

.view {
    display: none;
    padding: 24px;
    animation: fadeIn 0.3s ease;
}

.view.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 16px;
    flex-wrap: wrap;
}

.view-header-left {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.view-title {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.view-subtitle {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
}

.view-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ============================================
   EMPTY STATE
   ============================================ */

.playlist-footer {
    padding: 16px 20px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
    letter-spacing: 0.02em;
}

/* Editable fields in playlist */
.editable-field {
    cursor: text;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    display: inline-block;
    min-width: 40px;
}

.editable-field:hover {
    border-color: var(--border);
    background: var(--bg-hover);
}

.editable-field.editing {
    border-color: var(--accent);
    background: var(--bg-dark);
    outline: none;
    box-shadow: 0 0 0 2px var(--accent-subtle);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
    gap: 12px;
}

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 0.9rem;
    color: var(--text-tertiary);
    max-width: 320px;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.85rem;
    transition: all var(--transition-fast);
    white-space: nowrap;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    background: var(--bg-elevated);
}

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

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

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

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border-color: var(--border);
}

.btn-danger {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

.btn-danger:hover {
    background: var(--danger-hover);
    border-color: var(--danger-hover);
    color: white;
}

.btn-danger-outline {
    color: var(--danger);
    border-color: var(--danger);
    background: transparent;
}

.btn-danger-outline:hover {
    background: var(--danger);
    color: white;
}

.btn-accent-outline {
    color: var(--accent);
    border-color: var(--accent);
    background: transparent;
}

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

.btn-small {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* Auto-play toggle */
.autoplay-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding: 6px 10px;
    border-radius: 6px;
    user-select: none;
    transition: background 0.15s;
}
.autoplay-toggle:hover {
    background: var(--bg-hover);
}
.autoplay-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
    margin: 0;
}
.autoplay-label {
    white-space: nowrap;
}

/* ============================================
   SONG TABLE
   ============================================ */

.table-container {
    overflow-x: auto;
}

.song-table {
    width: 100%;
    border-collapse: collapse;
}

.song-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg-darkest);
}

.song-table th {
    padding: 10px 12px;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-tertiary);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    user-select: none;
}

.song-table th.sortable {
    cursor: pointer;
    transition: color var(--transition-fast);
}

.song-table th.sortable:hover {
    color: var(--text-primary);
}

.song-table th.sortable.sort-asc .sort-arrow::after {
    content: ' ▲';
    font-size: 0.6rem;
}

.song-table th.sortable.sort-desc .sort-arrow::after {
    content: ' ▼';
    font-size: 0.6rem;
}

.song-table td {
    padding: 8px 12px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(42, 42, 42, 0.4);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
}

.song-table tbody tr {
    transition: background var(--transition-fast);
    cursor: pointer;
}

.song-table tbody tr:hover {
    background: var(--bg-hover);
}

.song-table tbody tr.playing {
    background: rgba(233, 30, 139, 0.15);
    border-left: 3px solid var(--accent);
}

.song-table tbody tr.playing td {
    color: var(--text-primary);
    font-weight: 500;
}

.song-table tbody tr.playing .song-title {
    color: var(--accent);
    font-weight: 600;
}

.song-table tbody tr.selected {
    background: rgba(233, 30, 139, 0.08);
}

.col-checkbox {
    width: 40px;
    text-align: center;
}

.col-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

.col-number {
    width: 40px;
    text-align: center;
    color: var(--text-tertiary) !important;
    font-family: var(--font-mono);
    font-size: 0.8rem !important;
}

.col-drag {
    width: 32px;
    text-align: center;
}

.col-title {
    min-width: 200px;
}

.col-artist {
    min-width: 150px;
}

.col-album {
    min-width: 150px;
}

.col-duration {
    width: 70px;
    text-align: right;
}

.col-duration svg {
    vertical-align: middle;
}

.col-actions {
    width: 120px;
    text-align: right;
    white-space: nowrap;
}

.song-title {
    color: var(--text-primary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.song-art-mini {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-elevated);
}

.song-art-placeholder {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.song-art-placeholder svg {
    opacity: 0.3;
}

.song-duration {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.row-action-btn {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    transition: all var(--transition-fast);
    opacity: 0;
}

.song-table tbody tr:hover .row-action-btn {
    opacity: 1;
}

.download-song-btn {
    opacity: 0.6 !important;
    color: var(--accent) !important;
}

.download-song-btn:hover {
    opacity: 1 !important;
}

.move-up-btn,
.move-down-btn {
    opacity: 0.6 !important;
}

.move-up-btn:hover,
.move-down-btn:hover {
    opacity: 1 !important;
}

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

.row-action-btn:disabled {
    opacity: 0.2 !important;
    cursor: default;
    pointer-events: none;
}

.col-actions {
    white-space: nowrap;
}

.drag-handle {
    cursor: grab;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-fast);
    min-width: 28px;
    min-height: 28px;
    font-size: 16px;
    touch-action: none;
}

.drag-handle:hover {
    color: var(--text-secondary);
}

#playlist-tbody tr {
    cursor: pointer;
}

#playlist-tbody tr:active {
    cursor: pointer;
}

.song-table tbody tr.dragging {
    opacity: 0.4;
    background: var(--accent-subtle);
    cursor: grabbing;
}

.song-table tbody tr.drag-over {
    border-top: 2px solid var(--accent);
    background: rgba(233, 30, 139, 0.1);
}

/* Playing animation indicator */
.playing-indicator {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 14px;
}

.playing-indicator span {
    display: block;
    width: 3px;
    background: var(--accent);
    border-radius: 1px;
    animation: equalizer 0.8s ease infinite;
}

.playing-indicator span:nth-child(1) { animation-delay: 0s; height: 60%; }
.playing-indicator span:nth-child(2) { animation-delay: 0.2s; height: 100%; }
.playing-indicator span:nth-child(3) { animation-delay: 0.4s; height: 40%; }

@keyframes equalizer {
    0%, 100% { transform: scaleY(0.3); }
    50% { transform: scaleY(1); }
}

/* ============================================
   NOW PLAYING BAR
   ============================================ */

.now-playing-bar {
    position: relative;
    background: linear-gradient(180deg, var(--bg-card) 0%, #f0f0f0 100%);
    border-bottom: 1px solid var(--border);
    z-index: 200;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.np-progress-container {
    position: relative;
    width: 100%;
    height: 4px;
    background: var(--bg-active);
    cursor: pointer;
    flex-shrink: 0;
    transition: height var(--transition-fast);
}

.np-progress-container:hover {
    height: 6px;
}

.np-progress-bar {
    height: 100%;
    background: var(--accent);
    width: 0%;
    transition: none;
    position: relative;
}

.np-progress-thumb {
    position: absolute;
    top: 50%;
    left: 0%;
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform var(--transition-fast);
    box-shadow: 0 0 6px var(--accent-glow);
    pointer-events: none;
}

.np-progress-container:hover .np-progress-thumb {
    transform: translate(-50%, -50%) scale(1);
}

.np-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 20px;
    gap: 16px;
}

.np-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
    max-width: 300px;
}

.np-art {
    width: 52px;
    height: 52px;
    border-radius: var(--radius);
    background: var(--bg-elevated);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

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

.np-info {
    min-width: 0;
}

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

.np-artist {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.np-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.np-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.np-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    position: relative;
}

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

.np-btn.active {
    color: var(--accent);
}

.np-play-btn {
    width: 44px;
    height: 44px;
    background: var(--accent);
    color: white;
    transition: all var(--transition-fast);
}

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

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

.np-play-btn.is-playing {
    box-shadow: 0 0 20px var(--accent-glow), 0 0 40px rgba(233, 30, 139, 0.15);
}

.np-time {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-tertiary);
}

.np-time-sep {
    opacity: 0.5;
}

.np-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    max-width: 200px;
    justify-content: flex-end;
}

.volume-slider-container {
    width: 100px;
    display: flex;
    align-items: center;
}

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

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--text-primary);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.volume-slider::-webkit-slider-thumb:hover {
    background: var(--accent);
}

.volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--text-primary);
    cursor: pointer;
    border: none;
}

.repeat-badge {
    position: absolute;
    bottom: 2px;
    right: 2px;
    font-size: 0.55rem;
    font-weight: 700;
    color: var(--accent);
    font-family: var(--font-mono);
}

/* ============================================
   UPLOAD OVERLAY
   ============================================ */

.upload-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 10, 0.92);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.upload-overlay-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 48px;
    border: 2px dashed var(--accent);
    border-radius: var(--radius-lg);
    animation: pulse-border 1.5s ease infinite;
}

@keyframes pulse-border {
    0%, 100% { border-color: var(--accent); }
    50% { border-color: transparent; }
}

.upload-overlay-inner p {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent);
}

/* ============================================
   CONTEXT MENU
   ============================================ */

.context-menu {
    position: fixed;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    z-index: 500;
    min-width: 220px;
    max-height: 400px;
    overflow-y: auto;
    padding: 4px;
    animation: contextIn 0.15s ease;
}

@keyframes contextIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.context-menu-title {
    padding: 8px 12px 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-tertiary);
}

.context-menu-items {
    display: flex;
    flex-direction: column;
}

.context-menu-item {
    padding: 8px 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 8px;
}

.context-menu-item:hover {
    background: var(--accent-subtle);
    color: var(--accent);
}

.context-menu-item.new-playlist-option {
    border-top: 1px solid var(--border);
    margin-top: 4px;
    padding-top: 12px;
    color: var(--accent);
    font-weight: 600;
}

.context-menu-actions {
    display: flex;
    flex-direction: column;
}

.context-menu-actions:not(:empty) {
    padding-bottom: 4px;
    margin-bottom: 2px;
    border-bottom: 1px solid var(--border);
}

.context-action-delete:hover {
    background: #fee2e2;
    color: #dc2626;
}

.context-action-remove:hover {
    background: #fef3c7;
    color: #d97706;
}

/* ============================================
   MODALS
   ============================================ */

.modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.2);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: 0 16px 64px rgba(0,0,0,0.12);
    width: 90%;
    max-width: 560px;
    max-height: 85vh;
    overflow-y: auto;
    animation: modalIn 0.3s ease;
}

.modal-small {
    max-width: 380px;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.3rem;
    color: var(--text-tertiary);
    transition: all var(--transition-fast);
}

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

.modal-body {
    padding: 20px 24px 24px;
}

.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 20px;
}

.text-input {
    width: 100%;
    height: 42px;
    padding: 0 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all var(--transition-fast);
}

.text-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

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

/* ============================================
   IMPORT MODAL SPECIFICS
   ============================================ */

.import-dropzone {
    border: 2px dashed var(--border-light);
    border-radius: var(--radius-lg);
    padding: 48px 32px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
}

.import-dropzone:hover {
    border-color: var(--accent);
    background: var(--accent-subtle);
}

.import-dropzone-icon {
    color: var(--text-tertiary);
    margin-bottom: 12px;
}

.import-dropzone-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.import-dropzone-sub {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    margin-top: 4px;
}

.import-progress {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 48px;
}

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

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

.import-summary h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.import-stats {
    display: flex;
    gap: 24px;
    margin-bottom: 20px;
}

.import-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 16px 24px;
    background: var(--bg-elevated);
    border-radius: var(--radius);
    flex: 1;
}

.import-stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent);
    font-family: var(--font-mono);
}

.import-stat-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.import-playlist-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.import-playlist-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

.import-playlist-item:hover {
    background: var(--bg-elevated);
}

.import-playlist-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    flex-shrink: 0;
}

.import-playlist-item .name {
    color: var(--text-primary);
    font-weight: 500;
    flex: 1;
}

.import-playlist-item .count {
    color: var(--text-tertiary);
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.import-select-row {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-elevated);
}

.import-select-row a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.import-select-row a:hover {
    text-decoration: underline;
}

.import-note {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    background: var(--bg-elevated);
    padding: 12px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    line-height: 1.5;
    border-left: 3px solid var(--accent);
}

.import-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.toast-container {
    position: fixed;
    top: calc(var(--header-height) + 12px);
    right: 20px;
    z-index: 400;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: 0 4px 24px rgba(0,0,0,0.1);
    font-size: 0.85rem;
    color: var(--text-primary);
    animation: toastIn 0.3s ease;
    max-width: 360px;
}

.toast.toast-out {
    animation: toastOut 0.3s ease forwards;
}

.toast-success {
    border-left: 3px solid var(--success);
}

.toast-error {
    border-left: 3px solid var(--danger);
}

.toast-info {
    border-left: 3px solid var(--accent);
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(20px); }
}

/* ============================================
   RESPONSIVE — TABLET
   ============================================ */

@media (max-width: 900px) {
    .col-album, .hide-tablet {
        display: none !important;
    }

    .np-left {
        max-width: 200px;
    }

    .volume-slider-container {
        width: 70px;
    }
}

/* ============================================
   RESPONSIVE — MOBILE
   ============================================ */

@media (max-width: 640px) {
    :root {
        --header-height: 56px;
    }

    .hamburger-btn {
        display: flex;
    }

    .sidebar {
        position: fixed;
        top: var(--header-height);
        left: 0;
        bottom: 0;
        z-index: 200;
        transform: translateX(-100%);
        width: 280px;
        background: var(--bg-dark);
    }

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

    .sidebar-overlay.active {
        display: block;
    }

    .logo-text {
        font-size: 1.1rem;
    }

    .header-center {
        display: none;
    }

    .btn-label {
        display: none;
    }

    .header-btn {
        padding: 0 10px;
        min-height: 44px;
        min-width: 44px;
        justify-content: center;
    }

    .view {
        padding: 12px;
    }

    .view-title {
        font-size: 1.35rem;
    }

    .view-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 12px;
    }

    .view-actions {
        width: 100%;
        flex-wrap: wrap;
        gap: 6px;
    }

    .view-actions .btn {
        min-height: 44px;
        font-size: 0.8rem;
    }

    .col-artist, .col-album, .hide-mobile {
        display: none !important;
    }

    /* ---- NOW PLAYING BAR — PHONE OPTIMIZED ---- */
    .now-playing-bar {
        border-bottom: none;
        border-top: 1px solid var(--border);
        box-shadow: 0 -2px 12px rgba(0,0,0,0.05);
    }

    .np-progress-container {
        height: 6px;
        order: -1;
    }

    .np-progress-container:hover {
        height: 6px;
    }

    .np-progress-thumb {
        transform: translate(-50%, -50%) scale(1);
        width: 16px;
        height: 16px;
    }

    .np-content {
        flex-wrap: nowrap;
        padding: 10px 12px 12px;
        gap: 10px;
        align-items: center;
    }

    .np-left {
        order: 1;
        flex: 1;
        max-width: none;
        min-width: 0;
    }

    .np-art {
        width: 48px;
        height: 48px;
    }

    .np-info {
        min-width: 0;
    }

    .np-title {
        font-size: 0.95rem;
    }

    .np-artist {
        font-size: 0.8rem;
    }

    .np-center {
        order: 2;
        flex: 0 0 auto;
        flex-direction: column;
        gap: 2px;
    }

    .np-controls {
        gap: 4px;
    }

    /* Bigger touch targets for all player buttons */
    .np-btn {
        width: 44px;
        height: 44px;
    }

    /* Prominent play/pause button */
    .np-play-btn {
        width: 56px;
        height: 56px;
    }

    .np-play-btn svg {
        width: 28px;
        height: 28px;
    }

    .np-right {
        display: none;
    }

    .np-time {
        font-size: 0.65rem;
    }

    .content {
        padding-bottom: 10px;
    }

    /* ---- TOUCH-FRIENDLY SONG ROWS ---- */
    .song-table td {
        padding: 14px 10px;
    }

    .song-table tbody tr {
        min-height: 52px;
    }

    .row-action-btn {
        opacity: 1;
        width: 40px;
        height: 40px;
    }

    .col-checkbox {
        width: 36px;
    }

    .col-checkbox input[type="checkbox"] {
        width: 20px;
        height: 20px;
    }

    .col-number {
        width: 30px;
    }

    .col-drag {
        width: 36px;
    }

    .drag-handle {
        min-width: 36px;
        min-height: 44px;
        font-size: 20px;
    }

    .col-actions {
        width: auto;
    }

    /* Song title takes full space */
    .song-table td.col-title {
        min-width: 0;
        max-width: none;
    }

    /* Duration column smaller */
    .col-duration {
        width: 50px;
    }

    /* Search on mobile: show below header on focus */
    .header {
        flex-wrap: nowrap;
        padding: 0 12px;
    }

    /* ---- SIDEBAR TOUCH TARGETS ---- */
    .sidebar-item {
        padding: 12px 16px;
        min-height: 48px;
        font-size: 0.95rem;
    }

    .playlist-sidebar-item {
        padding: 12px 16px;
        min-height: 48px;
        font-size: 0.95rem;
    }

    /* ---- MODALS FULLSCREEN ON PHONE ---- */
    .modal-content {
        width: 95%;
        max-height: 90vh;
    }

    /* ---- PLAYLIST VIEW ACTIONS GRID ---- */
    .view-actions .btn-small {
        padding: 8px 12px;
        min-height: 40px;
    }

    /* ---- TOAST POSITION ---- */
    .toast-container {
        right: 12px;
        left: 12px;
        top: calc(var(--header-height) + 8px);
    }

    .toast {
        max-width: none;
    }

    /* ---- CONTEXT MENU ON MOBILE ---- */
    .context-menu {
        left: 8px !important;
        right: 8px !important;
        max-width: none;
        width: auto;
    }

    .context-menu-item {
        padding: 12px;
        min-height: 44px;
    }
}

/* ============================================
   LOADING UPLOAD PROGRESS
   ============================================ */

.upload-progress-bar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    height: 3px;
    z-index: 150;
    background: var(--bg-active);
}

.upload-progress-bar-inner {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #ff6ec7);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 0 2px 2px 0;
    box-shadow: 0 0 10px var(--accent-glow);
}

/* ============================================
   MOBILE SEARCH TOGGLE
   ============================================ */

.mobile-search-bar {
    display: none;
    padding: 8px 16px;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border);
}

@media (max-width: 640px) {
    .mobile-search-bar.active {
        display: block;
    }
}

/* ============================================
   SELECTION STYLES
   ============================================ */

::selection {
    background: var(--accent);
    color: white;
}

/* ============================================
   LOGIN OVERLAY
   ============================================ */

.login-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-darkest);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background-image:
        radial-gradient(ellipse at 30% 20%, rgba(233, 30, 139, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 80%, rgba(233, 30, 139, 0.05) 0%, transparent 50%);
}

.login-overlay.hidden {
    display: none !important;
}

.login-box {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 80px rgba(0,0,0,0.12), 0 0 0 1px rgba(233, 30, 139, 0.08);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    animation: modalIn 0.4s ease;
}

.login-logo {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
    justify-content: center;
    flex-direction: column;
    text-align: center;
}

.login-logo-icon {
    animation: spin-slow 12s linear infinite;
}

.login-logo-text h1 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    line-height: 1.2;
}

.login-logo-text h1 span {
    color: var(--accent);
}

.login-logo-text p {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.login-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-elevated);
    border-radius: var(--radius);
    padding: 4px;
    margin-bottom: 28px;
}

.login-tab {
    flex: 1;
    height: 36px;
    border-radius: calc(var(--radius) - 2px);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-tertiary);
    transition: all var(--transition-fast);
}

.login-tab:hover {
    color: var(--text-secondary);
    background: var(--bg-hover);
}

.login-tab.active {
    background: var(--bg-active);
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-form.hidden {
    display: none !important;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.login-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.login-input {
    height: 44px;
    padding: 0 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all var(--transition-fast);
    width: 100%;
}

.login-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-subtle);
    background: var(--bg-dark);
}

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

.login-error {
    padding: 10px 14px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius);
    color: #dc2626;
    font-size: 0.85rem;
    line-height: 1.4;
}

.login-error.hidden {
    display: none !important;
}

.login-btn {
    height: 46px;
    background: var(--accent);
    color: white;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
    border: 1px solid var(--accent);
}

.login-btn:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px var(--accent-glow);
}

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

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.login-btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.login-btn-spinner.hidden {
    display: none !important;
}

/* ============================================
   USER AREA IN HEADER
   ============================================ */

.user-area {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 8px;
    border-left: 1px solid var(--border);
    margin-left: 4px;
}

.user-area.hidden {
    display: none !important;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

.user-info svg {
    color: var(--accent);
    flex-shrink: 0;
}

.user-display-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logout-btn {
    color: var(--text-tertiary);
}

.logout-btn:hover {
    color: var(--danger);
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.08);
}

@media (max-width: 640px) {
    .user-display-name {
        display: none;
    }
    .user-area {
        padding-left: 4px;
    }
}

/* ============================================
   SHARED PLAYLIST SIDEBAR STYLES
   ============================================ */

.playlist-sidebar-item .shared-icon {
    margin-left: auto;
    color: var(--accent);
    opacity: 0.7;
    flex-shrink: 0;
}

.playlist-sidebar-item .sidebar-count {
    margin-left: 0;
}

.playlist-sidebar-item.has-shared-icon .sidebar-count {
    margin-left: 0;
}

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

.playlist-sidebar-info .playlist-sidebar-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.playlist-sidebar-info .playlist-sidebar-sharedby {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   PLAYLIST VIEW — SHARED INDICATOR
   ============================================ */

.playlist-shared-by {
    font-size: 0.8rem;
    color: var(--accent-text);
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
}

.playlist-shared-by.hidden {
    display: none !important;
}

/* ============================================
   SHARE MODAL
   ============================================ */

.share-modal-name {
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 16px;
    font-size: 1rem;
}

.share-add-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
}

.share-select {
    flex: 1;
    height: 42px;
    padding: 0 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
}

.share-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

.share-select option {
    background: var(--bg-card);
    color: var(--text-primary);
}

.share-current-list {
    margin-top: 12px;
}

.share-current-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-tertiary);
    margin-bottom: 8px;
}

.share-current-empty {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    padding: 8px 0;
}

.share-user-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

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

.share-user-icon {
    width: 28px;
    height: 28px;
    background: var(--bg-elevated);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    flex-shrink: 0;
}

.share-user-name {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
}

.share-remove-btn {
    font-size: 0.75rem;
    padding: 4px 10px;
    height: 28px;
    border-radius: var(--radius-sm);
    color: var(--danger);
    border: 1px solid var(--danger);
    background: transparent;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.share-remove-btn:hover {
    background: var(--danger);
    color: white;
}

/* ============================================
   OFFLINE DOWNLOAD STYLES
   ============================================ */

.btn-offline {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.btn-offline:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
    color: var(--accent);
}

.btn-offline.btn-offline-active {
    background: rgba(232, 97, 77, 0.1);
    color: var(--accent);
    border-color: var(--accent);
}

.btn-offline.btn-offline-active:hover {
    background: rgba(232, 97, 77, 0.15);
}

.btn-offline.btn-offline-downloading {
    background: rgba(232, 97, 77, 0.08);
    color: var(--accent);
    border-color: var(--accent);
    animation: pulse-border 1.5s ease-in-out infinite;
}

@keyframes pulse-border {
    0%, 100% { border-color: var(--accent); opacity: 1; }
    50% { border-color: var(--border); opacity: 0.7; }
}

.offline-icon {
    flex-shrink: 0;
    opacity: 0.8;
}

.offline-progress {
    font-size: 10px;
    color: var(--accent);
    font-weight: 600;
    flex-shrink: 0;
    padding: 1px 5px;
    background: rgba(232, 97, 77, 0.1);
    border-radius: 8px;
    animation: pulse-border 1.5s ease-in-out infinite;
}

