/* Moonlight V2 - Premium Web App Dashboard */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;800&family=Play:wght@400;700&display=swap');

:root {
    --bg-base: #060814;
    --bg-side: #0A0C1D;
    --bg-card: #0F1229;
    --border: rgba(100, 140, 255, 0.1);
    --border-hover: rgba(0, 245, 255, 0.4);
    --accent: #00E5FF;
    --accent-glow: 0 0 15px rgba(0, 229, 255, 0.5);
    --text: #E0E6ED;
    --text-dim: #7B8BA6;
    --font-heading: 'Play', sans-serif;
    --font-body: 'Inter', sans-serif;
    --r-sm: 8px;
    --r-lg: 16px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background: var(--bg-base);
    color: var(--text);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* APP LAYOUT */
.app-sidebar {
    width: 260px;
    background: var(--bg-side);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 30px 20px;
}

.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    /* fixes flex shrink issues */
}

/* SIDEBAR LOGO */
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    margin-bottom: 40px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(135deg, #18224B, #0F1229);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--accent);
    font-size: 1.4rem;
    box-shadow: var(--accent-glow);
}

.logo-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 1px;
}

/* SIDEBAR MENUS */
.side-label {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 12px;
}

.side-menu {
    list-style: none;
    margin-bottom: 35px;
}

.side-menu li {
    margin-bottom: 5px;
}

.side-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    border-radius: var(--r-sm);
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: 0.2s;
}

.side-link:hover,
.side-link.active {
    background: rgba(0, 229, 255, 0.05);
    color: var(--accent);
    border-right: 3px solid var(--accent);
}

.cat-count {
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
}

/* TOPBAR */
.app-topbar {
    height: 80px;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    background: rgba(6, 8, 20, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.search-bar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 30px;
    padding: 10px 20px;
    width: 300px;
    color: #fff;
    outline: none;
    font-family: var(--font-body);
}

.top-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--accent);
}

/* MAIN CONTENT */
.content-wrapper {
    padding: 40px;
}

/* CINEMATIC HERO */
.cinematic-hero {
    position: relative;
    width: 100%;
    height: 400px;
    border-radius: var(--r-lg);
    overflow: hidden;
    margin-bottom: 50px;
    border: 1px solid var(--border);
}

.cinematic-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.7);
}

.cinematic-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--bg-base) 0%, rgba(6, 8, 20, 0) 80%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 40px;
}

.cinematic-title {
    font-family: var(--font-heading);
    font-size: 3rem;
    color: #fff;
    margin-bottom: 15px;
    line-height: 1.1;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
}

.cinematic-tags {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

.c-tag {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-primary {
    display: inline-block;
    background: var(--accent);
    color: #000;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    padding: 15px 35px;
    border-radius: 30px;
    text-decoration: none;
    box-shadow: var(--accent-glow);
    transition: 0.3s;
    cursor: pointer;
    border: none;
    text-transform: uppercase;
}

.btn-primary:hover {
    transform: scale(1.05);
    filter: brightness(1.2);
}

/* GRID LAYOUT */
.section-heading {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    margin-bottom: 25px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-heading::before {
    content: '';
    width: 6px;
    height: 24px;
    background: var(--accent);
    border-radius: 3px;
    box-shadow: var(--accent-glow);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 50px;
}

.card {
    background: var(--bg-card);
    border-radius: var(--r-sm);
    overflow: hidden;
    text-decoration: none;
    border: 1px solid var(--border);
    transition: 0.3s;
    display: flex;
    flex-direction: column;
    position: relative;
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--border-hover);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.card-img-wrap {
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.4s;
}

.card:hover .card-img {
    transform: scale(1.08);
    filter: brightness(1.1);
}

.card-body {
    padding: 15px;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-cat {
    font-size: 0.75rem;
    color: var(--accent);
}

/* VIEW HERO (IFRAME BLOCK) */
.view-cinematic {
    width: 100%;
    background: var(--bg-card);
    border-radius: var(--r-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: 40px;
    display: flex;
    flex-direction: column;
}

.view-frame {
    width: 100%;
    min-height: 550px;
    position: relative;
    background: #000;
}

.view-info {
    padding: 25px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border);
}

.view-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: #fff;
}

.view-stats {
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
    color: var(--text-dim);
}

/* FUNNEL */
.sticky-btn {
    position: fixed;
    bottom: -80px;
    right: 40px;
    z-index: 900;
    background: var(--bg-card);
    border: 1px solid var(--accent);
    padding: 12px 25px;
    border-radius: 30px;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    color: #fff;
    text-decoration: none;
    box-shadow: var(--accent-glow);
    transition: 0.4s ease;
}

body:hover .sticky-btn {
    bottom: 30px;
}

.idle-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: 0.4s;
}

.idle-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.idle-modal {
    background: var(--bg-card);
    padding: 40px;
    border: 1px solid var(--accent);
    border-radius: var(--r-lg);
    text-align: center;
    max-width: 500px;
    box-shadow: 0 0 50px rgba(0, 229, 255, 0.2);
}

.idle-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 20px;
}

/* HORIZONTAL SLIDER */
.slider-container {
    width: 100%;
    margin-bottom: 50px;
    overflow: hidden;
    position: relative;
}

.slider-track {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 20px;
    scroll-snap-type: x mandatory;
}

.slider-track::-webkit-scrollbar {
    height: 8px;
}

.slider-track::-webkit-scrollbar-track {
    background: var(--bg-base);
    border-radius: 4px;
}

.slider-track::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.slider-track::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

.slider-card {
    flex: 0 0 280px;
    scroll-snap-align: start;
}

/* TAG CLOUD */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 40px;
}

.tag-pill {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.75rem;
    color: var(--text-dim);
    text-decoration: none;
    transition: 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tag-pill:hover {
    background: rgba(0, 229, 255, 0.05);
    color: var(--accent);
    border-color: var(--accent);
    box-shadow: var(--accent-glow);
}

/* RESPONSIVE */
.mobile-menu-btn {
    display: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
}

@media(max-width: 992px) {
    .app-sidebar {
        position: fixed;
        left: -300px;
        z-index: 1000;
        transition: 0.3s;
    }

    .mobile-menu-btn {
        display: block;
    }
}