/*
 *  Main Stylesheet for MovieFlix
 *  --------------------------------
 *  This file contains all styles for the site,
 *  organized from global styles down to specific components
 *  and responsive media queries.
 */

/* --- Global Styles & Variables --- */
:root {
    --primary-color: #0d1117;
    --secondary-color: #161b22;
    --accent-color: #238636;
    --accent-hover-color: #2ea043;
    --text-color: #c9d1d9;
    --text-muted-color: #8b949e;
    --border-color: #30363d;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
    background-color: var(--primary-color);
    color: var(--text-color);
    font-family: var(--font-family);
    margin: 0;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-hover-color);
}

h1, h2, h3 {
    margin: 0 0 1rem 0;
    line-height: 1.3;
}

h2 {
    font-size: 1.8rem;
    color: #fff;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* --- Header & Footer --- */
.site-header, .site-footer {
    background-color: var(--secondary-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}
.site-footer {
    border-top: 1px solid var(--border-color);
    border-bottom: none;
    margin-top: 2rem;
}
.site-header .container, .site-footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}
.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
}
.main-nav a, .footer-nav a {
    color: var(--text-color);
    margin: 0 0.75rem;
}

/* --- Main Content & Hero --- */
main {
    padding: 2rem 0;
}

.hero {
    text-align: center;
    padding: 3rem 0;
    background-color: var(--secondary-color);
    margin-bottom: 2rem;
    border-radius: 8px;
}
.hero h1 {
    font-size: 2.5rem;
    color: #fff;
}

/* --- Reusable Components --- */

/* Movie Grid & Cards */
.movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}
.movie-card {
    background-color: var(--secondary-color);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
}
.movie-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
}
.movie-card-poster {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    background-color: var(--primary-color);
}
.movie-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0) 100%);
    padding: 2rem 1rem 1rem 1rem;
    color: #fff;
}
.movie-card-title {
    font-size: 1rem;
    margin: 0.25rem 0 0 0;
    color: #fff;
}
.movie-card-year {
    font-size: 0.9rem;
    color: #8b949e;
	font-weight: normal;
}

/* Search Form */
.search-form {
    display: flex;
}
.search-form input {
    background-color: var(--primary-color);
    border: 1px solid var(--border-color);
    border-radius: 5px 0 0 5px;
    color: var(--text-color);
    padding: 8px 12px;
    min-width: 250px;
}
.search-form input:focus {
    outline: none;
    border-color: var(--accent-color);
}
.search-form button {
    background-color: var(--accent-color);
    border: 1px solid var(--accent-color);
    color: #fff;
    padding: 8px 15px;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.search-form button:hover {
    background-color: var(--accent-hover-color);
}

/* Genre List */
.genre-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 1rem 0;
}
.genre-list a {
    background-color: var(--secondary-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}
.genre-list a:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 2rem;
    flex-wrap: wrap;
    gap: 5px;
}
.pagination a, .pagination span {
    color: var(--text-color);
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
}
.pagination a:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
}
.pagination .current-page {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
    font-weight: bold;
}
.pagination .disabled {
    color: var(--text-muted-color);
    pointer-events: none;
}

/* --- Page-Specific Styles --- */

/* Movie Detail Page */
.breadcrumbs {
    margin-bottom: 1.5rem;
    color: var(--text-muted-color);
    font-size: 0.9rem;
}
.breadcrumbs a {
    color: var(--text-muted-color);
}
.breadcrumbs a:hover {
    color: var(--text-color);
}
.breadcrumbs span {
    color: var(--text-color);
}

.movie-detail-header {
    display: flex;
    gap: 30px;
    margin-bottom: 2rem;
}
.movie-detail-poster {
    width: 250px;
    height: auto;
    border-radius: 8px;
    flex-shrink: 0;
    object-fit: cover;
}
.movie-detail-info h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: #fff;
}
.movie-meta {
    color: var(--text-muted-color);
    margin-bottom: 1rem;
}
.movie-description {
    font-size: 1.1rem;
}
.download-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 1.5rem;
}
.download-links a {
    background-color: var(--accent-color);
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
    text-align: center;
}
.download-links a:hover {
    background-color: var(--accent-hover-color);
}
.trailer-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000;
    margin-bottom: 2rem;
    border-radius: 8px;
}
.trailer-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
.file-specs {
    list-style: none;
    padding: 0;
    font-size: 1.1rem;
}
.file-specs li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}
.file-specs li:first-child {
    border-top: 1px solid var(--border-color);
}

/* Search Page */
#search-results-info {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: var(--text-muted-color);
}

/* Static & 404 Pages */
.static-page {
    max-width: 800px;
    margin: 0 auto;
}
.static-page h1 {
    font-size: 2.2rem;
    color: #fff;
    margin-bottom: 1.5rem;
}
.static-page h2 {
    font-size: 1.6rem;
    margin-top: 2rem;
    border-bottom: none;
    padding-bottom: 0;
}
.static-page p, .static-page li {
    font-size: 1.1rem;
    line-height: 1.7;
}
.static-page ul {
    padding-left: 20px;
}
.text-center {
    text-align: center;
}
.button-primary {
    display: inline-block;
    background-color: var(--accent-color);
    color: #fff;
    padding: 12px 25px;
    border-radius: 5px;
    font-weight: bold;
    margin-top: 1.5rem;
    transition: background-color 0.2s ease;
}
.button-primary:hover {
    background-color: var(--accent-hover-color);
    color: #fff;
}


/* --- Responsive Design --- */
@media (max-width: 768px) {
    .site-header .container {
        flex-direction: column;
        gap: 1rem;
    }
    .search-form {
        width: 100%;
    }
    .search-form input {
        width: 100%;
    }
    .movie-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    .movie-detail-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .download-links {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .movie-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    .hero h1 {
        font-size: 2rem;
    }
    .main-nav {
        display: flex;
        justify-content: center;
        width: 100%;
    }
    .main-nav a {
        margin: 0 0.5rem;
    }
}
/* --- Quality Download Sections --- */
.quality-sections-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 2rem;
}

.quality-section {
    background-color: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem 1.5rem;
}

.quality-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.quality-section-header h3 {
    margin: 0;
    color: #fff;
    font-size: 1.4rem;
}

.quality-section-header span {
    font-size: 1rem;
    color: var(--text-muted-color);
    background-color: var(--primary-color);
    padding: 4px 8px;
    border-radius: 5px;
}