/* --- 1. SETTINGS --- */
:root {
    --bg-base: #0A1F41;
    --bg-surface: #0D254C;
    --bg-elevated: #132E5E;
    --bg-highlight: #1E4282;
    --primary: #CEA356;
    --text-main: #FFFFFF;
    --text-muted: #b3b3b3;
    --favorite: #FF4B4B;
    --cobalt: #0047AB;
    --cobalt-soft: #0056D2;
    --font-heading: 'Sora', sans-serif;
    --font-body: 'Space Grotesque', sans-serif;
    --glass: rgba(18, 18, 18, 0.7);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- 2. GENERIC --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--bg-highlight);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* --- 3. BASE --- */
body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-base);
    color: var(--text-main);
    overflow-x: hidden;
    height: 100vh;
}

h1, h2, h3, h4 {
    margin-bottom: 0.5em;
}

button {
    font-family: inherit;
    border: none;
    background: none;
    cursor: pointer;
    transition: var(--transition);
}

/* --- 4. OBJECTS --- */
.o-app-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    grid-template-rows: 1fr auto;
    height: 100vh;
    overflow: hidden;
}

.o-main-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 24px;
}

/* --- 5. COMPONENTS --- */

/* --- Sidebar --- */
.c-sidebar {
    background-color: var(--bg-base);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.c-logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.c-nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.c-nav-item a {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--text-muted);
    font-weight: 600;
    text-decoration: none;
}

.c-nav-item:hover, .c-nav-item.is-active {
    color: var(--text-main);
    cursor: pointer;
}

/* --- Menu Toggle --- */
.c-menu-toggle {
    display: none;
    font-size: 2rem;
    color: var(--text-main);
    padding: 8px;
    line-height: 0;
}

.c-sidebar-close {
    display: none;
    position: absolute;
    top: 24px;
    right: 24px;
    font-size: 2rem;
    color: var(--text-main);
}

.c-sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999;
    backdrop-filter: blur(4px);
}

.c-sidebar-backdrop.is-open {
    display: block;
}

/* --- Main Content Area --- */
.c-main-content {
    background: linear-gradient(to bottom, #2a2a2a 0%, var(--bg-surface) 100%);
    overflow-y: auto;
    position: relative;
    scroll-behavior: smooth;
}

/* --- App Header --- */
.c-app-header {
    position: sticky;
    top: 0;
    height: 64px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 32px;
    z-index: 100;
    background: var(--bg-surface);
    gap: 24px;
}

.c-header-logo {
    display: none;
}

.c-app-header.is-scrolled {
    background-color: var(--bg-surface);
}

.c-search-bar {
    width: 100%;
    max-width: 500px;
    background: var(--bg-highlight);
    border-radius: 500px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
}

.c-search-bar input {
    background: none;
    border: none;
    color: white;
    width: 100%;
    outline: none;
    font-size: 0.875rem;
}

/* --- User Menu --- */
.c-user-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(0,0,0,0.7);
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
}

/* --- Hero --- */
.c-hero {
    height: 400px;
    padding: 80px 32px 32px;
    display: flex;
    align-items: flex-end;
    background-size: cover;
    background-position: center;
    position: relative;
    transition: var(--transition);
}

.c-hero::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.95));
}

.c-hero__content {
    position: relative;
    z-index: 1;
}

.c-hero__label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.c-hero__title {
    font-size: 6rem;
    font-weight: 900;
    letter-spacing: -0.04em;
    margin-bottom: 24px;
}

/* --- Testing Banner --- */
.c-testing-banner {
    background: linear-gradient(135deg, var(--cobalt) 0%, var(--cobalt-soft) 100%);
    padding: 32px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    color: white;
    position: relative;
    overflow: hidden;
}

.c-testing-banner__close {
    position: absolute;
    top: 16px;
    right: 16px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    z-index: 10;
    line-height: 0;
}

.c-testing-banner__close:hover {
    color: white;
    transform: scale(1.1);
}

.c-testing-banner__title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 16px;
    color: white;
}

.c-testing-banner__description {
    font-family: var(--font-body);
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 32px;
    opacity: 0.95;
}

.c-testing-banner__actions {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.c-testing-banner__note {
    font-family: var(--font-body);
    font-size: 0.9rem;
    opacity: 0.8;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 16px;
}

@media (min-width: 1024px) {
    .c-testing-banner__actions {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

/* --- Card --- */
.c-card {
    background: var(--bg-elevated);
    padding: 16px;
    border-radius: 8px;
    position: relative;
    transition: var(--transition);
    cursor: pointer;
}

.c-card:hover {
    background: var(--bg-highlight);
}

.c-card.is-playing {
    background: var(--bg-highlight);
    border-bottom: 2px solid var(--primary);
}

/* --- Language Filters --- */
.c-filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.c-filter-chip {
    background: var(--bg-highlight);
    color: var(--text-main);
    padding: 6px 16px;
    border-radius: 500px;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
}

.c-filter-chip:hover {
    background: var(--bg-elevated);
}

.c-filter-chip.is-active {
    background: var(--primary);
    color: white;
}

.c-card__image {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 4px;
    margin-bottom: 16px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.5);
    background-size: cover;
    background-position: center;
}

.c-card__title {
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

/* --- Swipe Actions --- */
.c-swipe-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: var(--bg-surface);
}

.c-swipe-actions {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    display: none; /* Only visible on mobile */
    align-items: center;
    gap: 0;
    z-index: 1;
}

.c-swipe-btn {
    width: 70px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    transition: var(--transition);
}

.c-swipe-btn--web {
    background-color: var(--cobalt-soft);
}

.c-swipe-btn--fav {
    background-color: var(--bg-highlight);
}

.c-swipe-btn--fav.is-favorite {
    color: var(--favorite);
}

.c-swipe-content {
    position: relative;
    z-index: 2;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.c-card__body {
    flex: 1;
    min-width: 0;
}

.c-card__swipe-indicator {
    display: none;
}

.c-card__play-button {
    position: absolute;
    right: 24px;
    bottom: 80px;
    width: 48px;
    height: 48px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(10px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    transition: var(--transition);
}

.c-card:hover .c-card__play-button {
    opacity: 1;
    transform: translateY(0);
}

.c-card__fav-button {
    position: absolute;
    top: 24px;
    right: 24px;
    background: rgba(0,0,0,0.5);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.c-card:hover .c-card__fav-button {
    opacity: 1;
}

.c-card__fav-button:hover, .c-card__fav-button.is-favorite {
    background: var(--bg-highlight);
    color: var(--favorite);
    opacity: 1;
}

.c-card__fav-button.is-favorite ion-icon {
    animation: heartBeat 0.3s ease-in-out;
}

/* animations */
@keyframes heartBeat {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1.1); }
}

/* --- Player Bar --- */
.c-player-bar {
    grid-column: 1 / -1;
    background-color: var(--bg-elevated);
    border-top: 1px solid var(--bg-highlight);
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    align-items: center;
    padding: 0 16px;
    padding-bottom: env(safe-area-inset-bottom);
    min-height: calc(90px + env(safe-area-inset-bottom));
    z-index: 200;
}

.c-player-bar__now-playing {
    display: flex;
    align-items: center;
    gap: 12px;
}

.c-player-bar__mini-cover {
    width: 56px;
    height: 56px;
    border-radius: 4px;
    background-size: cover;
    background-position: center;
}

.c-player-bar__controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.c-control-buttons {
    display: flex;
    align-items: center;
    gap: 24px;
}

.c-playback-bar {
    width: 100%;
    max-width: 500px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.c-progress-bar {
    flex: 1;
    height: 4px;
    background: var(--bg-highlight);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.c-progress-bar__fill {
    height: 100%;
    background: white;
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s linear;
}

.c-progress-bar:hover .c-progress-bar__fill {
    background: var(--primary);
}

.c-volume-controls {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
}

.c-volume-bar {
    width: 100px;
    height: 4px;
    background: var(--bg-highlight);
    border-radius: 2px;
}

/* --- Buttons --- */
.c-button {
    padding: 12px 32px;
    border-radius: 500px;
    font-weight: 700;
    transition: var(--transition);
    cursor: pointer;
}

.c-button:hover {
    transform: scale(1.05);
}

.c-button--primary {
    background: var(--primary);
    color: white;
}

.c-button--outline {
    background: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text-main);
}

.c-button--cobalt {
    background: white;
    color: var(--cobalt);
    font-family: var(--font-heading);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    justify-content: center;
}

.c-button--cobalt:hover {
    background: #f0f0f0;
}

.c-button--outline-cobalt {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: white;
    font-family: var(--font-body);
    font-weight: 400;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    justify-content: center;
}

.c-button--outline-cobalt:hover {
    border-color: white;
}

.c-button--play-store {
    background: #000;
    color: white;
    font-family: var(--font-body);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    justify-content: center;
}

.c-button--play-store:hover {
    background: #222;
}

.c-hero__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

#hero-fav-btn {
    padding: 12px;
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#hero-fav-btn ion-icon {
    font-size: 1.5rem;
}

#hero-fav-btn.is-favorite {
    color: var(--favorite);
    border-color: var(--favorite);
}

.c-button--premium {
    background: white;
    color: black;
    font-size: 0.8125rem;
    padding: 8px 16px;
}

.c-icon-button {
    color: var(--text-muted);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.c-icon-button:hover {
    color: var(--text-main);
    transform: scale(1.1);
}

.c-icon-button--large {
    font-size: 2.5rem;
    color: white;
}

.c-icon-button.is-favorite {
    color: var(--favorite);
}

#shuffle-btn.is-active {
    color: var(--primary);
}

/* --- 6. UTILITIES --- */
.u-text-muted { color: var(--text-muted) !important; }
.u-font-small { font-size: 0.75rem !important; }
.u-font-bold { font-weight: 700 !important; }
.u-margin-0 { margin: 0 !important; }
.u-padding-32 { padding: 32px !important; }
.u-padding-16 { padding: 16px !important; }
.u-margin-left-10 { margin-left: 10px !important; }
.u-margin-left-12 { margin-left: 12px !important; }
.u-margin-auto-top { margin-top: auto !important; }
.u-letter-spacing { letter-spacing: 0.1em !important; }
.u-margin-bottom-24 { margin-bottom: 24px !important; }

/* Responsive */
@media (max-width: 768px) {
    .o-app-layout {
        grid-template-columns: 1fr;
    }
    .c-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: 280px;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        display: flex;
    }

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

    .c-menu-toggle {
        display: block;
        position: absolute;
        left: 16px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 10;
    }

    .c-sidebar-close {
        display: block;
    }

    .c-search-bar {
        display: flex;
        max-width: none;
    }

    .c-header-logo {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100%;
        margin: 0 auto;
    }

    .c-app-header {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 16px;
        position: relative;
    }
    .c-hero__title {
        font-size: 3rem;
    }

    .o-main-grid {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .c-swipe-actions {
        display: flex;
    }

    .c-card {
        display: flex;
        align-items: center;
        padding: 12px;
        gap: 16px;
        background: var(--bg-elevated);
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .c-card__image {
        width: 56px;
        height: 56px;
        min-width: 56px;
        margin-bottom: 0;
        border-radius: 8px;
    }

    .c-card__play-button {
        display: none;
    }

    .c-card__fav-button {
        position: static;
        opacity: 1;
        margin-left: auto;
        background: transparent;
        width: 40px;
        height: 40px;
    }

    .c-card__title {
        font-size: 0.95rem;
        margin-bottom: 2px;
    }

    .c-card__description {
        font-size: 0.8rem;
    }

    .c-card__swipe-indicator {
        display: flex;
        align-items: center;
        color: var(--text-muted);
        opacity: 0.3;
        font-size: 1rem;
        animation: hintSwipe 2s infinite ease-in-out;
    }

    @keyframes hintSwipe {
        0%, 100% { transform: translateX(0); opacity: 0.3; }
        50% { transform: translateX(-4px); opacity: 0.6; }
    }

    .c-progress-bar {
        display: none;
    }
    #player-fav-btn, #shuffle-btn {
        display: none;
    }
    .c-player-bar__track-info {
        width: 150px;
    }

    .u-padding-32 {
        padding: 16px !important;
    }
}
