/* ============================================================
   Xooviq – Minimal & Modern Frontend CSS
   ============================================================ */

/* ── Design Tokens ──────────────────────────────────────────── */
:root {
    --primary: #52525b;
    /* Neutral dark gray */
    --primary-dark: #27272a;
    --primary-light: #f4f4f5;
    --accent: #18181b;
    --text-primary: #18181b;
    --text-secondary: #52525b;
    --text-muted: #a1a1aa;
    --bg-body: #ffffff;
    --bg-surface: #fafafa;
    --border: #f4f4f5;
    --border-dark: #e4e4e7;
    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.06);
    --transition: 0.2s ease-in-out;
    --font-sans: 'Inter', system-ui, sans-serif;
    --container: 1280px;
    --header-h: 72px;
}

/* ── Reset & Base ───────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--text-secondary);
    text-decoration: underline;
    text-decoration-color: var(--border-dark);
    text-underline-offset: 4px;
}

img {
    max-width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
    border-radius: var(--radius-sm);
}

button,
input {
    font-family: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    transition: all var(--transition);
}

ul {
    list-style: none;
}

hr {
    border: 0;
    height: 1px;
    background: var(--border);
    margin: 24px 0;
}

/* ── Core Layout Classes ────────────────────────────────────── */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 16px;
}

/* Basic Grid */
.grid {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.grid-cols-2 {
    grid-template-columns: repeat(1, 1fr);
}

.grid-cols-3 {
    grid-template-columns: repeat(1, 1fr);
}

.grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 768px) {
    .grid-cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-cols-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .grid-cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .grid-cols-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Mobile Scroll Layout for Related Songs */
.mobile-scroll-row {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 16px;
}

/* Removed specific scroller overrides, standard .song-card will be used */
@media (min-width: 768px) {
    .mobile-scroll-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Animation Utils */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.4s ease forwards;
}

.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

/* ── Layout: Two Columns (Desktop) ──────────────────────────── */
.page-layout {
    display: flex;
    flex-direction: column;
    gap: 32px;
    padding: 24px 0;
}

.main-column {
    flex: 1;
    min-width: 0;
    /* Prevents overflow */
}

.sidebar-column {
    display: none;
    /* hidden on mobile */
}

@media (min-width: 1024px) {
    .page-layout {
        flex-direction: row;
        align-items: flex-start;
        gap: 48px;
        padding: 40px 0;
    }

    .main-column {
        flex: 1;
        width: 70%;
    }

    .sidebar-column {
        display: block;
        width: 30%;
        position: sticky;
        top: calc(var(--header-h) + 24px);
    }
}

/* ── Header ─────────────────────────────────────────────────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--header-h);
    padding-top: 12px;
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(8px);
    transition: box-shadow var(--transition);
}

.site-header.scrolled {
    box-shadow: var(--shadow-sm);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.logo-icon {
    font-size: 1.25rem;
}

.logo:hover {
    text-decoration: none;
}

/* Nav */
.main-nav {
    display: none;
    align-items: center;
    gap: 32px;
}

.main-nav a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 0;
    position: relative;
    transition: color 0.3s ease;
}

.main-nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: var(--text-primary);
    transition: width 0.3s ease;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--text-primary);
}

.main-nav a:hover::after,
.main-nav a.active::after {
    width: 100%;
}

@media (max-width: 767px) {
    .main-nav {
        display: none;
        flex-direction: column;
        position: absolute;
        top: var(--header-h);
        left: 0;
        width: 100%;
        height: auto;
        background: #fff;
        box-shadow: var(--shadow-lg);
        padding: 16px 24px;
        z-index: 1000;
        align-items: stretch;
        gap: 0;
        border-top: 1px solid var(--border-dark);
        text-align: left;
    }

    .main-nav.open {
        display: flex;
        animation: slideDown 0.2s ease forwards;
    }

    .main-nav a {
        padding: 16px 0;
        border-bottom: 1px solid var(--border);
        width: 100%;
        display: block;
        font-size: 1.05rem;
    }

    .main-nav a::after {
        display: none;
    }

    .main-nav a:last-child {
        border-bottom: none;
    }
}

@media (min-width: 768px) {
    .main-nav {
        display: flex;
    }
}

/* Search Toggle / Dropdown */
.search-toggle-btn {
    font-size: 1.25rem;
    color: var(--text-primary);
    padding: 8px;
    margin-left: auto;
    margin-right: 16px;
    display: none;
}

@media (min-width: 1024px) {
    .search-toggle-btn {
        display: block;
    }
}

.search-dropdown {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    width: 100%;
    background: #fff;
    border-bottom: 1px solid var(--border-dark);
    box-shadow: var(--shadow);
    padding: 16px 24px;
    z-index: 999;
}

.search-dropdown.open {
    display: block;
    animation: slideDown 0.2s ease forwards;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-form-full {
    max-width: var(--container);
    margin: 0 auto;
    display: flex;
    gap: 12px;
}

.search-input-full {
    flex: 1;
    padding: 12px 16px;
    font-size: 1rem;
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sm);
    outline: none;
}

.search-input-full:focus {
    border-color: var(--primary);
}

.search-submit-btn {
    padding: 12px 24px;
    background: var(--text-primary);
    color: #fff;
    font-weight: 600;
    border-radius: var(--radius-sm);
}

.search-submit-btn:hover {
    background: var(--primary-dark);
}

.mobile-search {
    display: block;
    width: 100%;
    margin-bottom: 16px;
}

@media (min-width: 1024px) {
    .mobile-search {
        display: none;
    }
}

.search-wrap {
    display: flex;
    align-items: center;
    background: var(--bg-surface);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sm);
    padding: 0 12px;
    height: 36px;
    transition: border var(--transition);
}


.search-wrap:focus-within {
    border-color: var(--text-muted);
    background: #fff;
}

.search-input {
    border: none;
    background: transparent;
    outline: none;
    padding-left: 8px;
    font-size: 0.95rem;
    width: 100%;
}

.search-icon {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.search-btn {
    display: none;
}

@media (min-width: 1024px) {
    .header-search {
        display: block;
    }
}

/* Mobile Nav Toggle */
.nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 32px;
    height: 32px;
    padding: 4px;
}

.nav-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition);
}

@media (min-width: 768px) {
    .nav-toggle {
        display: none;
    }
}

/* ── Typography & Page Titles ───────────────────────────────── */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.page-title {
    font-size: 1.75rem;
    margin-bottom: 8px;
}

.page-desc {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

@media (min-width: 768px) {
    .page-title {
        font-size: 2.25rem;
    }

    .page-desc {
        margin-bottom: 32px;
    }
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-title a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* ── Modern Song Card ───────────────────────────────────────── */
.song-card {
    background: #fff;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: var(--transition);
    min-width: 0;
    box-shadow: var(--shadow-sm);
}

.song-card:hover {
    box-shadow: var(--shadow);
    border-color: var(--border-dark);
}

.song-card-link {
    display: flex;
    gap: 12px;
    align-items: center;
    width: 100%;
    text-decoration: none;
    color: inherit;
}

.song-thumb-wrap {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
    background: var(--bg-surface);
}

.song-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.song-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--text-muted);
}

.song-card-body {
    flex: 1;
    min-width: 0;
}

.song-title {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.song-artist {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.song-movie {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.song-meta-row {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.lang-badge,
.year-badge,
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
    background: var(--bg-surface);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.views-badge {
    margin-left: auto;
}

.trending-badge {
    position: absolute;
    bottom: 4px;
    right: 4px;
    font-size: 0.7rem;
    background: #fff;
    border-radius: 4px;
    padding: 0 4px;
    box-shadow: var(--shadow-sm);
}

/* ── Song Page Lyrics Component ─────────────────────────────── */
.song-header {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    position: relative;
}

.song-header h1 {
    font-size: 1.4rem;
    margin-bottom: 12px;
}

@media (min-width: 768px) {
    .song-header h1 {
        font-size: 1.75rem;
    }
}

.song-metadata-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.song-metadata-row a {
    font-weight: 500;
}

.song-metadata-row .badge {
    font-size: 0.85rem;
}

.song-info-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
    font-size: 0.95rem;
}

.song-info-table th {
    text-align: left;
    padding: 8px 16px 8px 0;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
    width: 120px;
}

.song-info-table td {
    padding: 8px 0;
    color: var(--text-primary);
}

.song-info-table a {
    font-weight: 500;
    color: var(--primary-dark);
}

.song-info-table a:hover {
    text-decoration: underline;
}

.lyrics-container {
    background: #f8fafc;
    border: 1px solid var(--border-dark);
    border-radius: var(--radius);
    padding: 32px 24px;
    position: relative;
    margin-bottom: 32px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.lyrics-text {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-word;
    font-family: var(--font-sans);
}

@media (min-width: 768px) {
    .lyrics-container {
        padding: 40px;
    }

    .lyrics-text {
        font-size: 1.05rem;
    }
}

.btn-copy {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 6px 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-copy:hover {
    background: #fff;
    border-color: var(--text-muted);
    color: var(--text-primary);
}

/* ── Breadcrumbs ────────────────────────────────────────────── */
.breadcrumb-nav {
    background: #f8f9fa;
    padding: 24px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 32px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    color: var(--text-muted);
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
    list-style: none;
}

.breadcrumb a {
    color: var(--text-primary);
    font-weight: 500;
}

.breadcrumb a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.bc-sep {
    color: var(--text-muted);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
}

/* ── Sidebar Widget ─────────────────────────────────────────── */
.widget {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px;
}

.widget-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.widget-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.widget-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.widget-list-item img {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.widget-list-item-content {
    flex: 1;
    min-width: 0;
}

.widget-list-title {
    font-size: 0.9rem;
    font-weight: 500;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.widget-list-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ── Horizontal Scroll Mobile Lists ─────────────────────────── */
.mobile-scroll-row {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 12px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Firefox */
}

.mobile-scroll-row::-webkit-scrollbar {
    display: none;
}

.mobile-scroll-row>* {
    min-width: 260px;
    scroll-snap-align: start;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .mobile-scroll-row {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        overflow: visible;
        padding-bottom: 0;
        scroll-snap-type: none;
    }

    .mobile-scroll-row>* {
        min-width: 0;
    }
}

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    padding: 48px 0 24px;
    margin-top: 48px;
}

.footer-grid {
    display: grid;
    gap: 32px;
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr 1fr;
    }
}

.footer-brand p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-top: 12px;
    max-width: 300px;
}

.footer-links h4 {
    font-size: 1rem;
    margin-bottom: 16px;
}

.footer-links ul {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.footer-bottom {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
}

@media (min-width: 768px) {
    .footer-bottom {
        flex-direction: row;
    }
}

/* Top Banner (Movies, Albums) */
.top-banner {
    display: flex;
    flex-direction: column;
    gap: 24px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 32px;
}

.banner-img {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--bg-surface);
}

.banner-info {
    flex: 1;
}

.banner-info h1 {
    font-size: 2rem;
    margin-bottom: 8px;
}

.banner-info p {
    color: var(--text-secondary);
    margin-bottom: 12px;
}

@media (min-width: 768px) {
    .top-banner {
        flex-direction: row;
        align-items: center;
        padding: 32px;
    }

    .banner-img {
        width: 160px;
        height: 160px;
    }
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 32px;
    flex-wrap: wrap;
}

.pagination .page-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    background: #fff;
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
}

.pagination .page-item:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.pagination .page-item.active {
    background: var(--text-primary);
    color: #fff;
    border-color: var(--text-primary);
}

.pagination .page-item.disabled {
    opacity: 0.5;
    pointer-events: none;
}