/* --- Global Reset & Cinematic Dark Theme --- */
:root {
    --dark-bg: #121212;
    --dark-card: #1e1e1e;
    --text-light: #f0f0f0;
    --accent-color: #e50914; /* Cinematic Red */
    --new-tag-color: #00bcd4; /* Cyan/Bright Blue */
    --gold-text: #ffc107;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--dark-bg);
    color: var(--text-light);
    min-height: 100vh;
}

/* --- Navigation Bar --- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    background-color: rgba(0, 0, 0, 0.7);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    font-size: 1.8em;
    font-weight: bold;
    color: var(--accent-color);
}

/* --- ENHANCED NAVIGATION LINKS STYLING (Home, Movies, Series) --- */
.navbar nav a {
    color: var(--text-light);
    text-decoration: none;
    margin-left: 20px;
    padding: 8px 12px; /* Increased padding */
    border-radius: 6px;
    /* Make background more defined and use the dark card color */
    background-color: var(--dark-card); 
    border: 1px solid #333; /* Add a subtle border */
    font-weight: 500;
    transition: color 0.3s, background-color 0.3s, box-shadow 0.3s;
}

.navbar nav a:hover {
    color: white; /* Keep text white on hover for contrast */
    background-color: rgba(229, 9, 20, 0.2); /* Darker background with red tint */
    border-color: var(--accent-color); /* Red border on hover */
    box-shadow: 0 0 10px rgba(229, 9, 20, 0.7); /* Red glow effect */
}
/* --- END ENHANCED NAVIGATION LINKS STYLING --- */


.header-tools {
    display: flex;
    align-items: center;
}

.header-tools input {
    padding: 8px 15px;
    border: 1px solid #333;
    background-color: var(--dark-card);
    color: var(--text-light);
    border-radius: 20px;
    margin-right: 15px;
    transition: width 0.3s;
    width: 150px;
}

.header-tools input:focus {
    width: 200px;
    outline: none;
    border-color: var(--accent-color);
}

/* --- TELEGRAM ICON FIX --- */
.telegram-icon i {
    font-size: 1.5em;
    color: #0088cc; /* Standard Telegram Blue */
    margin-left: 15px; /* Spacing from search bar */
    transition: transform 0.2s;
}

.telegram-icon i:hover {
    transform: scale(1.1);
}
/* --- END TELEGRAM ICON FIX --- */


/* --- Hero Section (Featured Banner) --- */
.hero-section {
    position: relative;
    height: 450px;
    background-size: cover;
    background-position: center top;
    margin-bottom: 30px;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, var(--dark-bg) 0%, rgba(18, 18, 18, 0.95) 20%, rgba(18, 18, 18, 0.5) 70%, rgba(18, 18, 18, 0.0) 100%);
    display: flex;
    align-items: center;
    padding: 0 5%;
}

.hero-content {
    max-width: 600px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.hero-title {
    font-size: 3em;
    margin-bottom: 10px;
    color: white;
}

.hero-description {
    font-size: 1.1em;
    color: #ccc;
    margin-bottom: 20px;
}

.hero-meta span {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    padding: 5px 10px;
    border-radius: 4px;
    margin-right: 10px;
    font-size: 0.9em;
}

.hero-button {
    display: inline-block;
    padding: 12px 25px;
    background-color: var(--accent-color);
    color: white;
    text-decoration: none;
    border-radius: 30px;
    margin-top: 20px;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.2s;
}

.hero-button:hover {
    background-color: #d80000;
    transform: scale(1.05);
}

.hero-button i {
    margin-right: 8px;
}
/* --- END Hero Section --- */

/* --- LATEST ACTIVITY BAR (Text Feed) --- */
.latest-activity-bar {
    background: #0d0d0d;
    padding: 10px 5%;
    display: flex;
    align-items: center;
    flex-wrap: wrap; 
    border-top: 1px solid #222;
    border-bottom: 1px solid #222;
    margin-bottom: 30px;
}

.activity-label {
    font-weight: bold;
    color: var(--accent-color);
    margin-right: 20px;
    flex-shrink: 0;
}

.activity-link {
    color: #ccc;
    text-decoration: none;
    margin-right: 20px;
    transition: color 0.2s;
    font-size: 0.9em;
}

.activity-link:hover {
    color: var(--text-light);
    text-decoration: underline;
}

.update-time {
    color: #777;
    font-size: 0.8em;
}


/* --- Content Grid & Tile Responsiveness (Core requirement) --- */
.index-main {
    padding: 0 5%; 
}

.content-grid {
    padding: 30px 0; 
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.content-grid h2 {
    grid-column: 1 / -1;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 5px;
}

/* 💻 Wide Desktop: 8 tiles */
@media (min-width: 1800px) {
    .content-grid {
        grid-template-columns: repeat(8, 1fr);
    }
}

/* 🖥️ Large Laptop/Monitor: 6 tiles */
@media (min-width: 1200px) and (max-width: 1799px) {
    .content-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}


/* ---------------------------------------------------- */
/* --- MOBILE HEADER FIX (Fixes the overlapping issue) --- */
/* ---------------------------------------------------- */
@media (max-width: 800px) {
    .navbar {
        flex-direction: column; /* Stack the main blocks */
        align-items: flex-start;
        padding: 10px 5%;
    }

    .navbar nav {
        order: 3; /* Move navigation links to the bottom row */
        margin-top: 10px;
        width: 100%;
        text-align: center;
        padding-bottom: 10px;
        border-top: 1px solid #333;
    }

    .navbar nav a {
        margin: 0 10px;
        display: inline-block;
        font-size: 0.9em;
    }
    
    .header-tools {
        order: 2; /* Place search bar/icons next to logo */
        width: 60%; 
        justify-content: flex-end;
        position: absolute; /* Allows search bar to be fixed to the right */
        top: 10px;
        right: 5%;
    }

    .header-tools input {
        width: 100px; /* Reduced search bar size */
        margin-right: 8px;
        padding: 5px 10px;
    }
    
    .logo {
        order: 1; /* Keep logo at the top left */
        font-size: 1.5em;
        width: 40%;
    }
}
/* ---------------------------------------------------- */


/* 📱 Small Mobile (300-600px): 2 tiles */
@media (max-width: 600px) {
    .content-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .hero-title {
        font-size: 2em;
    }
    .hero-description, .hero-meta {
        display: none; /* Hide non-essential text on mobile hero */
    }
    .hero-section {
        height: 300px;
    }
}


/* --- Movie Tile Styling (Best Look) --- */
.movie-tile {
    position: relative;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    transform: scale(1);
    transition: transform 0.3s ease-in-out;
    border-radius: 8px;
    overflow: hidden; 
}

.movie-tile:hover {
    transform: scale(1.05); 
    box-shadow: 0 8px 15px rgba(229, 9, 20, 0.4);
}

.movie-tile-content {
    position: relative;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
}

.movie-tile img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 2/3; 
    object-fit: cover;
}

/* --- NEW TAG STYLING --- */
.new-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--new-tag-color);
    color: black;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 4px;
    z-index: 50;
    font-size: 0.75em;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.tile-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
    padding: 10px;
    text-align: center;
}

.movie-tile:hover .tile-overlay {
    opacity: 1;
}

.tile-overlay p {
    font-size: 0.9em;
    color: #ffc107; 
    margin: 5px 0;
}

.watch-button {
    background-color: var(--accent-color);
    color: var(--text-light);
    padding: 8px 15px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: bold;
    margin-top: 15px;
    transition: background-color 0.3s;
}

.watch-button:hover {
    background-color: #d80000;
}

/* --- Always Visible Info Block --- */
.tile-info {
    background-color: var(--dark-card);
    padding: 10px 8px;
    text-align: center;
    border-radius: 0 0 8px 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tile-info strong {
    display: block;
    font-size: 0.9em;
    font-weight: 600;
    line-height: 1.2;
}

.tile-info span {
    display: block;
    font-size: 0.75em;
    color: #999;
}

/* --- Footer --- */
.site-footer {
    padding: 20px 5%;
    background-color: #0d0d0d;
    text-align: center;
    margin-top: 40px;
    border-top: 1px solid var(--dark-card);
}

.footer-logos {
    margin-top: 10px;
}

/* --- WATCH PAGE STYLES (ENHANCED CINEMATIC LOOK) --- */
.watch-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 5%;
    display: flex;
    gap: 30px;
}
.player-area {
    flex-grow: 3;
}
.video-player {
    width: 100%;
    aspect-ratio: 16 / 9; 
    background-color: #000;
    margin-bottom: 20px;
    border-radius: 12px; 
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6); 
    overflow: hidden;
}
.video-player video, .video-player iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Ad Placements */
.ad-placeholder {
    background-color: #331a1a; 
    border: 1px dashed var(--accent-color);
    color: #ccc;
    text-align: center;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 6px;
    font-size: 0.9em;
}

/* Specific Telegram Banner Styling */
.telegram-banner-wide {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(90deg, #0088cc, #005f8c); 
    color: white !important;
    text-decoration: none;
    height: 60px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    transition: opacity 0.2s;
    border: none;
}
.telegram-banner-wide:hover {
    opacity: 0.9;
}
.telegram-banner-wide i {
    font-size: 2em;
    color: white;
    margin-right: 15px;
}

.telegram-banner-block {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: linear-gradient(180deg, #0088cc, #005f8c);
    color: white !important;
    text-decoration: none;
    height: 100%; /* Fill the sidebar slot */
    border: none;
}
.telegram-banner-block i {
    font-size: 3em;
    color: white;
    margin-bottom: 10px;
}


.details-area {
    flex-grow: 1;
    max-width: 350px;
    color: #ccc;
    /* FIX: Set a consistent margin-top and padding to align with player-area */
    padding-top: 0; /* Align top of sidebar content with top of player content */
}
/* Hiding sidebar on desktop */
@media (min-width: 1001px) {
    .details-area {
        display: none; /* Hides the sidebar (Telegram/Episodes) on large screens */
    }
}
@media (max-width: 1000px) {
    .details-area {
        max-width: 100%;
        padding-top: 0; 
    }
}


.details-box {
    background: #191919; 
    padding: 25px;
    border-radius: 8px;
    margin-top: 20px; 
    position: relative; /* Needed for pseudo-element positioning */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* FIX: Use pseudo-element to create the vertical red line perfectly aligned with the box */
.details-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background-color: var(--accent-color);
    border-radius: 8px 0 0 8px; /* Match container border radius */
}

/* FIX: FINAL ALIGNMENT CORRECTION */
.details-box h2, .details-box h3 {
    color: var(--text-light);
    font-size: 1.6em; 
    font-weight: 600;
    margin-top: 0; 
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding-left: 0; /* Ensures content starts after the red bar */
}

.details-box p {
    line-height: 1.6;
    color: #ccc;
    margin-bottom: 15px;
    padding-left: 0; /* Ensures content starts after the red bar */
}

.details-box strong {
    color: white;
    font-weight: 600;
    margin-right: 5px;
    padding-left: 0; /* Ensures content starts after the red bar */
}

/* Final Reset for ALL conflicting inner elements */
.details-box p strong, .details-box p, .details-box div {
    display: block; 
    padding-left: 0;
    margin-left: 0;
}
.details-box p span {
    padding-left: 0;
}

/* Episode List Styling */
.episode-list {
    list-style: none;
    padding: 0;
    max-height: 350px; 
    overflow-y: auto;
    border: 1px solid #2e2e2e;
    border-radius: 6px;
}

.episode-list a {
    display: block;
    padding: 12px 15px;
    margin-bottom: 0;
    background: #232323; 
    text-decoration: none;
    color: #fff;
    transition: background 0.2s, color 0.2s;
    border-bottom: 1px solid #333;
}

.episode-list a:hover {
    background: #2a2a2a;
    color: var(--gold-text); 
}

.episode-list a[style*="background: var(--accent-color)"] {
    background: var(--accent-color) !important; 
    color: white !important;
    font-weight: bold;
}

.season-list h4 {
    background: #3a3a3a;
    padding: 8px 15px;
    color: white;
    margin-top: 10px;
    border-radius: 4px 4px 0 0;
    font-size: 1.1em;
}

/* Responsive Layout */
@media (max-width: 1000px) {
    .watch-container {
        flex-direction: column;
    }
}
