/* ---------------------------------- */
/* 1. Global Reset & Typography */
/* ---------------------------------- */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700;800&display=swap');

:root {
    /* Updated Color Palette for a sharper, modern, social-media-inspired look */
    --primary-color: #E74C3C;       /* Bold Red Accent (Action/Highlight) */
    --accent-color: #3498DB;        /* Action Blue (Buttons/Links) */
    --background-dark: #070707;     /* Deeper, True Dark Background */
    --card-dark: #1f1f1f;           /* Card Background */
    --text-light: #F0F3F4;          /* Main White Text */
    --text-secondary: #BDC3C7;      /* Subtle Grey Text */
    --gold-star: #FFC300;           /* Brighter Gold for rating */
    --instagram-pink: #C13584;      /* Instagram Accent */
    --section-separator: rgba(255, 255, 255, 0.1); /* Light separator */
    --success-green: #27AE60;       /* NEW: Success Green for Notification */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif; /* Font Change for Modern Look */
    background-color: var(--background-dark);
    color: var(--text-light);
    line-height: 1.6;
    scroll-behavior: smooth;
    position: relative;
    padding-top: 5px; 
    overflow-x: hidden; /* Horizontal scrolling sirf specific sections mein ho */
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-color);
}

/* ---------------------------------- */
/* 2. Animated Background (Advanced) */
/* ---------------------------------- */

#animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    /* Complex Gradient for depth and motion effect (Slightly darker) */
    background: radial-gradient(circle at top left, #200d1d 0%, var(--background-dark) 50%, #10202d 100%);
    background-size: 300% 300%;
    animation: backgroundShift 40s infinite alternate ease-in-out;
}

@keyframes backgroundShift {
    0% { background-position: 0% 0%; }
    100% { background-position: 100% 100%; }
}

/* ---------------------------------- */
/* 3. Header, Navigation & Search */
/* ---------------------------------- */

.main-header {
    background-color: rgba(10, 10, 10, 0.98);
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.7);
    position: sticky; 
    top: 0;
    z-index: 1000;
}

.logo a {
    font-size: 1.4em;
    font-weight: 800;
    color: var(--instagram-pink); /* Instagram/Challenge inspired color */
    letter-spacing: 1px;
}

/* Search bar ko header ke niche shift kiya for better mobile flow */
.search-container {
    flex-grow: 1;
    margin: 0 20px;
    max-width: 450px;
}
#movieSearch {
    padding: 10px 15px;
    border-radius: 25px;
    border: none;
    background-color: #333;
    color: var(--text-light);
    width: 100%;
    transition: all 0.3s ease;
    font-size: 0.95em;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);
}

#movieSearch:focus {
    outline: none;
    background-color: #444;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.5);
}

/* Instagram Icon Styling */
.social-links a {
    font-size: 1.8em;
    margin-left: 20px;
    color: var(--instagram-pink);
    transition: transform 0.3s ease;
}
.social-links a:hover {
    color: var(--accent-color);
    transform: scale(1.1);
}

/* ---------------------------------- */
/* 4. Hero Section, Titles & Filters */
/* ---------------------------------- */

.hero-section {
    padding: 70px 25px 40px 25px;
    text-align: center;
}

.hero-section h1 {
    font-size: 2.8em;
    color: var(--text-light);
    margin-bottom: 10px;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
}

.hero-section p {
    font-size: 1.1em;
    font-weight: 400;
    color: var(--text-secondary);
}

.section-title {
    font-size: 2.2em;
    text-align: center;
    margin: 40px 0 20px 0;
    color: var(--primary-color);
    font-weight: 800;
}
.section-title::after {
    content: '🔥'; /* New Emoji Accent */
    display: inline-block;
    font-size: 0.8em;
    margin-left: 10px;
    color: var(--gold-star);
}

.filter-and-info-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 25px 20px 25px;
    border-bottom: 1px solid var(--section-separator);
}

.results-info {
    font-size: 0.9em;
    color: var(--accent-color);
    font-weight: 600;
}

.sort-container {
    display: flex;
    align-items: center;
    gap: 10px;
}
.sort-container label {
    font-size: 1em;
    font-weight: 600; 
    color: var(--text-secondary);
}
#sortSelector {
    padding: 8px 15px; 
    border-radius: 15px; 
    background-color: var(--card-dark); 
    color: var(--text-light); 
    border: 1px solid var(--accent-color); 
    font-size: 0.9em;
    cursor: pointer;
    appearance: none; 
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23F0F3F4'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
}

/* ---------------------------------- */
/* 5. Movie Sections & Horizontal Scroll */
/* ---------------------------------- */

.movie-list-container {
    padding: 20px 0; /* Remove horizontal padding here */
    max-width: 100%;
    margin: 0 auto;
}

.movie-section {
    margin-bottom: 50px;
    padding-bottom: 20px;
    border-bottom: 5px solid var(--section-separator); /* Stronger separator */
}

.movie-section h3 {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 20px;
    padding: 0 25px; /* Alignment with other elements */
    border-left: 5px solid var(--primary-color);
    padding-left: 15px;
    margin-left: 20px;
}

/* --- THE CORE CHANGE: Horizontal Scrolling Container --- */
.horizontal-scroll-container {
    display: flex;
    gap: 20px;
    overflow-x: auto; /* Enable horizontal scrolling */
    padding: 10px 25px 30px 25px; /* Padding for scrollbar and edge spacing */
    
    /* Hide default scrollbar but keep functionality for better aesthetics */
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
    scroll-snap-type: x mandatory; /* Snap to cards */
}

.horizontal-scroll-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}


/* ---------------------------------- */
/* 6. Movie Card (Horizontal Look) */
/* ---------------------------------- */

.movie-card {
    background-color: var(--card-dark);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.7);
    transition: transform 0.4s ease, box-shadow 0.4s ease; 
    
    /* Card dimensions for Horizontal Scroll */
    flex-shrink: 0; 
    width: 250px; 
    height: 480px; /* Reduced card height */
    position: relative;
    cursor: pointer;
    scroll-snap-align: start; 
}

.movie-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 30px rgba(52, 152, 219, 0.6);
}

.day-label {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--primary-color);
    padding: 6px 12px;
    font-weight: 700;
    font-size: 0.9em;
    border-radius: 6px;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.movie-poster {
    width: 100%;
    height: 340px; /* Adjusted poster height */
    object-fit: cover;
    transition: filter 0.3s ease;
}

.movie-card:hover .movie-poster {
    filter: brightness(0.85);
}

.movie-info {
    padding: 10px;
    text-align: left;
    flex-grow: 1;
}

.movie-info h3 {
    font-size: 1.1em;
    margin-bottom: 3px;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.movie-rating {
    font-weight: 700;
    color: var(--gold-star);
    margin-bottom: 8px;
    font-size: 0.9em;
}

.date-seen {
    font-size: 0.8em;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 5px;
}

.no-results {
    font-size: 1.1em; 
    color: var(--text-secondary);
    padding: 30px 25px;
    font-weight: 600;
    text-align: center;
    width: 100%;
}
.no-results-global { 
    font-size: 1.8em; 
    text-align: center;
    color: var(--primary-color);
    padding: 100px 0;
    font-weight: 700;
}


/* ---------------------------------- */
/* 7. Modal/Pop-up Styles (Detail View) */
/* ---------------------------------- */

.modal {
    display: none; 
    position: fixed; 
    z-index: 2000; 
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto; 
    background-color: rgba(0, 0, 0, 0.95); 
    backdrop-filter: blur(8px); 
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background-color: var(--card-dark);
    margin: 30px auto; 
    padding: 30px 20px;
    border: 1px solid #333;
    width: 95%;
    max-width: 1000px;
    border-radius: 15px;
    box-shadow: 0 5px 40px rgba(0, 0, 0, 0.95);
    position: relative;
    animation: slideDown 0.5s ease-out;
}

.close-button {
    color: var(--text-secondary);
    font-size: 35px;
    transition: color 0.3s;
    position: absolute;
    top: 15px;
    right: 20px;
    z-index: 20;
}

.close-button:hover {
    color: var(--primary-color);
    cursor: pointer;
}

/* --- Modal Detail Styles --- */
.day-tag-modal {
    display: inline-block;
    background-color: var(--instagram-pink); 
    color: white;
    padding: 10px 20px;
    font-size: 1.2em;
    font-weight: 800;
    border-radius: 8px;
    margin-bottom: 25px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.main-details {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    flex-wrap: wrap; 
}

.detail-poster {
    width: 300px;
    height: 450px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.7);
    flex-shrink: 0;
}

#modalMovieTitle {
    font-size: 2.5em;
    color: var(--text-light);
    margin-bottom: 15px;
    line-height: 1.2;
}

.stats-bar { 
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    padding: 10px 0;
    border-bottom: 1px dashed var(--text-secondary);
    flex-wrap: wrap; 
}

.stats-bar-secondary { 
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap; 
}

.stat-item {
    font-size: 1em;
    font-weight: 600;
    color: var(--text-secondary);
}

.stat-item i {
    color: var(--primary-color);
    margin-right: 5px;
}
.stat-item b {
    color: var(--text-light); 
}

.rating-detail {
    color: var(--gold-star);
}

.download-button {
    display: inline-flex;
    align-items: center;
    background-color: var(--accent-color);
    color: white;
    padding: 15px 30px;
    margin-top: 20px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.2em;
    transition: background-color 0.3s, transform 0.3s;
}

.download-button:hover {
    background-color: #2980B9;
    transform: translateY(-3px);
}

/* Screenshots Gallery */
.screenshot-gallery {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding: 10px 0;
    margin-top: 20px;
}

.screenshot-gallery::-webkit-scrollbar {
    height: 8px;
}
.screenshot-gallery::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 10px;
}
.screenshot-gallery::-webkit-scrollbar-track {
    background: var(--card-dark);
}


.screenshot-item {
    width: 300px;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s, border 0.3s;
    flex-shrink: 0;
    cursor: pointer;
    border: 2px solid var(--card-dark);
}

.screenshot-item:hover {
    transform: scale(1.03);
    border-color: var(--primary-color);
}

hr {
    border: 0;
    height: 1px;
    background-color: var(--section-separator);
    margin: 40px 0;
}

/* --- Audio Section --- */

/* Wrapper for the audio player */
.audio-intro-container {
    background-color: #2c2c2c; /* Halka sa lighter dark background for depth */
    padding: 15px 25px;
    border-radius: 10px;
    margin: 20px 0 30px 0; /* Plot summary se thoda zyada space */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5); /* Subtle lift effect */
    border: 1px solid var(--primary-color); /* Bold Red Border for emphasis */
    animation: fadeIn 0.5s ease-out; /* Fade in animation */
}

.audio-intro-container h2 {
    font-size: 1.2em;
    color: var(--primary-color); /* Accent color for the heading */
    margin-bottom: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
}

.audio-intro-container h2 i {
    font-size: 1.5em;
    margin-right: 10px;
}

/* Customizing the standard HTML5 audio player */
.audio-player {
    width: 100%;
    filter: none; /* koi unintended filter ho to hata de */
}

/* For better cross-browser compatibility, we try to ensure controls are visible */
audio::-webkit-media-controls-panel {
    background-color: #3e3e3e; /* Darker panel background */
    border-radius: 5px;
}

audio::-webkit-media-controls-play-button {
    color: var(--primary-color); /* Play button ko red highlight */
}

.audio-coming-soon {
    font-style: italic;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 10px 0 5px 0;
    text-align: center;
}
/* --- END AUDIO STYLES --- */


/* ---------------------------------- */
/* 8. Download Notification Toast (NEW) */
/* ---------------------------------- */

.notification-toast {
    display: none; /* Default hidden */
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--success-green); /* Green color, as requested */
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    z-index: 3000; /* Modal se bhi upar */
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transform: translateY(100%); /* Initial position for slide-up */
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
}

.notification-toast i {
    font-size: 1.2em;
}

/* Animation Classes */
.slide-up {
    opacity: 1;
    transform: translateY(0);
}

.fade-out {
    opacity: 0 !important;
    transform: translateY(100%) !important;
}


/* ---------------------------------- */
/* 9. Responsive Design (Mobile First) */
/* ---------------------------------- */

@media (min-width: 769px) {
    .main-header {
        padding: 20px 50px;
    }
    .hero-section h1 { 
        font-size: 3.5em;
    }
    .search-container {
        margin: 0 40px;
    }
    .filter-and-info-container {
        padding: 0 50px 20px 50px;
    }
    .movie-section h3 {
        padding: 0 50px;
        margin-left: 45px;
    }
    .horizontal-scroll-container {
        padding: 10px 50px 30px 50px;
    }
    .main-details {
        flex-wrap: nowrap; /* Desktop: keep poster and text side by side */
    }
}

@media (max-width: 768px) {
    /* Header/Search */
    .main-header { 
        flex-direction: row; 
        padding: 15px 15px; 
    }
    .logo a {
        font-size: 1.2em;
    }
    .search-container {
        position: static; 
        order: 3; 
        width: 100%;
        max-width: 100%;
        margin-top: 10px;
    }
    .main-header {
        flex-wrap: wrap;
    }
    .filter-and-info-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 0 15px 20px 15px;
    }
    .results-info {
        order: -1; 
    }
    
    /* Hero */
    .hero-section {
        padding: 50px 15px 30px 15px;
    }
    .hero-section h1 { 
        font-size: 2em;
    }
    
    /* Sections */
    .movie-section h3 {
        padding: 0 15px;
        margin-left: 10px;
    }
    .horizontal-scroll-container {
        padding: 10px 15px 20px 15px; 
    }
    .movie-card {
        width: 230px; 
        height: 440px; 
    }
    .movie-poster {
        height: 320px;
    }
    
    /* MODAL: Full-screen mobile view */
    .modal-content {
        width: 100%;
        margin: 0;
        min-height: 100vh;
        border-radius: 0;
        padding: 20px 15px; 
    }
    .main-details {
        flex-direction: column;
        align-items: center;
        text-align: center; 
    }
    .detail-poster {
        width: 100%;
        max-width: 300px;
        height: auto;
    }
    #modalMovieTitle {
        font-size: 2em;
        text-align: center;
    }
    
    .stats-bar, .stats-bar-secondary {
        justify-content: flex-start;
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    
    .screenshot-item {
        width: 280px; 
        height: 160px;
    }
    
    /* Notification position adjustment for mobile */
    .notification-toast {
        bottom: 10px;
        right: 10px;
        left: 10px; /* Full width mobile par */
        text-align: center;
        justify-content: center;
    }
}
