/* Reset и базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #e53e3e;
    --secondary-color: #3182ce;
    --dark-color: #2d3748;
    --light-color: #f7fafc;
    --gray-color: #a0aec0;
    --success-color: #38a169;
    --warning-color: #dd6b20;
    --error-color: #e53e3e;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: var(--light-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-color);
}

/* Header */
.header {
    background-color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}

.logo h1 {
    color: var(--primary-color);
    font-size: 1.8rem;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

.main-nav a {
    color: var(--dark-color);
    font-weight: 500;
}

.main-nav a.active,
.main-nav a:hover {
    color: var(--primary-color);
}

.header-search {
    position: relative;
}

.search-form {
    display: flex;
}

.search-form input {
    padding: 0.5rem;
    border: 1px solid var(--gray-color);
    border-radius: 4px 0 0 4px;
    width: 250px;
}

.search-form button {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--gray-color);
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: none;
    z-index: 101;
}

.search-suggestions.active {
    display: block;
}

.suggestion-item {
    display: flex;
    padding: 0.5rem;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.suggestion-item:hover {
    background-color: #f1f5f9;
}

.suggestion-item img {
    width: 40px;
    height: 60px;
    object-fit: cover;
}

.suggestion-info {
    flex: 1;
}

.suggestion-title {
    font-weight: 500;
}

.suggestion-ratings {
    display: flex;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--gray-color);
}

/* Hero section */
.hero {
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('/assets/images/hero-bg.jpg') center/cover;
    color: white;
    text-align: center;
    padding: 4rem 1rem;
    margin-bottom: 2rem;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Search section */
.search-section {
    margin-bottom: 3rem;
}

.main-search-form {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
}

.main-search-form input {
    flex: 1;
    padding: 1rem;
    border: 2px solid var(--secondary-color);
    border-radius: 4px 0 0 4px;
    font-size: 1.1rem;
}

.main-search-form button {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 0 4px 4px 0;
    font-size: 1.1rem;
    cursor: pointer;
}

/* Series grid */
.series-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.series-item {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.series-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.series-poster {
    position: relative;
}

.series-item img {
    width: 100%;
    height: 350px;
    object-fit: cover;
}

.series-rating {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 0.5rem;
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.series-item h3 {
    padding: 1rem;
    font-size: 1.1rem;
    margin: 0;
}

.original-title {
    padding: 0 1rem 1rem;
    color: var(--gray-color);
    font-size: 0.9rem;
    margin: 0;
}

/* Categories */
.categories-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1.5rem 0;
}

.category-item {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-width: 150px;
    transition: transform 0.2s;
}

.category-item:hover {
    transform: translateY(-3px);
}

.category-name {
    font-weight: 500;
}

.category-count {
    background: var(--secondary-color);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
}

/* Series detail page */
.series-header {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.series-poster-large img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.series-info h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.original-title, .alt-titles {
    color: var(--gray-color);
    margin-bottom: 1rem;
}

.series-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.meta-item {
    display: flex;
    flex-direction: column;
}

.meta-label {
    font-weight: 500;
    color: var(--gray-color);
    font-size: 0.9rem;
}

.meta-value {
    font-size: 1.1rem;
}

.series-categories {
    margin: 1.5rem 0;
}

.categories-label {
    font-weight: 500;
    margin-right: 0.5rem;
}

.category-tag {
    display: inline-block;
    background: #e6f7ff;
    color: var(--secondary-color);
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    margin: 0.2rem;
    font-size: 0.9rem;
}

.series-actions {
    margin: 1.5rem 0;
}

.vote-buttons {
    display: flex;
    gap: 1rem;
}

.vote-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-color);
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.vote-btn:hover {
    background: #f1f5f9;
}

.like-btn.active {
    background: #e6fffa;
    border-color: var(--success-color);
    color: var(--success-color);
}

.dislike-btn.active {
    background: #fff5f5;
    border-color: var(--error-color);
    color: var(--error-color);
}

.series-description,
.series-cast,
.series-director {
    margin-bottom: 2rem;
}

.series-description h3,
.series-cast h3,
.series-director h3,
.series-player h3,
.series-comments h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.player-container {
    margin: 1.5rem 0;
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
}

.player-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
}

/* Comments */
.comment-form {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray-color);
    border-radius: 4px;
    font-family: inherit;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.comment-form button {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.comment-item {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.comment-author {
    font-weight: 500;
}

.comment-date {
    color: var(--gray-color);
    font-size: 0.9rem;
}

.comment-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.comment-reaction {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: 1px solid var(--gray-color);
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.comment-reaction.active {
    background: #f1f5f9;
}

.no-comments {
    text-align: center;
    padding: 2rem;
    color: var(--gray-color);
}

/* Footer */
.footer {
    background: var(--dark-color);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 3rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #cbd5e0;
}

.footer-section a:hover {
    color: white;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    display: inline-block;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    text-align: center;
    line-height: 40px;
    transition: background 0.2s;
}

.social-links a:hover {
    background: var(--secondary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #4a5568;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Responsive design */
@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        gap: 1rem;
    }
    
    .main-nav ul {
        gap: 1rem;
    }
    
    .search-form input {
        width: 200px;
    }
    
    .series-header {
        grid-template-columns: 1fr;
    }
    
    .series-poster-large {
        max-width: 250px;
        margin: 0 auto;
    }
    
    .series-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .header-inner {
        align-items: stretch;
    }
    
    .main-nav ul {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .search-form {
        width: 100%;
    }
    
    .search-form input {
        width: 100%;
    }
    
    .hero h2 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
}