:root {
    font-family: system-ui, sans-serif;
    color: #222;
    background: #f5f5f5;
}

body {
    margin: 0;
}

.container {
    width: min(1100px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    background: #222;
    color: white;
    padding: 20px 0;
}

.site-header h1 {
    margin: 0 0 16px;
}

.site-title {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
}

form {
    display: flex;
    gap: 8px;
}

input[type="search"] {
    flex: 1;
    padding: 10px;
    font-size: 1rem;
}

button {
    padding: 10px 18px;
    cursor: pointer;
}

.genres {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 20px 0;
}

.movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.movie-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.movie-card h2 {
    margin-top: 0;
}

.movie-card h2 a {
    color: inherit;
    text-decoration: none;
}

.year,
.original-title {
    color: #666;
}

.genres-list {
    color: #555;
}

.availability {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 15px;
}

.badge {
    background: #eee;
    border-radius: 4px;
    padding: 5px 8px;
    font-size: 0.85rem;
}

.unavailable {
    color: #888;
}

.filter {
    padding: 10px 0;
}

.filter a {
    margin-left: 10px;
}

.movie-detail {
    padding: 30px 0;
}

.movie-detail section {
    margin-top: 30px;
}

table {
    border-collapse: collapse;
    width: 100%;
    background: white;
}

th,
td {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid #ddd;
}

@media (max-width: 600px) {
    .movie-grid {
        grid-template-columns: 1fr;
    }
}

.poster-link {
    display: block;
    margin: -20px -20px 16px;
}

.movie-poster {
    display: block;
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 8px 8px 0 0;
}

.movie-detail-poster {
    width: 300px;
    max-width: 100%;
    margin-bottom: 24px;
}

.movie-detail-poster .movie-poster {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 8px;
}
