/* Basic Reset */
body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; margin: 0; background: #141414; color: #fff; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 15px; }
a { text-decoration: none; color: inherit; }

/* Header */
.header { background: #000; padding: 20px 0; border-bottom: 2px solid #e50914; }
.logo { font-size: 24px; font-weight: bold; color: #fff; }
.logo span { color: #e50914; }
.main-menu ul { display: flex; list-style: none; padding: 0; margin: 15px 0 0 0; }
.main-menu li { margin-right: 20px; }

/* Sections */
.home-section { padding: 40px 0; border-bottom: 1px solid #333; }
.home-section h2 { font-size: 28px; margin-bottom: 20px; color: #e50914; }
.view-all { display: inline-block; margin-top: 15px; color: #aaa; font-size: 14px; border: 1px solid #444; padding: 5px 15px; border-radius: 4px; }

/* Footer Sitemap */
.footer { background: #000; padding: 50px 0 20px; margin-top: 50px; }
.sitemap { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 30px; }
.footer-col h4 { color: #e50914; margin-bottom: 15px; }
.footer-col ul { list-style: none; padding: 0; }
.footer-col li { margin-bottom: 8px; color: #ccc; }
.copyright { text-align: center; margin-top: 40px; font-size: 13px; color: #666; border-top: 1px solid #222; padding-top: 20px; }

/* Mobile Optimization */
@media (max-width: 768px) {
    .main-menu ul { overflow-x: auto; white-space: nowrap; }
    .home-section h2 { font-size: 22px; }
}

/* Movie Card Styles (legacy .movie-card; Tailwind grids use .movie-item in templates) */
.movie-card {
    background: #1f1f1f;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.movie-card:hover {
    transform: scale(1.05);
}

.poster-box {
    position: relative;
    aspect-ratio: 2/3;
}

.poster-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rating-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(229, 9, 20, 0.9);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.quality-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: #4caf50;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    text-transform: uppercase;
}

.movie-info {
    padding: 10px;
}

.movie-info .movie-title {
    font-size: 15px;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.movie-year {
    color: #888;
    font-size: 13px;
}

/* Full Story Styles */
.movie-header { display: flex; gap: 30px; margin-top: 30px; }
.movie-poster-side { flex: 0 0 300px; }
.full-poster { width: 100%; border-radius: 12px; box-shadow: 0 10px 20px rgba(0,0,0,0.5); }
.movie-details-side { flex: 1; }
.full-title { font-size: 36px; margin: 0 0 15px 0; color: #fff; }

.meta-info { display: flex; gap: 15px; margin-bottom: 20px; }
.imdb-tag { background: #f5c518; color: #000; font-weight: bold; padding: 3px 10px; border-radius: 4px; }
.quality-tag { background: #e50914; padding: 3px 10px; border-radius: 4px; font-weight: bold; }

.movie-specs { list-style: none; padding: 0; margin: 20px 0; border-top: 1px solid #333; padding-top: 20px; }
.movie-specs li { margin-bottom: 10px; color: #ccc; }
.movie-specs strong { color: #fff; width: 120px; display: inline-block; }

.btn-trailer { display: inline-block; background: #ff0000; color: #fff; padding: 12px 25px; border-radius: 5px; font-weight: bold; margin-top: 20px; transition: 0.3s; }
.btn-trailer:hover { background: #cc0000; }

/* Player Box */
.player-section { margin-top: 50px; background: #000; padding: 30px; border-radius: 12px; }
.video-responsive { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; }
.video-responsive iframe, .video-responsive video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }

/* Responsive adjustments */
@media (max-width: 900px) {
    .movie-header { flex-direction: column; align-items: center; text-align: center; }
    .movie-poster-side { flex: 0 0 250px; width: 250px; }
    .movie-specs strong { display: block; margin-bottom: 5px; }
}

/* Pagination Styles */
.pagination {
    text-align: center;
    margin: 40px 0;
    padding: 20px 0;
}

.nav-links {
    display: inline-flex;
    gap: 10px;
    align-items: center;
}

.nav-links a, .nav-links span {
    padding: 8px 16px;
    background: #222;
    color: #fff;
    border-radius: 4px;
    transition: 0.3s;
    font-size: 14px;
}

.nav-links a:hover {
    background: #e50914;
}

.nav-links .nav-current {
    background: #e50914;
    font-weight: bold;
}

.nav-prev, .nav-next {
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Login Panel Styles */
.user-panel {
    background: #222;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.user-info { display: flex; align-items: center; gap: 15px; }
.user-avatar { width: 50px; height: 50px; border-radius: 50%; border: 2px solid #e50914; }
.user-name { font-weight: bold; font-size: 16px; color: #fff; }
.user-links { font-size: 12px; color: #aaa; margin-top: 5px; }
.user-links a:hover { color: #e50914; }

.admin-btn a {
    background: #e50914;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

/* Guest Login Form */
.login-form {
    background: #1a1a1a;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #333;
}

.login-input input {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    background: #000;
    border: 1px solid #444;
    color: #fff;
    border-radius: 4px;
    box-sizing: border-box;
}

.login-btns { display: flex; gap: 10px; margin-top: 5px; }
.btn-signin {
    background: #e50914;
    border: none;
    color: #fff;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    flex: 1;
}

.btn-signup {
    background: #333;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
    flex: 1;
}

.login-extra { text-align: center; margin-top: 15px; font-size: 12px; color: #888; }

.header-flex { display: flex; justify-content: space-between; align-items: center; padding-bottom: 15px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 20px; border-left: 4px solid #e50914; padding-left: 15px; }
.section-head h2 { margin: 0; }
.hero-slider { margin-bottom: 40px; border-radius: 15px; overflow: hidden; border: 1px solid #333; }
/* Filter Styles */
.movie-filter {
    background: #1a1a1a;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    border: 1px solid #333;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    align-items: flex-end;
}

.filter-item label {
    display: block;
    font-size: 12px;
    color: #888;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.filter-item select {
    width: 100%;
    background: #000;
    color: #fff;
    border: 1px solid #444;
    padding: 10px;
    border-radius: 5px;
    outline: none;
}

.btn-filter {
    width: 100%;
    background: #e50914;
    color: #fff;
    border: none;
    padding: 11px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.btn-filter:hover { background: #b2070f; }

@media (max-width: 600px) {
    .filter-grid { grid-template-columns: 1fr; }
}

.info-box { background: #222; border-left: 5px solid #e50914; padding: 20px; margin: 20px 0; border-radius: 4px; }
.info-title { color: #e50914; margin-top: 0; }
.info-text { color: #ccc; line-height: 1.6; }

/* Sidebar Mini Story */
.mini-story { margin-bottom: 15px; border-bottom: 1px solid #222; padding-bottom: 10px; }
.mini-link { display: flex; gap: 12px; align-items: center; }
.mini-poster { flex: 0 0 60px; height: 80px; border-radius: 4px; overflow: hidden; }
.mini-poster img { width: 100%; height: 100%; object-fit: cover; }
.mini-title { font-size: 14px; margin: 0 0 5px 0; color: #fff; line-height: 1.3; }
.mini-meta { font-size: 12px; color: #888; display: flex; gap: 10px; }
.mini-rating { color: #f5c518; font-weight: bold; }
.mini-story:last-child { border: none; }

/* Legacy grid wrapper (avoid fixed img heights — breaks Tailwind / aspect-ratio cards) */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.grid-container img {
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: cover;
    border-radius: 8px;
}

.movie-poster {
    position: relative;
    height: 270px;
    border-radius: 8px;
    overflow: hidden;
    background: #222; /* Եթե նկարը դանդաղ բացվի, տակը սև կլինի */
}

.movie-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Սա կարևոր է, որ նկարը չձգվի */
    transition: 0.3s;
}

.movie-card:hover img {
    transform: scale(1.05);
}

.movie-rating {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(229, 9, 20, 0.9);
    color: #fff;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

/* Scoped legacy titles — avoid clipping Tailwind card headings inside .movie-item */
.movie-card .movie-title,
.grid-container .movie-title {
    font-size: 15px;
    margin: 10px 0 5px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Tailwind Netflix cards: legacy rules must not fix poster height */
.movie-item img {
    max-height: none !important;
    border-radius: inherit;
}