/**
 * Main Stylesheet for Movie Website
 * Optimized for Smart TV browsers and old devices
 */

/* === CSS Reset & Base Styles === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 20px; /* Larger font for TV screens */
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background-color: #0a0a0a;
    color: #e0e0e0;
    line-height: 1.6;
    overflow-x: hidden;
}

/* === Typography === */
h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #ffffff;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 0.8rem;
    color: #ffffff;
}

h3 {
    font-size: 1.2rem;
    margin-bottom: 0.6rem;
    color: #ffffff;
}

p {
    margin-bottom: 1rem;
}

a {
    color: #4a9eff;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover,
a:focus {
    color: #6bb3ff;
}

/* === Layout === */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
}

/* === Loading & Error States === */
.loading {
    text-align: center;
    padding: 3rem;
    font-size: 1.5rem;
    color: #4a9eff;
}

.error {
    color: #ff4444;
    text-align: center;
    padding: 2rem;
    background-color: #1a1a1a;
    border-radius: 8px;
    margin: 2rem auto;
    max-width: 600px;
}

.error h2 {
    color: #ff4444;
    margin-bottom: 1rem;
}

/* === Buttons === */
.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background-color: #4a9eff;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn:hover,
.btn:focus {
    background-color: #3a8eef;
    transform: translateY(-2px);
    outline: 3px solid #4a9eff;
    outline-offset: 2px;
    color: #ffffff;
}

.btn-home {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background-color: #333;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.btn-home:hover,
.btn-home:focus {
    background-color: #555;
    outline: 3px solid #ffd700;
    outline-offset: 2px;
    transform: translateY(-2px);
}

/* === Movie Detail Layout === */
.movie-detail {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 40px;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* === Movie Poster Section === */
.movie-poster {
    position: relative;
}

.movie-poster img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    display: block;
}

/* === Watch Button === */
.watch-button-container {
    margin-top: 20px;
}

.btn-watch {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 18px 30px;
    background: linear-gradient(135deg, #e50914 0%, #ff0a16 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 12px;
    font-size: 1.3rem;
    font-weight: bold;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(229, 9, 20, 0.4);
}

/* Play icon triangle */
.btn-watch::before {
    content: "";
    display: inline-block;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 14px solid white;
    margin-right: 12px;
}

.btn-watch:hover,
.btn-watch:focus {
    background: linear-gradient(135deg, #ff0a16 0%, #ff2028 100%);
    transform: translateY(-3px);
    outline: 4px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
    box-shadow: 0 6px 25px rgba(229, 9, 20, 0.6);
}

.no-episodes {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* === Movie Info Section === */
.movie-info-detail {
    padding: 10px 0;
}

.movie-info-detail h1 {
    font-size: 2.5rem;
    color: #ffffff;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.original-name {
    font-size: 1.3rem;
    color: #999;
    margin-bottom: 1.5rem;
    font-style: italic;
}

/* === Movie Meta Tags === */
.movie-meta-detail {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 2rem;
}

.movie-meta-detail span {
    padding: 8px 16px;
    background-color: #2a2a2a;
    border: 2px solid #444;
    border-radius: 6px;
    font-size: 1rem;
    color: #e0e0e0;
    font-weight: 600;
}

.quality {
    background-color: #1a4d2e !important;
    border-color: #27ae60 !important;
    color: #27ae60 !important;
}

.language {
    background-color: #2c3e50 !important;
    border-color: #3498db !important;
    color: #3498db !important;
}

.time {
    background-color: #34495e !important;
    border-color: #95a5a6 !important;
    color: #ecf0f1 !important;
}

.status {
    background-color: #8e44ad !important;
    border-color: #9b59b6 !important;
    color: #e8daef !important;
}

/* === Movie Description === */
.movie-description {
    margin: 2rem 0;
    padding: 1.5rem;
    background-color: #1a1a1a;
    border-left: 5px solid #4a9eff;
    border-radius: 8px;
}

.movie-description h2 {
    margin-bottom: 1rem;
    color: #4a9eff;
}

.movie-description p {
    line-height: 1.8;
    color: #ccc;
    text-align: justify;
}

/* === Movie Metadata === */
.movie-metadata {
    margin: 2rem 0;
    padding: 1.5rem;
    background-color: #1a1a1a;
    border-radius: 8px;
}

.movie-metadata p {
    margin-bottom: 1rem;
    color: #ccc;
    line-height: 1.8;
}

.movie-metadata strong {
    color: #4a9eff;
    font-weight: 600;
    margin-right: 8px;
}

/* === Episodes Section === */
.episodes-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #333;
}

.episodes-section h2 {
    margin-bottom: 1.5rem;
    color: #ffffff;
    font-size: 1.8rem;
}

.server-group {
    margin-bottom: 2.5rem;
}

.server-group h3 {
    color: #888;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    padding-left: 10px;
    border-left: 4px solid #e50914;
}

/* Episode Grid Layout */
.episode-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
}

/* Episode Button Styling */
.episode-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60px;
    background-color: #222;
    color: #ccc;
    font-size: 1.1rem;
    font-weight: bold;
    text-decoration: none;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
}

.episode-btn:hover,
.episode-btn:focus {
    background-color: #e50914;
    color: white;
    transform: scale(1.08);
    border-color: white;
    z-index: 10;
    box-shadow: 0 8px 20px rgba(229, 9, 20, 0.5);
    outline: none;
}

.episode-btn.active {
    background-color: #444;
    color: #e50914;
    border: 2px solid #e50914;
}

/* === Player Container === */
.player-container {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.player-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    background-color: #000;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.video-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.player-info {
    margin: 2rem 0;
}

.player-info h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.player-controls {
    margin-top: 1.5rem;
}

/* === Movie Grid (Home Page) === */
.movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 25px;
    padding: 20px 0;
}

.movie-card {
    background-color: #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.movie-card:hover,
.movie-card:focus-within {
    transform: translateY(-8px);
    box-shadow: 0 8px 24px rgba(74, 158, 255, 0.3);
}

.movie-card img {
    width: 100%;
    height: 330px;
    object-fit: cover;
    display: block;
}

.movie-info {
    padding: 15px;
}

.movie-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #ffffff;
}

.movie-meta {
    display: flex;
    gap: 8px;
}

.movie-meta span {
    padding: 4px 8px;
    background-color: #2a2a2a;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* === Focus Styles for TV Remote === */
*:focus {
    outline: 3px solid #ffd700;
    outline-offset: 3px;
}

button:focus,
a:focus {
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

/* === Responsive Design === */
@media (max-width: 1024px) {
    html {
        font-size: 18px;
    }
    
    .movie-detail {
        grid-template-columns: 300px 1fr;
        gap: 30px;
    }
    
    .episode-list {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

@media (max-width: 768px) {
    html {
        font-size: 16px;
    }
    
    .movie-detail {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .movie-poster {
        max-width: 400px;
        margin: 0 auto;
    }
    
    .movie-info-detail h1 {
        font-size: 2rem;
    }
    
    .episode-list {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .container {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .movie-detail {
        padding: 10px;
    }
    
    .btn-watch {
        font-size: 1.1rem;
        padding: 15px 20px;
    }
    
    .episode-list {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
}

/* === Utilities === */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }