/* ====================================
   ReelShorts WebApp — AtlasFlix Style CSS
   Dark theme, mobile-first, gold accent
   ==================================== */

:root {
    /* Core Colors */
    --bg-primary: #0a0a0a;
    --bg-secondary: #141414;
    --bg-card: #111111;
    
    /* Accent (Netflix Red) */
    --accent: #e50914;
    --accent-hover: #ff1a25;
    --accent-glow: rgba(229, 9, 20, 0.3);
    
    /* Text */
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #6b6b80;
    
    /* Borders & Gradients */
    --border: rgba(255, 255, 255, 0.1);
    --gradient-hero: linear-gradient(0deg, var(--bg-primary) 0%, rgba(10,10,10,0.6) 40%, rgba(10,10,10,0.1) 100%);
    --gradient-card: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.9) 100%);
    
    /* Spacing & Sizes */
    --padding-x: 16px;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --nav-height: 60px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100vh;
    padding-bottom: var(--nav-height);
}

::-webkit-scrollbar { display: none; } /* Hide default scrollbar */

/* ===== HEADINGS (OSWALD) ===== */
h1, h2, h3, .section-title {
    font-family: 'Oswald', sans-serif;
    text-transform: uppercase;
}

/* ===== HEADER ===== */
#app-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px var(--padding-x);
    background: linear-gradient(180deg, rgba(0,0,0,0.8), transparent);
    transition: background var(--transition-normal);
}

#app-header.scrolled {
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
}

.logo {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.5px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.icon-btn {
    background: none; border: none; color: white;
    width: 24px; height: 24px;
    position: relative; cursor: pointer;
}

.badge {
    position: absolute;
    top: -2px; right: -2px;
    width: 8px; height: 8px;
    background: var(--gold);
    border-radius: 50%;
}

/* ===== SEARCH CONTAINER ===== */
.search-container {
    position: fixed;
    top: 0; left: 0; right: 0;
    background: var(--bg-primary);
    z-index: 99;
    padding: 70px var(--padding-x) 10px;
    border-bottom: 1px solid var(--border);
    transform: translateY(-100%);
    transition: transform var(--transition-normal);
}

.search-container:not(.hidden) {
    transform: translateY(0);
}

.search-box {
    display: flex; align-items: center;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    margin-bottom: 10px;
}

.search-icon { width: 18px; color: var(--text-muted); }
#search-input {
    flex: 1; background: none; border: none; color: white; padding: 0 10px; outline: none; font-size: 14px;
}
.search-clear { background: none; border: none; color: var(--text-muted); font-size: 16px; }

.genre-filters {
    display: flex; gap: 8px; overflow-x: auto;
    scrollbar-width: none;
}
.genre-chip {
    background: var(--bg-secondary); border: 1px solid transparent;
    color: var(--text-secondary); padding: 4px 12px; border-radius: 20px;
    font-size: 12px; white-space: nowrap; cursor: pointer;
}
.genre-chip.active {
    background: var(--accent-glow); color: var(--accent); border-color: var(--accent);
}

/* ===== HERO SECTION ===== */
.hero-section {
    position: relative;
    width: 100%;
    height: 70vh;
    min-height: 480px;
    overflow: hidden;
    margin-bottom: 10px;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center 20%;
    transition: opacity var(--transition-normal);
}

.hero-gradient {
    position: absolute;
    inset: 0;
    background: var(--gradient-hero);
}

.hero-content {
    position: absolute;
    bottom: 20px;
    left: 0; right: 0;
    padding: 0 var(--padding-x);
    text-align: center;
}

.hero-title {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 16px;
    color: white;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.btn-assistir {
    background: white; color: black; border: none;
    padding: 10px 24px; border-radius: var(--radius-sm);
    font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 6px;
    cursor: pointer;
}

.btn-info {
    background: rgba(40,40,40,0.8); color: white; border: none;
    padding: 10px 16px; border-radius: var(--radius-sm);
    font-weight: 500; font-size: 14px; display: flex; align-items: center; gap: 6px;
    backdrop-filter: blur(5px); cursor: pointer;
}

.hero-pagination {
    position: absolute;
    top: auto; bottom: 8px; left: 0; right: 0;
    display: flex; justify-content: center; gap: 4px;
}
.hero-pagination .dot {
    width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.3);
}
.hero-pagination .dot.active {
    width: 16px; border-radius: 3px; background: var(--accent);
}

/* ===== CONTENT SECTIONS & CARDS ===== */
.content-section {
    padding-top: 15px; margin-bottom: 5px;
}
.content-section.hidden { display: none; }

.section-title {
    font-size: 16px;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--padding-x);
    margin-bottom: 12px;
}

.section-header .section-title {
    margin-bottom: 0;
    padding: 0;
}

.sort-select {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    outline: none;
    cursor: pointer;
}

.scroll-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.scroll-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 30px;
    height: 40px;
    font-size: 18px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.scroll-wrapper:hover .scroll-arrow {
    opacity: 1;
}

.scroll-arrow.left { left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.scroll-arrow.right { right: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }

.horizontal-scroll {
    display: flex; gap: 8px; overflow-x: auto;
    padding: 0 var(--padding-x); scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
}

.grid-container {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 8px; padding: 0 var(--padding-x);
}

.card {
    position: relative; flex-shrink: 0;
    width: 110px; aspect-ratio: 2/3;
    border-radius: var(--radius-md);
    overflow: hidden; cursor: pointer;
    background: var(--bg-card);
    scroll-snap-align: start;
}

.grid-container .card { width: 100%; }

.card-poster { width: 100%; height: 100%; object-fit: cover; }
.card-poster-placeholder {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    background: #1a1a1a; font-size: 30px;
}

.card-overlay {
    position: absolute; bottom: 0; left: 0; right: 0;
    padding: 20px 6px 6px; background: var(--gradient-card);
}
.card-title {
    font-size: 10px; font-weight: 500; font-family: 'Inter', sans-serif;
    text-align: center; line-height: 1.2;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ===== BOTTOM NAVIGATION ===== */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    height: var(--nav-height); background: #080808;
    display: flex; justify-content: space-around; align-items: center;
    border-top: 1px solid rgba(255,255,255,0.05); z-index: 100;
}

.nav-item {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    color: var(--text-muted); cursor: pointer; padding: 5px 10px;
}

.nav-item svg { width: 22px; height: 22px; }
.nav-item span { font-size: 10px; font-weight: 500; }

.nav-item.active { color: var(--accent); }

/* ===== LOADING & OTHERS ===== */
.loading-container {
    display: flex; flex-direction: column; align-items: center; padding: 20px 0; color: var(--text-muted); font-size: 12px;
}
.loading-container.hidden { display: none; }
.spinner {
    width: 24px; height: 24px; border: 2px solid var(--border); border-top-color: var(--accent);
    border-radius: 50%; animation: spin 0.7s linear infinite; margin-bottom: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.no-results { text-align: center; padding: 40px 20px; }
.no-results.hidden { display: none; }

.skeleton {
    background: linear-gradient(90deg, #111 25%, #1a1a1a 50%, #111 75%);
    background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius-md);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.splash-screen {
    position: fixed; inset: 0; background: var(--bg-primary);
    display: flex; align-items: center; justify-content: center; z-index: 9999;
}
.splash-screen.hidden { opacity: 0; visibility: hidden; pointer-events: none; transition: 0.3s; }
