/* ================================
   RoseTech Jams – Base Theme
   ================================ */

:root {
    --bg-main: #050317;           /* deep ink / purple */
    --bg-surface: #050317;
    --bg-card: #05071e;

    --accent: #ec4899;            /* magenta/pink */
    --accent-secondary: #22d3ee;  /* cyan */
    --accent-soft: rgba(236, 72, 153, 0.15);
    --accent-strong: rgba(236, 72, 153, 0.95);

    --text-main: #e5e7eb;
    --text-muted: #a5b4fc;        /* soft indigo */
    --text-faint: #6b7280;

    --border-subtle: rgba(129, 140, 248, 0.35);
    --border-strong: rgba(236, 72, 153, 0.9);

    --shadow-card: 0 18px 40px rgba(0, 0, 0, 0.95);

    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-pill: 999px;

    --font-main: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
                 sans-serif;

    --input-bg: rgba(15, 23, 42, 0.8);
    --input-border: rgba(55, 65, 81, 0.9);

    --scrollbar-track: rgba(10, 16, 35, 0.9);
    --scrollbar-thumb: rgba(55, 65, 81, 1);

    --danger: #f97373;
}

/* ================================
   Reset
   ================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    background:
      radial-gradient(circle at top left, rgba(236,72,153,0.25), transparent 55%),
      radial-gradient(circle at top right, rgba(56,189,248,0.18), transparent 55%),
      radial-gradient(circle at bottom, rgba(15,23,42,0.9), #020014 80%);
    color: var(--text-main);
    font-family: var(--font-main);
}

/* ================================
   App Layout
   ================================ */

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.top-bar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    background: radial-gradient(circle at top, rgba(15,23,42,0.98), rgba(15,23,42,0.92));
    border-bottom: 1px solid rgba(15,23,42,1);
    box-shadow: 0 18px 50px rgba(0,0,0,0.95);
    backdrop-filter: blur(18px);
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.logo-mark {
    width: 18px;
    height: 18px;
    border-radius: 6px;
    background: conic-gradient(from 180deg, var(--accent), var(--accent-secondary), var(--accent));
    display: inline-block;
    box-shadow: 0 0 16px rgba(236, 72, 153, 0.8);
}

.logo-text {
    opacity: 0.9;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.status-dot.online {
    background: #22c55e;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.9);
}

.status-dot.offline {
    background: #f87171;
    box-shadow: 0 0 10px rgba(248, 113, 113, 0.95);
}

/* ================================
   Main Layout – 3 columns via grid areas
   LEFT: nav/search
   CENTER: wide results
   RIGHT: now playing + queue
   ================================ */

.main-grid {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.7fr) minmax(0, 1.15fr);
    grid-template-areas: "nav results side";
    gap: 18px;
    padding: 18px 24px 24px;
}

/* Explicit areas so things never swap */
.nav-column {
    grid-area: nav;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.results-column {
    grid-area: results;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.right-column {
    grid-area: side;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.center-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    text-align: center;
}

.center-box h1 {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.center-box p {
    color: var(--text-muted);
    max-width: 420px;
    margin-bottom: 20px;
}

/* Responsive */

@media (max-width: 1100px) {
    .main-grid {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "nav"
            "results"
            "side";
        padding: 16px;
    }
}

@media (max-width: 640px) {
    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}

/* ================================
   Cards
   ================================ */

.card {
    background:
      radial-gradient(circle at top left, rgba(15,23,42,0.95), rgba(15,23,42,0.98));
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 16px 16px 14px;
    border: 1px solid rgba(30, 64, 175, 0.7);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid transparent;
    background: linear-gradient(135deg, rgba(236,72,153,0.45), rgba(56,189,248,0.3));
    mix-blend-mode: screen;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.card:hover::before {
    opacity: 0.22;
}

.card h2 {
    margin: 0 0 8px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--text-muted);
}

/* ================================
   Now Playing – compact notif style
   ================================ */

.now-playing {
    padding: 12px 12px 10px;
}

.now-playing-info {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.now-playing-info .cover {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    background: radial-gradient(circle at top, rgba(55,65,81,0.9), rgba(15,23,42,1));
    background-size: cover;
    background-position: center;
    box-shadow: 0 16px 32px rgba(0,0,0,0.95);
    flex-shrink: 0;
}

.now-playing-info .meta {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.track-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-artist {
    font-size: 0.8rem;
    color: var(--text-main);
    opacity: 0.9;
    margin-bottom: 2px;
}

.track-album {
    font-size: 0.7rem;
    color: var(--text-faint);
}

/* Progress / seek */

.progress-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

#seekBar {
    flex: 1;
}

/* Controls */

.controls-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.controls-row-main {
    justify-content: center;
    margin-top: 4px;
    margin-bottom: 4px;
}

.controls-row-secondary {
    justify-content: space-between;
    margin-bottom: 6px;
}

/* Volume & devices (compact for small card) */

.small-device-row {
    font-size: 0.75rem;
    margin-bottom: 4px;
}

.small-device-row select {
    flex: 1;
    min-width: 0;
}

.compact-volume {
    justify-content: flex-end;
    font-size: 0.75rem;
}

.compact-volume input[type="range"] {
    width: 80px;
}

/* Queue card */

.queue-card .scroll-list {
    max-height: 280px;
}

/* ================================
   Library & Search
   ================================ */

.library-card,
.search-controls-card,
.results-card {
    min-height: 0;
}

.hint-text {
    margin: 4px 2px 0;
    font-size: 0.75rem;
    color: var(--text-faint);
}

.tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
}

.tab {
    flex: 0 0 auto;
    border-radius: 999px;
    border: 1px solid rgba(55,65,81,1);
    padding: 4px 12px;
    font-size: 0.78rem;
    background: rgba(15,23,42,0.85);
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}

.tab.active {
    background: radial-gradient(circle at top, rgba(236,72,153,0.2), rgba(236,72,153,0.95));
    border-color: rgba(236,72,153,0.95);
    color: #fdf2ff;
    box-shadow: 0 0 18px rgba(236,72,153,0.65);
}

/* Search rows */

.search-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.search-row input[type="text"] {
    flex: 1;
}

/* Scrollable lists */

.scroll-list {
    margin-top: 4px;
    border-radius: var(--radius-md);
    background: linear-gradient(to bottom right, rgba(15,23,42,0.98), rgba(15,23,42,0.96));
    border: 1px solid rgba(30, 64, 175, 0.7);
    padding: 4px 4px;
    max-height: 360px;
    overflow-y: auto;
}

/* Custom scrollbar */

.scroll-list::-webkit-scrollbar {
    width: 8px;
}

.scroll-list::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 999px;
}

.scroll-list::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 999px;
}

/* List items */

.list-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--text-muted);
    padding: 6px 8px 4px;
    opacity: 0.9;
}

.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 8px;
    border-radius: 10px;
    cursor: default;
    gap: 8px;
    transition: background 0.12s ease, transform 0.08s ease;
}

.list-item:hover {
    background: rgba(30,64,175,0.55);
    transform: translateY(-0.5px);
}

.list-main {
    min-width: 0;
}

.list-title {
    font-size: 0.83rem;
    font-weight: 500;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.list-sub {
    font-size: 0.75rem;
    color: var(--text-faint);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

/* ================================
   Buttons & Inputs
   ================================ */

.btn {
    border-radius: var(--radius-pill);
    border: 1px solid rgba(55,65,81,1);
    background: radial-gradient(circle at top, rgba(15,23,42,0.95), rgba(15,23,42,1));
    color: var(--text-main);
    padding: 6px 12px;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    gap: 6px;
    transition: background 0.12s ease, border-color 0.12s ease, transform 0.08s ease, box-shadow 0.12s ease;
    white-space: nowrap;
}

.btn:hover {
    border-color: rgba(236,72,153,0.9);
    box-shadow: 0 12px 26px rgba(0,0,0,0.9);
    transform: translateY(-0.5px);
}

.btn.primary {
    background: radial-gradient(circle at top, rgba(236,72,153,0.28), rgba(236,72,153,0.98));
    border-color: rgba(236,72,153,1);
    color: #fdf2ff;
    padding-inline: 18px;
    box-shadow: 0 12px 32px rgba(236,72,153,0.7);
}

.btn.small {
    padding: 4px 10px;
    font-size: 0.75rem;
}

.btn.icon {
    padding: 6px 8px;
    width: 34px;
    height: 34px;
    border-radius: 999px;
}

.btn.icon span {
    font-size: 0.9rem;
}

.play-btn {
    transform: scale(1.05);
}

/* Toggle buttons (shuffle / repeat) */

.toggle-btn {
    min-width: 80px;
    justify-content: center;
}

.toggle-btn.active {
    background: linear-gradient(135deg, rgba(236,72,153,0.25), rgba(236,72,153,0.98));
    border-color: rgba(236,72,153,0.9);
}

/* Inputs */

input[type="text"],
select {
    background: var(--input-bg);
    border-radius: var(--radius-pill);
    border: 1px solid var(--input-border);
    color: var(--text-main);
    font-size: 0.8rem;
    padding: 7px 10px;
    outline: none;
    transition: border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

input[type="text"]::placeholder {
    color: var(--text-faint);
}

input[type="text"]:focus,
select:focus {
    border-color: var(--accent-strong);
    box-shadow: 0 0 0 1px rgba(236,72,153,0.35);
    background: rgba(15,23,42,1);
}

/* Sliders */

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 5px;
    border-radius: 999px;
    background: rgba(31, 41, 55, 1);
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 0 2px rgba(15,23,42,0.9);
    cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: var(--accent);
    border: 2px solid rgba(15,23,42,0.9);
    cursor: pointer;
}

/* ================================
   Toast / Notification
   ================================ */

.rt-toast {
    position: fixed;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    padding: 9px 16px;
    border-radius: 999px;
    font-size: 0.82rem;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(148,163,184,0.4);
    background: rgba(15,23,42,0.96);
    color: #e5e7eb;
    box-shadow: 0 14px 30px rgba(0,0,0,0.9);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 9999;
}

.rt-toast-info {
    border-color: rgba(96,165,250,0.7);
}

.rt-toast-error {
    border-color: rgba(248,113,113,0.85);
}

/* ================================
   Footer
   ================================ */

.footer {
    padding: 10px 18px 14px;
    font-size: 0.8rem;
    color: var(--text-faint);
    display: flex;
    justify-content: center;
    border-top: 1px solid rgba(15,23,42,0.95);
    background: radial-gradient(circle at bottom, rgba(15,23,42,0.98), rgba(15,23,42,1));
}
