/* ═══════════════════════════════════════════════════════════════════════════
   Kurdish Music Bot — Spotify Dark Theme + Roj (Kurdish Sun Mascot)
   RTL-first, mobile-optimized for Telegram Mini App
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── SVG Icon Base ──────────────────────────────────────────────────────── */
.icon {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

.section-title .icon,
.page-title .icon,
.search-section-title .icon,
.genre-dist-title .icon {
    vertical-align: -0.15em;
    margin-inline-end: 2px;
}

.region-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    vertical-align: middle;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.1);
}

.page-title .region-dot {
    width: 16px;
    height: 16px;
}

.tag .region-dot {
    width: 10px;
    height: 10px;
}

.song-card-icon-wrap {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.song-detail-icon-wrap {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── CSS Variables ──────────────────────────────────────────────────────── */
:root {
    /* Spotify-authentic dark palette */
    --bg-primary: #121212;
    --bg-secondary: #181818;
    --bg-elevated: #282828;
    --bg-card: #2a2a2a;
    --bg-card-hover: #333333;
    --bg-highlight: #3a3a3a;

    /* Text — clear hierarchy */
    --text-primary: #ebebeb;
    --text-secondary: #b3b3b3;
    --text-muted: #6a6a6a;
    --text-bright: #ffffff;

    /* Accent — Spotify green */
    --accent: #1db954;
    --accent-hover: #1ed760;
    --accent-dim: rgba(29, 185, 84, 0.15);
    --accent-gradient: linear-gradient(135deg, #1db954, #1ed760);

    /* Warm secondary — sun gold for Roj mascot */
    --sun: #fbbf24;
    --sun-light: #fcd34d;
    --sun-dim: rgba(251, 191, 36, 0.12);
    --sun-gradient: linear-gradient(135deg, #fbbf24, #f59e0b);

    --danger: #ef4444;
    --overlay: rgba(0, 0, 0, 0.75);

    --card-radius: 8px;
    --radius-sm: 6px;
    --radius-lg: 14px;
    --radius-full: 999px;

    --gap: 16px;
    --nav-height: 62px;

    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);

    --transition-fast: 0.12s ease;
    --transition-base: 0.2s ease;
    --transition-slow: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}


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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    overscroll-behavior: none;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Noto Sans Arabic", "Noto Kufi Arabic", sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    overscroll-behavior: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

button {
    border: none;
    cursor: pointer;
    font-family: inherit;
    background: none;
    color: inherit;
    -webkit-tap-highlight-color: transparent;
}

input {
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
}


/* ── App Layout ─────────────────────────────────────────────────────────── */
#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
}

#content {
    flex: 1;
    padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px) + 12px);
    min-height: calc(100vh - var(--nav-height));
    min-height: calc(100dvh - var(--nav-height));
}


/* ── Bottom Tab Navigation ──────────────────────────────────────────────── */
#tab-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: var(--nav-height);
    background: rgba(18, 18, 18, 0.95);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    padding-bottom: env(safe-area-inset-bottom, 0);
    border-top: 1px solid rgba(255,255,255,0.08);
}

.tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 1;
    height: 100%;
    color: var(--text-muted);
    font-size: 0.6rem;
    transition: color var(--transition-fast);
    position: relative;
}

.tab.active {
    color: var(--text-bright);
}

.tab-icon-svg {
    width: 24px;
    height: 24px;
    transition: transform var(--transition-fast);
}

.tab.active .tab-icon-svg {
    transform: scale(1.05);
}

.tab-label {
    font-weight: 600;
    letter-spacing: -0.01em;
}

.tab.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2.5px;
    background: var(--accent);
    border-radius: 0 0 3px 3px;
}


/* ── Search Overlay ─────────────────────────────────────────────────────── */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px));
    z-index: 300;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    transition: opacity var(--transition-base), transform var(--transition-base);
}

.search-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(16px);
}

.search-overlay-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px var(--gap);
    padding-top: calc(12px + env(safe-area-inset-top, 0px));
    background: var(--bg-secondary);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.search-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-highlight);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
}

.search-icon-svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-input-wrap input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    min-width: 0;
}

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

.search-clear-btn {
    padding: 2px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-clear-btn.hidden { display: none; }

.search-cancel-btn {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 600;
    white-space: nowrap;
    padding: 8px 4px;
}

.search-results-area {
    flex: 1;
    overflow-y: auto;
    padding: var(--gap);
    -webkit-overflow-scrolling: touch;
}


/* ── Roj Mascot (Kurdish Sun Character) ─────────────────────────────────── */
.roj {
    display: inline-block;
    position: relative;
}

/* Main mascot - used in hero greeting */
.roj-mascot {
    width: 72px;
    height: 72px;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.roj-mascot-sm {
    width: 40px;
    height: 40px;
}

.roj-mascot-lg {
    width: 96px;
    height: 96px;
}

/* Sun body */
.roj-body {
    width: 100%;
    height: 100%;
    background: var(--sun-gradient);
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.3),
                0 0 60px rgba(251, 191, 36, 0.1);
    animation: rojFloat 3s ease-in-out infinite;
}

.roj-mascot-sm .roj-body {
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.25);
}

/* Rays */
.roj-rays {
    position: absolute;
    inset: -20%;
    animation: rojSpin 20s linear infinite;
}

.roj-mascot-sm .roj-rays {
    inset: -18%;
}

.roj-ray {
    position: absolute;
    width: 8%;
    height: 20%;
    background: var(--sun);
    border-radius: 4px;
    left: 50%;
    top: 0;
    margin-left: -4%;
    transform-origin: 50% 250%;
    opacity: 0.7;
}

.roj-ray:nth-child(1)  { transform: rotate(0deg); }
.roj-ray:nth-child(2)  { transform: rotate(30deg); }
.roj-ray:nth-child(3)  { transform: rotate(60deg); }
.roj-ray:nth-child(4)  { transform: rotate(90deg); }
.roj-ray:nth-child(5)  { transform: rotate(120deg); }
.roj-ray:nth-child(6)  { transform: rotate(150deg); }
.roj-ray:nth-child(7)  { transform: rotate(180deg); }
.roj-ray:nth-child(8)  { transform: rotate(210deg); }
.roj-ray:nth-child(9)  { transform: rotate(240deg); }
.roj-ray:nth-child(10) { transform: rotate(270deg); }
.roj-ray:nth-child(11) { transform: rotate(300deg); }
.roj-ray:nth-child(12) { transform: rotate(330deg); }

/* Face */
.roj-face {
    position: absolute;
    inset: 22%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18%;
    flex-wrap: wrap;
}

.roj-eye {
    width: 14%;
    height: 20%;
    background: #78350f;
    border-radius: 50%;
    position: relative;
}

.roj-eye::after {
    content: '';
    position: absolute;
    width: 40%;
    height: 40%;
    background: #fff;
    border-radius: 50%;
    top: 15%;
    right: 15%;
}

.roj-mouth {
    width: 40%;
    height: 16%;
    border: 2.5px solid #78350f;
    border-top: none;
    border-radius: 0 0 50% 50%;
    position: absolute;
    bottom: 28%;
    left: 30%;
}

/* Roj expressions */
.roj-wink .roj-eye:first-child {
    height: 3px;
    border-radius: 3px;
    align-self: center;
    margin-top: 8%;
}

.roj-happy .roj-mouth {
    height: 22%;
    border-width: 3px;
}

/* Animations */
@keyframes rojFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

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

@keyframes rojBounce {
    0%, 100% { transform: scale(1) translateY(0); }
    30% { transform: scale(1.05) translateY(-6px); }
    50% { transform: scale(0.98) translateY(0); }
    70% { transform: scale(1.02) translateY(-2px); }
}

.roj-bounce {
    animation: rojBounce 0.6s ease-out;
}

/* Roj inline (for text) */
.roj-inline {
    display: inline-flex;
    width: 1.3em;
    height: 1.3em;
    vertical-align: -0.2em;
}

.roj-inline .roj-body {
    box-shadow: none;
    animation: none;
}

.roj-inline .roj-rays {
    display: none;
}


/* ── Loading ────────────────────────────────────────────────────────────── */
.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px 20px;
    gap: 20px;
}

.loader-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

/* Inline spinner */
.loading-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
}

.spinner {
    width: 28px;
    height: 28px;
    border: 2.5px solid var(--bg-highlight);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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


/* ── Skeleton Loading ───────────────────────────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg, #222222 25%, #2e2e2e 50%, #222222 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

[dir="rtl"] .skeleton {
    animation: shimmerRtl 1.5s ease-in-out infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes shimmerRtl {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton-card {
    width: 140px;
    flex-shrink: 0;
}

.skeleton-card .skeleton-img {
    width: 140px;
    height: 140px;
    border-radius: var(--card-radius);
    margin-bottom: 8px;
}

.skeleton-card .skeleton-text {
    height: 12px;
    margin-bottom: 6px;
    width: 100%;
}

.skeleton-card .skeleton-text-sm {
    height: 10px;
    width: 70%;
}

.skeleton-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
}

.skeleton-row .skeleton-circle {
    width: 48px;
    height: 48px;
    border-radius: var(--card-radius);
    flex-shrink: 0;
}

.skeleton-row .skeleton-lines {
    flex: 1;
}

.skeleton-row .skeleton-line {
    height: 12px;
    margin-bottom: 6px;
    width: 65%;
}

.skeleton-row .skeleton-line:last-child {
    width: 40%;
    margin-bottom: 0;
}


/* ── Hero Section ───────────────────────────────────────────────────────── */
.hero {
    position: relative;
    padding: 16px var(--gap) 12px;
    background: linear-gradient(180deg, rgba(29, 185, 84, 0.08) 0%, transparent 70%);
    display: flex;
    align-items: center;
    gap: 10px;
}

.hero-roj {
    flex-shrink: 0;
    margin-top: 2px;
}

.hero-content {
    flex: 1;
    min-width: 0;
}

.hero-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-bright);
    margin-bottom: 12px;
    line-height: 1.3;
}

.hero-title em {
    font-style: normal;
    color: var(--accent);
}

.hero-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.hero-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-card);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: background var(--transition-fast), transform var(--transition-fast);
}

.hero-chip:active {
    transform: scale(0.95);
    background: var(--bg-card-hover);
}

.hero-chip-icon {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}


/* ── Section ────────────────────────────────────────────────────────────── */
.section {
    padding: 0 var(--gap);
    margin-bottom: 28px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-bright);
}

.section-more {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 700;
    letter-spacing: 0.03em;
    white-space: nowrap;
    transition: color var(--transition-fast);
}

.section-more:active {
    color: var(--text-primary);
}


/* ── Horizontal Scroll Carousel ─────────────────────────────────────────── */
.carousel {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 0 var(--gap);
    margin: 0 calc(var(--gap) * -1);
    scrollbar-width: none;
}

.carousel::-webkit-scrollbar { display: none; }

.carousel > * {
    scroll-snap-align: start;
}


/* ── Genre Card (Carousel) ──────────────────────────────────────────────── */
.genre-card-wrap {
    flex-shrink: 0;
    width: 130px;
}

.genre-card {
    width: 130px;
    height: 130px;
    border-radius: var(--card-radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-fast);
    color: #fff;
}

.genre-card:active {
    transform: scale(0.96);
}

/* Muted gradient backgrounds per genre — Spotify-style browse cards */
.genre-card[data-color="dance"]    { background: linear-gradient(150deg, #8b5cf6, #6d28d9); }
.genre-card[data-color="vocal"]    { background: linear-gradient(150deg, #148a70, #0e7060); }
.genre-card[data-color="drum"]     { background: linear-gradient(150deg, #c0392b, #96281b); }
.genre-card[data-color="epic"]     { background: linear-gradient(150deg, #546e7a, #37474f); }
.genre-card[data-color="song"]     { background: linear-gradient(150deg, #4a6cf7, #3452d9); }
.genre-card[data-color="love"]     { background: linear-gradient(150deg, #d63384, #a5296a); }
.genre-card[data-color="autumn"]   { background: linear-gradient(150deg, #c57d20, #9a6218); }
.genre-card[data-color="lament"]   { background: linear-gradient(150deg, #607d8b, #455a64); }
.genre-card[data-color="field"]    { background: linear-gradient(150deg, #2d8f4e, #1e6b3a); }
.genre-card[data-color="group"]    { background: linear-gradient(150deg, #7e57c2, #5e35a1); }
.genre-card[data-color="pop"]      { background: linear-gradient(150deg, #e84393, #c0392b); }
.genre-card[data-color="other"]    { background: linear-gradient(150deg, #546e7a, #37474f); }
.genre-card[data-color="default"]  { background: linear-gradient(150deg, var(--bg-card), var(--bg-highlight)); }

.genre-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.genre-card-icon .icon {
    width: 2rem;
    height: 2rem;
}

.genre-card-name {
    font-size: 0.78rem;
    font-weight: 700;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    line-height: 1.2;
    padding: 0 4px;
}

.genre-card-count {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.75);
}


/* ── Song Card (Carousel) ───────────────────────────────────────────────── */
.song-card {
    flex-shrink: 0;
    width: 140px;
    transition: transform var(--transition-fast);
}

.song-card:active {
    transform: scale(0.96);
}

.song-card-art {
    width: 140px;
    height: 140px;
    border-radius: var(--card-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    position: relative;
    overflow: hidden;
    background: var(--song-bg, #2a2a2a);
}

.song-card-art-bg {
    position: absolute;
    inset: 0;
    opacity: 0.18;
    background: var(--song-tint, linear-gradient(150deg, #4a6cf7, #2d8f4e));
}

.song-card-play {
    position: absolute;
    bottom: 8px;
    left: 8px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity var(--transition-base), transform var(--transition-base);
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

[dir="rtl"] .song-card-play {
    left: auto;
    right: 8px;
}

.song-card:hover .song-card-play,
.song-card:active .song-card-play {
    opacity: 1;
    transform: translateY(0);
}

.song-card-play svg {
    width: 14px;
    height: 14px;
    color: #000;
    margin-left: 2px;
}

.song-card-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.song-card-artist {
    font-size: 0.72rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* ── Song List (Vertical) ───────────────────────────────────────────────── */
.song-list {
    display: flex;
    flex-direction: column;
}

.song-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 2px;
    color: var(--text-primary);
    transition: background var(--transition-fast);
    border-radius: var(--radius-sm);
}

.song-item:active {
    background: rgba(255,255,255,0.05);
}

.song-item-index {
    font-size: 0.82rem;
    color: var(--text-muted);
    width: 22px;
    text-align: center;
    flex-shrink: 0;
    font-weight: 500;
}

.song-item-art {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    background: var(--song-bg, #2a2a2a);
}

.song-item-art-bg {
    position: absolute;
    inset: 0;
    opacity: 0.2;
    background: var(--song-tint, linear-gradient(150deg, #4a6cf7, #2d8f4e));
}

.song-item-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

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

.song-item-subtitle {
    font-size: 0.76rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-item-meta {
    flex-shrink: 0;
    text-align: start;
    font-size: 0.7rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.song-rating {
    color: var(--sun);
    font-size: 0.7rem;
    display: inline-flex;
    align-items: center;
    gap: 1px;
}


/* ── Artist Card ────────────────────────────────────────────────────────── */
.artist-card {
    flex-shrink: 0;
    width: 110px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: transform var(--transition-fast);
}

.artist-card:active {
    transform: scale(0.96);
}

.artist-card-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--bg-highlight);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.artist-card-name {
    font-size: 0.78rem;
    font-weight: 600;
    text-align: center;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}


/* ── Artist List (Vertical) ─────────────────────────────────────────────── */
.artist-list {
    display: flex;
    flex-direction: column;
}

.artist-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 2px;
    color: var(--text-primary);
    transition: background var(--transition-fast);
}

.artist-item:active {
    background: rgba(255,255,255,0.05);
}

.artist-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-highlight);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    flex-shrink: 0;
}

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

.artist-name {
    font-size: 0.9rem;
    font-weight: 600;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.artist-song-count {
    font-size: 0.75rem;
    color: var(--text-secondary);
}


/* ── Artist Profile ─────────────────────────────────────────────────────── */
.artist-hero {
    text-align: center;
    padding: 32px var(--gap) 24px;
    background: linear-gradient(180deg, rgba(29,185,84,0.08) 0%, transparent 100%);
}

.artist-hero-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--bg-highlight);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 auto 16px;
    box-shadow: var(--shadow-lg);
}

.artist-hero-name {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text-bright);
}

.artist-hero-bio {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 12px;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.artist-hero-tags {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}


/* ── Playlist Card ──────────────────────────────────────────────────────── */
.playlist-card {
    flex-shrink: 0;
    width: 140px;
    transition: transform var(--transition-fast);
}

.playlist-card:active {
    transform: scale(0.96);
}

.playlist-card-art {
    width: 140px;
    height: 140px;
    border-radius: var(--card-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    background: linear-gradient(150deg, #2a3a2a, #1e3a2e);
    color: var(--accent);
}

.playlist-card-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-card-desc {
    font-size: 0.72rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* ── Playlist List (Vertical) ───────────────────────────────────────────── */
.playlist-list {
    display: flex;
    flex-direction: column;
}

.playlist-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 2px;
    color: var(--text-primary);
    transition: background var(--transition-fast);
}

.playlist-item:active {
    background: rgba(255,255,255,0.05);
}

.playlist-item-art {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: linear-gradient(150deg, #2a3a2a, #1e3a2e);
    color: var(--accent);
}

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

.playlist-item-name {
    font-size: 0.9rem;
    font-weight: 600;
    display: block;
}

.playlist-item-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* ── Region Grid ────────────────────────────────────────────────────────── */
.region-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.region-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-elevated);
    border-radius: var(--card-radius);
    color: var(--text-primary);
    transition: transform var(--transition-fast), background var(--transition-fast);
}

.region-card:active {
    transform: scale(0.97);
    background: var(--bg-card-hover);
}

.region-icon { display: inline-flex; align-items: center; line-height: 1; }

.region-icon .region-dot { width: 16px; height: 16px; }

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

.region-name { font-size: 0.85rem; font-weight: 600; display: block; }

.region-count { font-size: 0.7rem; color: var(--text-secondary); }


/* ── Genre Grid (Full Page) ─────────────────────────────────────────────── */
.genre-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.genre-grid .genre-card {
    width: auto;
    height: 100px;
}


/* ── Song Detail Page ───────────────────────────────────────────────────── */
.song-detail { padding-bottom: 20px; }

.song-detail-hero {
    text-align: center;
    padding: 24px var(--gap);
    background: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, transparent 100%);
}

.song-detail-art {
    width: 200px;
    height: 200px;
    border-radius: var(--card-radius);
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: var(--song-bg, #2a2a2a);
    box-shadow: var(--shadow-lg);
}

.song-detail-art-bg {
    position: absolute;
    inset: 0;
    opacity: 0.22;
    background: var(--song-tint, linear-gradient(150deg, #4a6cf7, #2d8f4e));
}

.song-detail-title {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 6px;
    line-height: 1.3;
    color: var(--text-bright);
}

.song-detail-artist {
    font-size: 1rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 12px;
    display: inline-block;
}

.song-detail-artist:active { opacity: 0.7; }

.song-detail-tags {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.song-detail-stats {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    justify-content: center;
    gap: 16px;
}

/* Rating */
.rating-section {
    padding: 16px var(--gap);
    text-align: center;
}

.rating-stars {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 6px;
}

.star {
    width: 2rem;
    height: 2rem;
    cursor: pointer;
    transition: transform var(--transition-fast), color var(--transition-fast);
    color: var(--bg-highlight);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.star.filled { color: var(--sun); }

.star:active { transform: scale(1.3); }

.rating-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 8px var(--gap) 20px;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    border-radius: var(--radius-full);
    font-size: 0.95rem;
    font-weight: 700;
    transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.btn:active {
    transform: scale(0.97);
    opacity: 0.85;
}

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

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid rgba(255,255,255,0.1);
}

.btn-row {
    display: flex;
    gap: 10px;
}

.btn-row .btn { flex: 1; }

.btn-icon {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}


/* ── Tag / Chip ─────────────────────────────────────────────────────────── */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    padding: 5px 12px;
    background: var(--bg-card);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-weight: 500;
}


/* ── Pagination ─────────────────────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px 0;
}

.pagination-btn {
    padding: 8px 18px;
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 600;
    transition: background var(--transition-fast), transform var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.pagination-btn:active {
    background: var(--bg-card-hover);
    transform: scale(0.96);
}

.pagination-btn.disabled {
    opacity: 0.3;
    pointer-events: none;
}

.pagination-info {
    font-size: 0.78rem;
    color: var(--text-muted);
}


/* ── Page Header ────────────────────────────────────────────────────────── */
.page-header {
    padding: 20px var(--gap) 16px;
}

.page-title {
    font-size: 1.3rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    color: var(--text-bright);
}

.page-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
}


/* ── Empty State ────────────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 48px 24px;
}

.empty-state-roj {
    margin-bottom: 16px;
    display: flex;
    justify-content: center;
}

.empty-state-icon {
    font-size: 3.5rem;
    margin-bottom: 16px;
}

.empty-state-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.empty-state-text {
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-secondary);
}


/* ── Recommendations ────────────────────────────────────────────────────── */
.recs-section {
    padding: 0 var(--gap);
    margin-top: 8px;
}


/* ── Library Page ───────────────────────────────────────────────────────── */
.library-section {
    padding: 0 var(--gap);
}

.library-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background var(--transition-fast);
}

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

.library-item:active { background: rgba(255,255,255,0.04); }

.library-item-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
}

.library-item-icon.favorites { background: linear-gradient(150deg, #d63384, #a5296a); }
.library-item-icon.history   { background: linear-gradient(150deg, #4a6cf7, #3452d9); }
.library-item-icon.playlists { background: linear-gradient(150deg, #1db954, #148a70); }
.library-item-icon.artists   { background: linear-gradient(150deg, #7e57c2, #5e35a1); }
.library-item-icon.genres    { background: linear-gradient(150deg, #c57d20, #9a6218); }
.library-item-icon.regions   { background: linear-gradient(150deg, #c0392b, #96281b); }

.library-item-text { flex: 1; min-width: 0; }

.library-item-name {
    font-size: 0.95rem;
    font-weight: 600;
    display: block;
    color: var(--text-primary);
}

.library-item-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.library-item-arrow {
    color: var(--text-muted);
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
}


/* ── Profile Page ───────────────────────────────────────────────────────── */
.profile-header {
    text-align: center;
    padding: 32px var(--gap) 24px;
    background: linear-gradient(180deg, rgba(29,185,84,0.08) 0%, transparent 100%);
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    color: #000;
    margin: 0 auto 14px;
    box-shadow: var(--shadow-md);
}

.profile-name {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 4px;
    color: var(--text-bright);
}

.profile-username {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.profile-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
}

.profile-stat { text-align: center; }

.profile-stat-value {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--accent);
    display: block;
}

.profile-stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}


/* ── Search Results ─────────────────────────────────────────────────────── */
.search-section-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
    margin-top: 20px;
}

.search-section-title:first-child { margin-top: 0; }

.search-suggestion {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-card);
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    color: var(--text-primary);
    margin: 0 0 8px 8px;
    transition: background var(--transition-fast);
}

.search-suggestion:active { background: var(--bg-card-hover); }

.search-browse {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 20px;
}

.search-browse-card {
    height: 80px;
    border-radius: var(--card-radius);
    display: flex;
    align-items: flex-end;
    padding: 12px;
    overflow: hidden;
    font-weight: 700;
    font-size: 0.85rem;
    color: #fff;
}


/* ── History Time ───────────────────────────────────────────────────────── */
.history-time {
    font-size: 0.65rem;
    color: var(--text-muted);
    flex-shrink: 0;
    white-space: nowrap;
}


/* ── Playlist Detail ────────────────────────────────────────────────────── */
.playlist-detail-hero {
    text-align: center;
    padding: 24px var(--gap);
    background: linear-gradient(180deg, rgba(5,150,105,0.08) 0%, transparent 100%);
}

.playlist-detail-art {
    width: 180px;
    height: 180px;
    border-radius: var(--card-radius);
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(150deg, #2a3a2a, #1e3a2e);
    box-shadow: var(--shadow-lg);
    color: var(--accent);
}

.playlist-detail-name {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 6px;
    color: var(--text-bright);
}

.playlist-detail-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}


/* ── Page Transitions ──────────────────────────────────────────────────── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.view-transition {
    animation: fadeInUp 0.25s ease-out;
}

/* Slide page transitions */
@keyframes slideEnterFromRight {
    from { opacity: 0; transform: translateX(-30px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideEnterFromLeft {
    from { opacity: 0; transform: translateX(30px); }
    to   { opacity: 1; transform: translateX(0); }
}

[dir="rtl"] .page-enter-forward { animation: slideEnterFromRight 0.3s cubic-bezier(0.16,1,0.3,1) both; }
[dir="rtl"] .page-enter-back    { animation: slideEnterFromLeft  0.3s cubic-bezier(0.16,1,0.3,1) both; }
[dir="ltr"] .page-enter-forward { animation: slideEnterFromLeft  0.3s cubic-bezier(0.16,1,0.3,1) both; }
[dir="ltr"] .page-enter-back    { animation: slideEnterFromRight 0.3s cubic-bezier(0.16,1,0.3,1) both; }
.page-enter-fade { animation: fadeInUp 0.25s ease-out both; }


/* ── Staggered Entrance Animations ─────────────────────────────────────── */
@keyframes staggerFadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.stagger-item {
    opacity: 0;
    animation: staggerFadeIn 0.35s cubic-bezier(0.16,1,0.3,1) both;
    animation-delay: calc(var(--si, 0) * 50ms);
}

.stagger-1 { animation-delay: 0.03s; }
.stagger-2 { animation-delay: 0.06s; }
.stagger-3 { animation-delay: 0.09s; }
.stagger-4 { animation-delay: 0.12s; }
.stagger-5 { animation-delay: 0.15s; }


/* ── Waveform Audio Visualizer ──────────────────────────────────────────── */
.waveform-bars {
    position: absolute;
    bottom: 16%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 28px;
    opacity: 0.35;
    z-index: 0;
}

.waveform-bar {
    width: 3px;
    border-radius: 2px;
    background: rgba(255,255,255,0.7);
    animation: barPulse var(--wave-speed, 1.2s) ease-in-out infinite;
}

.waveform-bar:nth-child(1) { height: 40%; animation-delay: 0s; }
.waveform-bar:nth-child(2) { height: 70%; animation-delay: 0.15s; }
.waveform-bar:nth-child(3) { height: 100%; animation-delay: 0.3s; }
.waveform-bar:nth-child(4) { height: 55%; animation-delay: 0.45s; }
.waveform-bar:nth-child(5) { height: 80%; animation-delay: 0.1s; }

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

/* Genre wave speeds */
.wave-fast .waveform-bar  { --wave-speed: 0.6s; }   /* Halparke, Dilan */
.wave-mid .waveform-bar   { --wave-speed: 1.0s; }   /* Gorani, Stran, Pop */
.wave-slow .waveform-bar  { --wave-speed: 1.8s; }   /* NarmeNale, Lawik, Payizok */


/* ── Glassmorphism Song Detail ─────────────────────────────────────────── */
.song-detail-backdrop {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 360px;
    opacity: 0.12;
    z-index: 0;
    pointer-events: none;
    filter: blur(60px);
    background: var(--song-tint, linear-gradient(150deg, #4a6cf7, #2d8f4e));
}

.song-detail {
    position: relative;
    overflow: hidden;
}

.song-detail-hero {
    position: relative;
    z-index: 1;
}

.glass-panel {
    background: rgba(40, 40, 40, 0.55);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-lg);
    margin: 0 var(--gap);
    position: relative;
    z-index: 1;
}

.glass-panel .rating-section {
    padding: 16px;
}

.glass-panel .action-buttons {
    padding: 8px 16px 16px;
}

.btn-primary.play-btn-glow {
    box-shadow: 0 0 20px rgba(29, 185, 84, 0.4), 0 4px 12px rgba(0,0,0,0.3);
    animation: playGlow 2s ease-in-out infinite;
}

@keyframes playGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(29, 185, 84, 0.3), 0 4px 12px rgba(0,0,0,0.3); }
    50%      { box-shadow: 0 0 30px rgba(29, 185, 84, 0.5), 0 4px 16px rgba(0,0,0,0.3); }
}

.star.filled {
    color: var(--sun);
    text-shadow: 0 0 8px rgba(251, 191, 36, 0.5);
}


/* ── Star Rating Particles ─────────────────────────────────────────────── */
.particle {
    position: fixed;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--sun);
    pointer-events: none;
    z-index: 999;
    animation: particleBurst 0.6s cubic-bezier(0.16,1,0.3,1) forwards;
}

@keyframes particleBurst {
    0%   { opacity: 1; transform: translate(0, 0) scale(1); }
    100% { opacity: 0; transform: translate(var(--px, 20px), var(--py, -30px)) scale(0); }
}

.roj-reaction {
    position: absolute;
    top: -36px;
    left: 50%;
    transform: translateX(-50%);
    animation: rojReactionPop 0.8s cubic-bezier(0.16,1,0.3,1) forwards;
    z-index: 10;
    pointer-events: none;
}

@keyframes rojReactionPop {
    0%   { opacity: 0; transform: translateX(-50%) scale(0.3) translateY(10px); }
    40%  { opacity: 1; transform: translateX(-50%) scale(1.1) translateY(-5px); }
    70%  { transform: translateX(-50%) scale(0.95) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) scale(0.8) translateY(-10px); }
}


/* ── Genre Ambient Background ──────────────────────────────────────────── */
.genre-bg-ambient {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 300px;
    opacity: 0.07;
    pointer-events: none;
    z-index: 0;
    filter: blur(40px);
    background: var(--ambient-tint, linear-gradient(180deg, #4a6cf7, transparent));
}



/* ── Artist Mosaic Background ──────────────────────────────────────────── */
.artist-mosaic-bg {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 200px;
    overflow: hidden;
    filter: blur(30px);
    opacity: 0.15;
    z-index: 0;
    pointer-events: none;
}

.mosaic-block {
    position: absolute;
    border-radius: 8px;
}

.artist-hero {
    position: relative;
    z-index: 1;
    overflow: hidden;
}


/* ── Bottom Sheet ──────────────────────────────────────────────────────── */
.bottom-sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 400;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.bottom-sheet-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 401;
    background: var(--bg-elevated);
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    padding-bottom: env(safe-area-inset-bottom, 0);
    max-height: 70vh;
    overflow-y: auto;
}

.bottom-sheet.open {
    transform: translateY(0);
}

.bottom-sheet-handle {
    width: 36px;
    height: 4px;
    background: var(--bg-highlight);
    border-radius: 2px;
    margin: 10px auto;
}

.bottom-sheet-song {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 20px;
}

.bottom-sheet-art {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: var(--song-bg, #2a2a2a);
    flex-shrink: 0;
}

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

.bottom-sheet-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-bright);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bottom-sheet-artist {
    font-size: 0.82rem;
    color: var(--text-secondary);
    display: block;
}

.bottom-sheet-actions {
    padding: 8px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bottom-sheet-action {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 4px;
    font-size: 0.92rem;
    color: var(--text-primary);
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.bottom-sheet-action:active {
    background: rgba(255,255,255,0.05);
}

.bottom-sheet-action-icon {
    width: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.bottom-sheet-rating {
    display: flex;
    gap: 6px;
    padding: 0 4px;
}

.bottom-sheet-rating .star {
    width: 1.5rem;
    height: 1.5rem;
}


/* ── Roj Genre Expressions ─────────────────────────────────────────────── */
.roj-dance .roj-body {
    animation: rojDance 0.5s ease-in-out infinite;
}

@keyframes rojDance {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-3px) rotate(5deg); }
    75% { transform: translateY(-3px) rotate(-5deg); }
}

.roj-dance .roj-rays {
    animation: rojSpin 8s linear infinite;
}

.roj-cry .roj-mouth {
    border: 2.5px solid #78350f;
    border-bottom: none;
    border-top: 2.5px solid #78350f;
    border-radius: 50% 50% 0 0;
    height: 14%;
}

.roj-cry::after {
    content: '';
    position: absolute;
    bottom: 32%;
    left: 28%;
    width: 6%;
    height: 10%;
    background: #60a5fa;
    border-radius: 0 0 50% 50%;
    animation: tearDrop 1.5s ease-in infinite;
}

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

.roj-headphones .roj-body::before,
.roj-headphones .roj-body::after {
    content: '';
    position: absolute;
    width: 22%;
    height: 22%;
    border: 3px solid #78350f;
    border-radius: 50%;
    top: 8%;
}

.roj-headphones .roj-body::before { left: -8%; }
.roj-headphones .roj-body::after  { right: -8%; }

.roj-love .roj-mouth {
    border: none;
    width: 18%;
    height: 18%;
    background: #ef4444;
    border-radius: 50%;
    position: absolute;
    bottom: 26%;
    left: 41%;
}

.roj-love .roj-mouth::before,
.roj-love .roj-mouth::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: #ef4444;
    border-radius: 50%;
    top: -50%;
}

.roj-love .roj-mouth::before { left: -30%; }
.roj-love .roj-mouth::after  { right: -30%; }

.roj-drum .roj-body {
    animation: rojDrum 0.4s ease-in-out infinite alternate;
}

@keyframes rojDrum {
    0%   { transform: translateX(-2px); }
    100% { transform: translateX(2px); }
}


/* ── Mini Player Bar ───────────────────────────────────────────────────── */
.mini-player {
    position: fixed;
    bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px));
    left: 0; right: 0;
    height: 56px;
    background: var(--bg-elevated);
    border-top: 1px solid rgba(255,255,255,0.08);
    z-index: 199;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
}

.mini-player.visible {
    transform: translateY(0);
}

.mini-player-accent {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
}

[dir="rtl"] .mini-player-accent {
    left: auto;
    right: 0;
}

.mini-player-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    background: var(--song-bg, #2a2a2a);
}

.mini-player-text {
    flex: 1;
    min-width: 0;
}

.mini-player-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.mini-player-artist {
    font-size: 0.7rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.mini-player-waveform {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 20px;
    flex-shrink: 0;
}

.mini-player-waveform .waveform-bar {
    width: 2.5px;
    background: var(--accent);
    opacity: 0.7;
}

.mini-player-progress {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2px;
    background: rgba(255,255,255,0.06);
}

.mini-player-progress-fill {
    height: 100%;
    background: var(--accent);
    animation: miniProgress 30s linear infinite;
    width: 0%;
}

@keyframes miniProgress {
    from { width: 0%; }
    to   { width: 100%; }
}

/* Adjust content padding when mini player is visible */
body.has-mini-player #content {
    padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px) + 12px + 56px);
}


/* ── Search Ripple Effect ──────────────────────────────────────────────── */
.ripple-wrap {
    position: relative;
    overflow: hidden;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    transform: scale(0);
    animation: rippleAnim 0.5s ease-out forwards;
    pointer-events: none;
}

@keyframes rippleAnim {
    to { transform: scale(4); opacity: 0; }
}

.search-chip-animated {
    transition: transform var(--transition-fast), background var(--transition-fast);
}

.search-chip-animated:active {
    transform: scale(0.95);
}


/* ── Profile Stats Visualization ───────────────────────────────────────── */
.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 0 var(--gap);
    margin-bottom: 24px;
}

.stat-ring-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.stat-ring {
    width: 72px;
    height: 72px;
    transform: rotate(-90deg);
}

.stat-ring-bg {
    fill: none;
    stroke: var(--bg-highlight);
    stroke-width: 5;
}

.stat-ring-fill {
    fill: none;
    stroke-width: 5;
    stroke-linecap: round;
    stroke-dasharray: 188;
    stroke-dashoffset: 188;
    transition: stroke-dashoffset 1s cubic-bezier(0.16,1,0.3,1);
}

.stat-ring-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
}

.stat-ring-value {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.stat-counter {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--accent);
    display: block;
    text-align: center;
}

.genre-distribution {
    padding: 0 var(--gap);
    margin-bottom: 24px;
}

.genre-dist-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-bright);
    margin-bottom: 12px;
}

.genre-bar-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.genre-bar-label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    width: 70px;
    text-align: end;
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.genre-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-highlight);
    border-radius: 4px;
    overflow: hidden;
}

.genre-bar-fill {
    height: 100%;
    border-radius: 4px;
    width: 0%;
    transition: width 0.8s cubic-bezier(0.16,1,0.3,1);
}

.genre-bar-count {
    font-size: 0.65rem;
    color: var(--text-muted);
    width: 28px;
    flex-shrink: 0;
}


/* ── Genre-Colored Skeleton Shimmer ────────────────────────────────────── */
.skeleton.genre-shimmer {
    background: linear-gradient(
        90deg,
        var(--shimmer-base, #222222) 25%,
        var(--shimmer-highlight, #2e2e2e) 50%,
        var(--shimmer-base, #222222) 75%
    );
    background-size: 200% 100%;
}


/* ── Scrollbar ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 0; height: 0; background: transparent; }
* { scrollbar-width: none; }


/* ── Utilities ──────────────────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-hint { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.px-16 { padding-left: var(--gap); padding-right: var(--gap); }
.hidden { display: none !important; }

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