* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #e50914;
    --primary-gradient: linear-gradient(135deg, #e50914 0%, #b20710 100%);
    --secondary-color: #141414;
    --text-color: #ffffff;
    --text-secondary: #b3b3b3;
    --bg-color: #000000;
    --card-bg: #1a1a1a;
    --hover-color: #2a2a2a;
    --accent-gold: #ffd700;
    --shadow-soft: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-medium: 0 8px 16px rgba(0, 0, 0, 0.5);
    --shadow-hard: 0 16px 32px rgba(0, 0, 0, 0.7);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(to bottom, #000000 0%, #0a0a0a 50%, #000000 100%);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: linear-gradient(180deg, rgba(20, 20, 20, 0.95) 0%, rgba(20, 20, 20, 0.8) 100%);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(229, 9, 20, 0.3);
    border-bottom: 2px solid rgba(229, 9, 20, 0.2);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    text-shadow: 0 0 20px rgba(229, 9, 20, 0.5);
}

.logo i {
    font-size: 2rem;
    filter: drop-shadow(0 0 10px rgba(229, 9, 20, 0.8));
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: bold;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

nav a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-gradient);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

nav a:hover::before,
nav a.active::before {
    width: 80%;
}

nav a:hover,
nav a.active {
    color: var(--primary-color);
    background-color: rgba(229, 9, 20, 0.1);
    transform: translateY(-2px);
}

.search-box {
    display: flex;
    gap: 0.5rem;
}

#searchInput {
    padding: 0.6rem 1rem;
    border: 2px solid transparent;
    border-radius: 25px;
    background-color: var(--card-bg);
    color: var(--text-color);
    width: 300px;
    outline: none;
    transition: all 0.3s ease;
}

#searchInput:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(229, 9, 20, 0.4);
    background-color: rgba(26, 26, 26, 0.8);
}

#searchBtn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 25px;
    background: var(--primary-gradient);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(229, 9, 20, 0.4);
}

#searchBtn:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 6px 20px rgba(229, 9, 20, 0.6);
}

/* Hero Section */
#hero {
    background: linear-gradient(135deg, #e50914 0%, #831010 50%, #141414 100%);
    padding: 4rem 2rem;
    text-align: center;
    border-radius: 0;
    margin: 0;
    width: 100%;
    position: relative;
    overflow: hidden;
}

#hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 50%, rgba(229, 9, 20, 0.3), transparent 50%),
                radial-gradient(circle at 70% 50%, rgba(178, 7, 16, 0.3), transparent 50%);
    animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-content h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
    font-weight: 700;
    letter-spacing: 2px;
}

.hero-content p {
    font-size: 1.5rem;
    opacity: 0.9;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2rem 0;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h2 {
    font-size: 2rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    letter-spacing: 1px;
    text-shadow: 0 0 30px rgba(229, 9, 20, 0.3);
}

.filters {
    display: flex;
    gap: 1rem;
}

.filters select {
    padding: 0.6rem 1rem;
    border: 2px solid transparent;
    border-radius: 8px;
    background-color: var(--card-bg);
    color: var(--text-color);
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
}

.filters select:hover:not(:disabled) {
    border-color: var(--primary-color);
    background-color: var(--hover-color);
}

.filters select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: var(--secondary-color);
}

/* Active Filters */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 1.5rem 0;
    padding: 0 20px;
    min-height: 40px;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, rgba(229, 9, 20, 0.2), rgba(229, 9, 20, 0.1));
    border: 2px solid var(--primary-color);
    padding: 0.5rem 0.75rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
    animation: fadeIn 0.3s ease;
    box-shadow: 0 4px 10px rgba(229, 9, 20, 0.2);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.filter-tag span {
    color: var(--text-color);
}

.remove-filter {
    background: transparent;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.remove-filter:hover {
    background: var(--primary-color);
    transform: rotate(90deg) scale(1.2);
}

.clear-filters-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #666, #444);
    border: 2px solid #888;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-filters-btn:hover {
    background: linear-gradient(135deg, #888, #666);
    border-color: var(--text-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

.clear-filters-btn i {
    font-size: 1rem;
}

/* Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
    width: 100%;
}

.card {
    background: linear-gradient(145deg, #1a1a1a 0%, #0d0d0d 100%);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0;
}

.card:hover::before {
    opacity: 0.1;
}

.card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 20px 40px rgba(229, 9, 20, 0.4),
                0 0 30px rgba(229, 9, 20, 0.2);
    border-color: var(--primary-color);
}

.card img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    transition: transform 0.4s ease;
    position: relative;
    z-index: 1;
}

.card:hover img {
    transform: scale(1.1);
}

.card-info {
    padding: 1rem;
    position: relative;
    z-index: 1;
}

.card-title {
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.rating {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--accent-gold);
    font-weight: 600;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.rating i {
    font-size: 0.8rem;
}

/* Loading More */
#loading-more {
    text-align: center;
    padding: 2rem;
    margin: 2rem 0;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(5px);
    overflow-y: auto;
}

.modal-content {
    background: linear-gradient(145deg, #1a1a1a 0%, #0d0d0d 100%);
    margin: 2% auto;
    padding: 0;
    width: 95%;
    max-width: 1400px;
    border-radius: 15px;
    position: relative;
    animation: slideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 20px 60px rgba(229, 9, 20, 0.3),
                0 0 40px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(229, 9, 20, 0.2);
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    color: var(--text-color);
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.close:hover {
    background: var(--primary-color);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 0 20px rgba(229, 9, 20, 0.6);
}

.modal-header {
    position: relative;
    height: 500px;
    background-size: cover;
    background-position: center;
    border-radius: 15px 15px 0 0;
}

.modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, 
                rgba(13, 13, 13, 1) 0%,
                rgba(13, 13, 13, 0.8) 30%,
                transparent 100%);
}

.modal-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    z-index: 1;
}

.modal-body-content {
    padding: 2rem;
}

.modal-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.9);
    font-weight: 700;
    letter-spacing: 1px;
}

.modal-meta {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.modal-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.overview {
    font-size: 1.1rem;
    line-height: 1.8;
    margin: 1.5rem 0;
}

.genres {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 1rem 0;
}

.genre-tag {
    background: var(--primary-gradient);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    box-shadow: 0 4px 10px rgba(229, 9, 20, 0.3);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.cast-section {
    margin-top: 2rem;
}

.cast-section h3 {
    margin-bottom: 1rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.trailer-section {
    margin-top: 2rem;
}

.trailer-section h3 {
    margin-bottom: 1rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.trailer-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    background-color: #000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(229, 9, 20, 0.3);
}

.trailer-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.cast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
}

.cast-item {
    text-align: center;
}

.cast-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.cast-item:hover img {
    transform: scale(1.05);
    border-color: var(--primary-color);
    box-shadow: 0 8px 20px rgba(229, 9, 20, 0.4);
}

.cast-name {
    font-size: 0.9rem;
    font-weight: bold;
}

.cast-character {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Footer */
footer {
    background: linear-gradient(180deg, transparent 0%, rgba(20, 20, 20, 0.8) 100%);
    padding: 2rem 0;
    text-align: center;
    margin-top: 4rem;
    border-top: 1px solid rgba(229, 9, 20, 0.2);
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

footer a:hover {
    text-shadow: 0 0 10px rgba(229, 9, 20, 0.8);
    text-decoration: underline;
}

/* Loading */
.loading {
    text-align: center;
    padding: 3rem;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.loading i {
    animation: spin 1s linear infinite;
    filter: drop-shadow(0 0 10px rgba(229, 9, 20, 0.8));
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* Responsive */

/* Tablets e dispositivos médios (768px - 1024px) */
@media (max-width: 1024px) {
    .container {
        padding: 0 15px;
    }

    .grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 1.5rem;
    }

    .hero-content h2 {
        font-size: 2.5rem;
    }

    .hero-content p {
        font-size: 1.3rem;
    }

    .modal-content {
        width: 90%;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .filters {
        width: 100%;
        justify-content: flex-start;
    }
}

/* Tablets (768px - 1024px) */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        gap: 1rem;
    }

    nav ul {
        gap: 0.5rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    nav a {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }

    .search-box {
        width: 100%;
        justify-content: center;
    }

    #searchInput {
        width: 100%;
        max-width: 300px;
    }

    .logo h1 {
        font-size: 1.3rem;
    }

    .logo i {
        font-size: 1.5rem;
    }

    #hero {
        padding: 3rem 1.5rem;
    }

    .hero-content h2 {
        font-size: 2rem;
        letter-spacing: 1px;
    }

    .hero-content p {
        font-size: 1.2rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .section-header h2 {
        font-size: 1.7rem;
    }

    .filters {
        width: 100%;
        flex-direction: column;
        gap: 0.75rem;
    }

    .filters select {
        width: 100%;
    }

    .active-filters {
        padding: 0;
    }

    .grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }

    .card img {
        height: 250px;
    }

    .modal-content {
        width: 95%;
        margin: 5% auto;
    }

    .modal-header {
        height: 300px;
    }

    .modal-title {
        font-size: 1.8rem;
    }

    .modal-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .modal-body-content {
        padding: 1.5rem;
    }

    .cast-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .cast-item img {
        height: 120px;
    }

    .close {
        right: 10px;
        top: 10px;
        width: 40px;
        height: 40px;
        font-size: 28px;
    }
}

/* Mobile devices (até 480px) */
@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }

    .logo h1 {
        font-size: 1.1rem;
    }

    .logo i {
        font-size: 1.3rem;
    }

    nav ul {
        gap: 0.3rem;
    }

    nav a {
        padding: 0.3rem 0.6rem;
        font-size: 0.85rem;
    }

    #searchInput {
        font-size: 0.9rem;
        padding: 0.5rem 0.8rem;
    }

    #searchBtn {
        padding: 0.5rem 1rem;
    }

    #hero {
        padding: 2rem 1rem;
    }

    .hero-content h2 {
        font-size: 1.5rem;
        letter-spacing: 0.5px;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .section-header h2 {
        font-size: 1.5rem;
    }

    .filters select {
        font-size: 0.9rem;
        padding: 0.5rem 0.8rem;
    }

    .filter-tag {
        font-size: 0.85rem;
        padding: 0.4rem 0.6rem;
    }

    .clear-filters-btn {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }

    .grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 0.75rem;
    }

    .card img {
        height: 200px;
    }

    .card-title {
        font-size: 0.9rem;
    }

    .card-meta {
        font-size: 0.8rem;
    }

    .modal-content {
        width: 98%;
        margin: 2% auto;
        border-radius: 10px;
    }

    .modal-header {
        height: 250px;
        border-radius: 10px 10px 0 0;
    }

    .modal-overlay {
        padding: 1rem;
    }

    .modal-title {
        font-size: 1.5rem;
    }

    .modal-body-content {
        padding: 1rem;
    }

    .modal-meta {
        font-size: 0.9rem;
    }

    .genre-tag {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }

    .overview h3 {
        font-size: 1.2rem;
    }

    .overview p {
        font-size: 0.95rem;
    }

    .cast-section h3,
    .trailer-section h3 {
        font-size: 1.2rem;
    }

    .cast-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 0.75rem;
    }

    .cast-item img {
        height: 100px;
    }

    .cast-name {
        font-size: 0.85rem;
    }

    .cast-character {
        font-size: 0.75rem;
    }

    .close {
        right: 5px;
        top: 5px;
        width: 35px;
        height: 35px;
        font-size: 24px;
    }

    .loading {
        padding: 2rem;
        font-size: 1.2rem;
    }
}

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .modal-header {
        height: 200px;
    }

    #hero {
        padding: 2rem 1.5rem;
    }

    .hero-content h2 {
        font-size: 1.8rem;
    }

    .hero-content p {
        font-size: 1.1rem;
    }
}

/* Dispositivos muito pequenos (menos de 360px) */
@media (max-width: 360px) {
    .grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    }

    .card img {
        height: 180px;
    }

    nav a {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
    }

    .hero-content h2 {
        font-size: 1.3rem;
    }

    .section-header h2 {
        font-size: 1.3rem;
    }
}

/* Large desktops (1440px+) */
@media (min-width: 1440px) {
    .grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 2.5rem;
    }

    .card img {
        height: 350px;
    }

    .modal-content {
        max-width: 1600px;
    }

    .modal-header {
        height: 600px;
    }
}
