/* =========================================================================
   VARIÁVEIS GLOBAIS
   ========================================================================= */
:root {
    --bg-main: #0a0d14;
    /* Preto levemente azulado / fundo escuro */
    --bg-surface: #121826;
    /* Fundo de elementos */
    --bg-surface-hover: #1c2538;

    --color-primary: #0088ff;
    /* Azul vibrante */
    --color-primary-glow: rgba(0, 136, 255, 0.4);
    --color-primary-hover: #33a1ff;

    --text-main: #ffffff;
    /* Branco */
    --text-muted: #94a3b8;
    /* Cinza claro/azulado */

    --border-color: rgba(255, 255, 255, 0.05);

    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 24px;
    --radius-round: 50px;
}

/* =========================================================================
   RESET E CONFIGURAÇÕES BASÍCAS
   ========================================================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
    outline: none;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-normal);
}

button {
    cursor: pointer;
    border: none;
    background: none;
    transition: var(--transition-normal);
    font-family: inherit;
}

ul {
    list-style: none;
}

.text-blue {
    color: var(--color-primary);
}

/* =========================================================================
   BOTÕES
   ========================================================================= */
.btn {
    padding: 12px 24px;
    border-radius: var(--radius-round);
    font-weight: 600;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
    box-shadow: 0 4px 15px var(--color-primary-glow);
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--color-primary-glow);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* =========================================================================
   SCROLLBAR CUSTOMIZADA
   ========================================================================= */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-surface-hover);
    border-radius: var(--radius-round);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

/* =========================================================================
   NAVBAR (HEADER)
   ========================================================================= */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 0.8rem 0;
    background: rgba(10, 13, 20, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    transition: var(--transition-normal);
}



.nav-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 4%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: 1px;
    color: white;
    text-transform: uppercase;
    font-family: 'Outfit', sans-serif;
    display: inline-block;
}

.logo i {
    display: none;
}

.logo span {
    font-weight: 900;
    color: transparent;
    background: linear-gradient(90deg, var(--color-primary), #00d4ff);
    -webkit-background-clip: text;
    background-clip: text;
    text-shadow: 0px 0px 15px rgba(0, 136, 255, 0.4);
    margin-left: 0px;
}

/* SEARCH ICON (HEADER) */
.search-icon-link {
    color: var(--text-muted);
    font-size: 1.4rem;
    transition: var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-left: auto;
    /* Força firmemente para a extrema direita na PC */
}

.search-icon-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

/* BIG SEARCH INPUT (SEARCH PAGE) */
.search-input-section {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-round);
    padding: 15px 25px;
    width: 100%;
    max-width: 800px;
    transition: var(--transition-normal);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.search-input-wrapper:focus-within {
    border-color: var(--color-primary);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 5px 20px rgba(0, 136, 255, 0.2);
}

.search-input-wrapper i {
    color: var(--text-muted);
    font-size: 1.5rem;
    margin-right: 15px;
    transition: var(--transition-normal);
}

.search-input-wrapper:focus-within i {
    color: white;
}

.search-input-wrapper input {
    background: transparent;
    border: none;
    color: white;
    width: 100%;
    font-size: 1.2rem;
    font-weight: 500;
}

.search-input-wrapper input::placeholder {
    color: var(--text-muted);
}

/* =========================================================================
   FLOATING NAVIGATION (PILL)
   ========================================================================= */
.floating-nav {
    position: fixed;
    bottom: 30px;
    /* Pouco mais alto no PC */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(18, 24, 38, 0.85);
    /* Dark surface */
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    padding: 10px 16px;
    /* Mais recheio */
    border-radius: var(--radius-round);
    display: flex;
    gap: 12px;
    z-index: 1000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
    transition: var(--transition-normal);
}

.floating-nav a {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 1.15rem;
    /* Fonte maior no PC */
    padding: 12px 30px;
    /* Botão mais comprido e alto no PC*/
    border-radius: var(--radius-round);
    transition: var(--transition-normal);
}

.floating-nav a:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.floating-nav a.active {
    background: var(--color-primary);
    color: white;
    box-shadow: 0 4px 15px var(--color-primary-glow);
}

/* =========================================================================
   HERO SECTION
   ========================================================================= */
.hero {
    position: relative;
    height: 85vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 5%;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Imagem de placeholder fantástica de espaço / sci-fi */
    background: url('https://images.unsplash.com/photo-1541873676-a18131494184?q=80&w=2518&auto=format&fit=crop') center/cover no-repeat;
    z-index: -2;
    transform: scale(1.05);
    /* Soft zoom para animacao futuramente */
    transition: transform 10s ease;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right,
            rgba(10, 13, 20, 1) 0%,
            rgba(10, 13, 20, 0.7) 50%,
            rgba(10, 13, 20, 0.1) 100%),
        linear-gradient(to top, var(--bg-main) 0%, transparent 20%);
    z-index: -1;
}

.hero-content {
    max-width: 650px;
    z-index: 1;
    animation: fadeInUp 1s ease forwards;
    opacity: 0;
    transform: translateY(30px);
}

.badge {
    background: rgba(0, 136, 255, 0.2);
    color: var(--color-primary);
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 1rem;
    border: 1px solid rgba(0, 136, 255, 0.3);
}

.hero-title {
    font-size: 4.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5);
}

.hero-meta {
    display: flex;
    gap: 16px;
    align-items: center;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 2rem;
    text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.5);
}

.hero-actions {
    display: flex;
    gap: 16px;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================================================
   MEDIA SECTIONS (Filmes / Séries)
   ========================================================================= */
.content-section {
    padding: 4rem 5%;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 2rem;
    font-weight: 700;
}

.view-all {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
}

.view-all:hover {
    color: var(--color-primary);
}

.view-all i {
    transition: transform var(--transition-fast);
}

.view-all:hover i {
    transform: translateX(4px);
}

.carousel-container {
    position: relative;
    display: flex;
    align-items: center;
}

.media-grid {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    /* Hide scrollbar for firefox */
    -ms-overflow-style: none;
    /* Hide scrollbar for IE/Edge */
}

/* Modifier para páginas dedicadas (grid 6 colunas PC, 4 tablet, 3 mobile) */
.media-grid.wrapped {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    overflow-x: visible;
    scroll-snap-type: none;
    padding-bottom: 0;
    gap: 1.5rem;
    justify-content: center;
}

.media-grid.wrapped .media-card {
    min-width: 100%;
    max-width: 100%;
}

.media-grid::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar for Chrome/Safari */
}

.carousel-btn {
    position: absolute;
    z-index: 10;
    background: rgba(18, 24, 38, 0.8);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition-normal);
}

.carousel-container:hover .carousel-btn {
    opacity: 1;
}

.carousel-btn:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    transform: scale(1.1);
}

.carousel-btn.left {
    left: -22px;
}

.carousel-btn.right {
    right: -22px;
}

/* CARDS */
.media-card {
    min-width: 240px;
    max-width: 240px;
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    scroll-snap-align: start;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.media-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.8);
    z-index: 2;
}

.card-img-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 3;
    overflow: hidden;
}

.quality-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 2;
}

.card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease, opacity 0.5s ease;
}

/* Estado inicial para lazy loading (se desejar animar Fade In depois) */
.lazy-poster {
    opacity: 0.8;
}

.media-card.tmdb-loaded .lazy-poster {
    opacity: 1;
}

.media-card:hover .lazy-poster {
    transform: scale(1.1);
}

.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(10, 13, 20, 0.95) 0%, transparent 60%);
    opacity: 0;
    transition: var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-card:hover .card-overlay {
    opacity: 1;
}

.play-icon {
    width: 50px;
    height: 50px;
    background: var(--color-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transform: translateY(20px);
    transition: var(--transition-normal);
    box-shadow: 0 4px 15px var(--color-primary-glow);
}

.media-title {
    margin-top: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    color: white;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 4px;
}

.media-card:hover .play-icon {
    transform: translateY(0);
}



/* =========================================================================
   FOOTER
   ========================================================================= */
footer {
    background: var(--bg-surface);
    padding: 4rem 5% 2rem;
    margin-top: 4rem;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-brand {
    max-width: 350px;
}

.footer-brand p {
    color: var(--text-muted);
    margin-top: 1rem;
    line-height: 1.6;
}

.footer-links {
    display: flex;
    gap: 4rem;
}

.link-column h3 {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: white;
}

.link-column a {
    display: block;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
}

.link-column a:hover {
    color: var(--color-primary);
    transform: translateX(4px);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* =========================================
   GENRE PILLS (TOP BAR)
   ========================================= */
.genre-pills-container {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding: 10px 20px;
    margin: 90px auto 20px auto;
    /* 90px clears the fixed navbar */
    max-width: 1200px;
    scrollbar-width: none;
    /* Firefox */
}

.genre-pills-container::-webkit-scrollbar {
    display: none;
    /* Safari and Chrome */
}

.genre-pill {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
    transition: all 0.3s ease;
}

.genre-pill:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 212, 255, 0.3);
}

/* =========================================
   RESPONSIVE DESIGN
   ========================================= */
@media (max-width: 900px) {

    .nav-container {
        gap: 15px;
    }

    .nav-links {
        display: flex;
        gap: 15px;
        margin-left: auto;
    }

    /* Resizer original para celular do balão flutuante */
    .floating-nav {
        bottom: 24px;
        padding: 8px 12px;
        gap: 8px;
    }

    .floating-nav a {
        font-size: 0.95rem;
        padding: 10px 24px;
    }

    .nav-links a {
        font-size: 0.95rem;
    }

    .search-icon-link {
        width: 38px;
        height: 38px;
        font-size: 1.2rem;
    }

    .search-input-wrapper {
        padding: 12px 15px;
        border-radius: var(--radius-md);
    }

    .search-input-wrapper i {
        font-size: 1.2rem;
        margin-right: 10px;
    }

    .search-input-wrapper input {
        font-size: 1rem;
    }

    .search-input-wrapper input::placeholder {
        font-size: 0.9rem;
    }

    .mobile-menu-btn,
    .mobile-menu-overlay {
        display: none !important;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .carousel-btn {
        display: none;
    }

    .media-card {
        min-width: 200px;
        max-width: 200px;
    }

    .media-grid.wrapped {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 600px) {
    .hero {
        align-items: flex-end;
        padding-bottom: 8rem;
        /* Creates space for the floating nav pill */
        text-align: center;
        min-height: 500px;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .hero-bg {
        background-position: 70% center;
    }

    .hero-overlay {
        background: linear-gradient(to top, rgba(10, 13, 20, 1) 10%, rgba(10, 13, 20, 0.4) 60%, transparent 100%);
    }

    .hero-actions {
        justify-content: center;
        flex-direction: column;
    }

    .hero-meta {
        justify-content: center;
    }

    .btn {
        width: 100%;
    }

    .media-card {
        min-width: 100px;
        max-width: 100%;
    }

    .media-grid.wrapped {
        grid-template-columns: repeat(3, 1fr);
        /* 3 colunas forçadas conforme pedido do usuário */
        gap: 0.5rem;
    }

    .media-title {
        font-size: 0.75rem;
        margin-top: 6px;
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        line-height: 1.3;
        color: var(--text-muted);
    }

    .search-input-wrapper {
        padding: 0 4px;
        margin-bottom: 5px;
        /* Added spacing from edge */
    }

    .search-input-wrapper i {
        font-size: 1.2rem;
        margin-right: 10px;
    }

    .search-input-wrapper input {
        font-size: 1rem;
    }

    .search-input-wrapper input::placeholder {
        font-size: 0.85rem;
    }

    .footer-content {
        flex-direction: column;
    }

    .footer-links {
        flex-direction: column;
        gap: 2rem;
    }
}