* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #0f0f0f;
    color: #fff;
    line-height: 1.6;
}

header {
    background: #1a1a1a;
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.logo a {
    font-size: 1.5rem;
    font-weight: bold;
    color: #e50914;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: #e50914;
}

.search-form {
    display: flex;
    gap: 0.5rem;
}

.search-form input {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    background: #2a2a2a;
    color: #fff;
    min-width: 250px;
}

.search-form button {
    padding: 0.5rem 1.5rem;
    background: #e50914;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.search-form button:hover {
    background: #b20710;
}

main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.hero {
    text-align: center;
    padding: 3rem 0;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.content-section {
    margin: 3rem 0;
}

.content-section h2 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 2rem;
}

.card {
    transition: transform 0.3s;
}

.card:hover {
    transform: scale(1.05);
}

.card a {
    text-decoration: none;
    color: #fff;
}

.card img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.card h3 {
    margin-top: 0.5rem;
    font-size: 1rem;
}

.card .rating {
    color: #ffd700;
    font-size: 0.9rem;
}

.card .year {
    color: #888;
    font-size: 0.9rem;
}

.movie-detail {
    position: relative;
}

.backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 500px;
    background-size: cover;
    background-position: center;
    opacity: 0.3;
    z-index: -1;
}

.detail-content {
    display: flex;
    gap: 2rem;
    margin-bottom: 3rem;
    position: relative;
    z-index: 1;
}

.poster img {
    width: 300px;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.7);
}

.info {
    flex: 1;
}

.info h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.info .year {
    color: #888;
    font-weight: normal;
}

.meta {
    display: flex;
    gap: 1.5rem;
    margin: 1rem 0;
    color: #ccc;
}

.genres {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
}

.genres a {
    padding: 0.3rem 0.8rem;
    background: #2a2a2a;
    border-radius: 20px;
    text-decoration: none;
    color: #fff;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.genres a:hover {
    background: #e50914;
}

.overview {
    line-height: 1.8;
    margin: 1rem 0;
}

.watch-btn {
    display: inline-block;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #e50914 0%, #b20710 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    margin: 1.5rem 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(229, 9, 20, 0.4);
}

.watch-btn:hover {
    background: linear-gradient(135deg, #b20710 0%, #e50914 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(229, 9, 20, 0.6);
}

.cast {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.cast-member {
    text-align: center;
}

.cast-member img {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.cast-member .character {
    color: #888;
    font-size: 0.85rem;
}

.similar {
    margin-top: 3rem;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
}

.pagination a {
    padding: 0.5rem 1rem;
    background: #2a2a2a;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.3s;
}

.pagination a:hover,
.pagination a.active {
    background: #e50914;
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: #e50914;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

footer {
    background: #1a1a1a;
    padding: 2rem;
    text-align: center;
    margin-top: 4rem;
}

.footer-nav {
    margin-top: 1rem;
}

.footer-nav a {
    color: #fff;
    text-decoration: none;
    margin: 0 1rem;
}

.error-page {
    text-align: center;
    padding: 4rem 0;
}

.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: #e50914;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .detail-content {
        flex-direction: column;
    }
    
    .poster img {
        width: 100%;
        max-width: 300px;
    }
    
    nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    .search-form input {
        min-width: 200px;
    }
}
