/* Сброс стилей */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0b0d14;
    color: #e2e8f0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* Header */
.header {
    background: #131620;
    border-bottom: 1px solid #1e2235;
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: #818cf8;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo:hover {
    color: #6366f1;
}

.search-form {
    display: flex;
    gap: 8px;
    flex: 1;
    max-width: 500px;
}

.search-form input {
    flex: 1;
    padding: 10px 16px;
    background: #1a1e2e;
    border: 1px solid #1e2235;
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

.search-form input:focus {
    border-color: #818cf8;
}

.search-form input::placeholder {
    color: #64748b;
}

.search-form button {
    padding: 10px 24px;
    background: #818cf8;
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.search-form button:hover {
    background: #6366f1;
}

/* Main */
.main {
    flex: 1;
    padding: 40px 0;
}

.section {
    margin-bottom: 40px;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #e2e8f0;
}

/* Фильтры */
.filters-section {
    background: #131620;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #1e2235;
    margin-bottom: 30px;
}

.filters-form {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-group label {
    font-size: 13px;
    color: #94a3b8;
}

.filter-group select,
.filter-group input {
    padding: 8px 12px;
    background: #1a1e2e;
    border: 1px solid #1e2235;
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 14px;
    outline: none;
    min-width: 140px;
}

.filter-group select:focus,
.filter-group input:focus {
    border-color: #818cf8;
}

.filter-group input[type="number"] {
    min-width: 80px;
    width: 80px;
}

.btn-filter {
    padding: 8px 24px;
    background: #818cf8;
    border: none;
    border-radius: 6px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-filter:hover {
    background: #6366f1;
}

.btn-reset {
    padding: 8px 24px;
    background: transparent;
    border: 1px solid #1e2235;
    border-radius: 6px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-reset:hover {
    border-color: #64748b;
    color: #e2e8f0;
}

/* Сетка фильмов */
.movies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.movie-card {
    background: #131620;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #1e2235;
    transition: transform 0.3s, border-color 0.3s;
}

.movie-card:hover {
    transform: translateY(-4px);
    border-color: #818cf8;
}

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

.movie-card img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    display: block;
}

.movie-card-info {
    padding: 12px 14px;
}

.movie-card-info h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.movie-card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #94a3b8;
}

.movie-card-meta .rating {
    color: #fbbf24;
}

/* Страница фильма */
.movie-page {
    display: flex;
    gap: 40px;
    margin-bottom: 40px;
}

.movie-page-poster {
    flex-shrink: 0;
    width: 300px;
}

.movie-page-poster img {
    width: 100%;
    border-radius: 12px;
    display: block;
}

.movie-page-info {
    flex: 1;
}

.movie-page-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 4px;
}

.movie-page-original {
    font-size: 18px;
    color: #94a3b8;
    margin-bottom: 16px;
}

.movie-page-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.meta-tag {
    padding: 4px 14px;
    background: #1a1e2e;
    border: 1px solid #1e2235;
    border-radius: 20px;
    font-size: 13px;
}

.meta-tag.rating-kp {
    color: #818cf8;
    border-color: rgba(99, 102, 241, 0.25);
    background: rgba(99, 102, 241, 0.06);
}

.meta-tag.rating-imdb {
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.2);
    background: rgba(251, 191, 36, 0.06);
}

.movie-page-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.genre-tag {
    padding: 4px 12px;
    background: #1a1e2e;
    border: 1px solid #1e2235;
    border-radius: 4px;
    font-size: 13px;
    color: #94a3b8;
}

.movie-page-countries {
    font-size: 14px;
    color: #94a3b8;
    margin-bottom: 16px;
}

.movie-page-description {
    font-size: 15px;
    line-height: 1.8;
    color: #cbd5e1;
    margin-bottom: 24px;
}

.btn-watch {
    display: inline-block;
    padding: 14px 40px;
    background: #818cf8;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 18px;
    transition: background 0.3s;
}

.btn-watch:hover {
    background: #6366f1;
}

/* No results */
.no-results {
    text-align: center;
    padding: 40px 0;
    color: #64748b;
    font-size: 18px;
}

/* Footer */
.footer {
    border-top: 1px solid #1e2235;
    padding: 20px 0;
    background: #131620;
    margin-top: auto;
}

.footer p {
    text-align: center;
    color: #64748b;
    font-size: 14px;
}

.footer .footer-info {
    font-size: 12px;
    margin-top: 4px;
}

/* Responsive */
@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-form {
        max-width: 100%;
    }
    
    .movie-page {
        flex-direction: column;
        align-items: center;
    }
    
    .movie-page-poster {
        width: 200px;
    }
    
    .movie-page-title {
        font-size: 24px;
        text-align: center;
    }
    
    .movie-page-original {
        text-align: center;
    }
    
    .movie-page-meta {
        justify-content: center;
    }
    
    .movie-page-genres {
        justify-content: center;
    }
    
    .movie-page-countries {
        text-align: center;
    }
    
    .btn-watch {
        display: block;
        text-align: center;
    }
    
    .filters-form {
        flex-direction: column;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-group select,
    .filter-group input {
        width: 100%;
        min-width: auto;
    }
    
    .filter-group input[type="number"] {
        width: 100%;
    }
    
    .btn-filter,
    .btn-reset {
        width: 100%;
        text-align: center;
    }
    
    .movies-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .movies-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}