/* Master CSS file for the website */
/* This file contains the main styles for the website */

/* In CSS, px (pixels) is an absolute unit of measurement, representing a fixed size on the screen,
while rem (root em) is a relative unit based on the root font size of the document (usually 16px).

vh (Viewport Height) represents a percentage of the viewport's height,
which is the visible area of the browser window.
1vh is equal to 1% of the viewport height.
100vh equals the full height of the browser window.

% (Percent) is a relative unit that represents a percentage of the parent element's size,
but vh is relative to the viewport size.
*/

/* --- Base Styles & Variables --- */
:root {
    --primary-bg: #141414; /* Black */
    --secondary-bg: #181818; /* Black Light */
    --lighter-bg: #333333; /* Dark Gray */
    --darker-bg: #1f1f1f; /* Darker Gray */
    --primary-accent: #e50914; /* Red */
    --secondary-accent: #bd0f18; /* Dark Red */
    --star-color: #f5c518; /* IMDb Star Yellow */
    --primary-text: #ffffff; /* Pure White */
    --secondary-text: #999999; /* Light Gray */
    --success-color: #28a745; /* Green */
    --error-color: #dc3545; /* Red */
    --white: #ffffff; /* Pure White */
    --black: #000000; /* Pure Black */
    /* Old Color Variables - Retained for reference
    --primary-color: #e50914;
    --dark-color: #141414;
    --gray-text: #999;
    --light-gray: #333; */
    --font-primary: 'Roboto', sans-serif;
}
/* Universal selector to apply styles to all elements */
* {
    box-sizing: border-box; /* Ensure padding and border are included in element's total width and height */
    margin: 0;
    padding: 0;
}
/* --- Basic Body Styling --- */
body {
    background-color: var(--primary-bg);
    font-family: var(--font-primary);
    color: var(--primary-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 1rem; /* Base font size */
    line-height: 1.6;
}
/* --- Global Link Styles --- */
a {
    color: var(--primary-text);
    text-decoration: none;
    transition: color 0.2s ease-in-out, text-decoration 0.2s ease-in-out;
}
a:hover {
    text-decoration: none;
}


/* --- Main Content Area --- */
main {
    padding-top: 80px; /* Space for the desktop header */
}
.beta-banner {
    width: 100%;
    background-color: var(--secondary-accent);
    color: var(--primary-text);
    text-align: center;
    padding: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}

/* --- Common Button Styles --- */
.btn {
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 4px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    margin: 0 0.5rem;
    transition: background-color 0.3s ease;
}
.btn-primary {
    background-color: var(--primary-accent);
    color: var(--primary-text);
}
.btn-primary:hover {
    background-color: var(--secondary-accent);
}
.btn-secondary {
    background-color: rgba(109, 109, 110, 0.7);
    color: var(--primary-text);
}
.btn-secondary:hover {
    background-color: rgba(109, 109, 110, 0.4);
}

/* --- Content Carousels --- */
.content-carousel {
    padding: 1rem 3rem 3rem;
}
.content-carousel h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}
.carousel-wrapper {
    position: relative;
}
.carousel-container {
    display: flex;
    overflow-x: scroll;
    scroll-behavior: smooth;
    padding-bottom: 1rem;
    scrollbar-width: none;
}
.carousel-container::-webkit-scrollbar {
    display: none;
}
.carousel-item {
    flex: 0 0 auto;
    width: 200px;
    margin-right: 10px;
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.3s ease, z-index 0.3s ease;
}
.carousel-item img {
    width: 100%;
    height: auto;
    display: block;
}
.carousel-item:hover {
    transform: scale(1.1);
    z-index: 20;
}
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(20, 20, 20, 0.7);
    border: none;
    color: var(--primary-text);
    width: 50px;
    height: 100%;
    cursor: pointer;
    z-index: 30;
    font-size: 2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.carousel-wrapper:hover .carousel-arrow {
    opacity: 1;
}
.carousel-arrow.left { left: 0; }
.carousel-arrow.right { right: 0; }
/* --- Responsive Design for Content Carousels --- */
@media (max-width: 768px) {
    .content-carousel {
        padding-left: 1rem;
        padding-right: 1rem;
        margin-left: 1rem;
        margin-right: 1rem;
    }
    .carousel-item {
        width: 150px;
    }
    .carousel-arrow {
        display: none;
    }
}
/* --- Content Carousels End --- */


/* --- Content Grid Section (New Design) --- */
.content-grid-section {
    padding: 2rem 3rem 3rem;
}
.content-grid-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}
.content-grid-section .content-grid-title-img {
    height: 28px;
    width: auto;
    object-fit: contain;
}
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
}
/* Trending in Friends Section */
.trending-card-wrapper {
    display: flex;
    flex-direction: column;
}
.friend-activity-info {
    background-color: var(--lighter-bg);
    padding: 0.6rem 0.8rem;
    border-radius: 0 0 8px 8px;
    font-size: 0.80rem;
    color: var(--secondary-text);
    text-align: center;
    margin-top: -8px;
}
.friend-activity-info i {
    color: var(--primary-accent);
    margin-right: 0.3rem;
}
.friend-activity-info strong {
    color: var(--primary-text);
}
/* Content Card Styles */
.content-card {
    background-color: var(--secondary-bg);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    max-width: 220px;
    justify-self: center;
}
.content-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}
.card-poster {
    width: 100%;
    aspect-ratio: 2/3;
    overflow: hidden;
    position: relative;
}
.card-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.content-card:hover .card-poster img {
    transform: scale(1.05);
}
.card-info {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    flex-grow: 1;
}
.card-title {
    font-size: 1rem;
    font-weight: 500;
    color: var(--primary-text);
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
}
.card-title .content-year {
    color: var(--secondary-text);
    font-weight: 300;
    font-size: 0.95rem;
}
.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.80rem;
    color: var(--secondary-text);
    align-items: center;
}
.card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
.content-type {
    color: var(--primary-accent);
    font-weight: 400;
}
.content-seasons {
    color: var(--secondary-text);
    font-weight: 300;
}
/* Ratings Section */
.card-ratings {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-top: 1px solid var(--lighter-bg);
    border-bottom: 1px solid var(--lighter-bg);
}
.rating-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
}
.rating-label {
    font-size: 0.7rem;
    color: var(--secondary-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}
.rating-value {
    font-size: 0.9rem;
    color: var(--primary-text);
    font-weight: 600;
}
.rating-item.site-rating .rating-value {
    color: var(--primary-accent);
}
/* Overview Section */
.card-overview {
    display: none;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--secondary-text);
    margin: 0.25rem 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
}
.content-card.with-overview .card-overview {
    display: -webkit-box;
}
/* Streaming Providers */
.streaming-providers {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: auto;
    align-items: center;
}
.provider {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    /*text-transform: uppercase;*/
    letter-spacing: 0.5px;
    white-space: nowrap;
}
/* Streaming Provider Colors */
.provider.netflix {
    background-color: #e50914;
    color: var(--white);
}
.provider.prime, .provider.amazonprime, .provider.amazon-prime, .provider.primevideo, .provider.amazonprimevideo, .provider.amazon-prime-video {
    background-color: #00a8e1;
    color: var(--white);
}
.provider.disney-plus, .provider.disneyplus, .provider.jiohotstar {
    background-color: #113ccf;
    color: var(--white);
}
.provider.hulu {
    background-color: #1ce783;
    color: var(--black);
}
.provider.hbo-max, .provider.hbomax {
    background-color: #b200ff;
    color: var(--white);
}
.provider.paramount, .provider.paramountplus, .provider.paramount-plus, .provider.paramount-plus-premium {
    background-color: #0064ff;
    color: var(--white);
}
.provider.peacock, .provider.peacocktv, .provider.peacock-tv, .provider.peacock-premium {
    background-color: #000000;
    color: var(--white);
}
.provider.apple, .provider.appletv, .provider.apple-tv, .provider.appletvplus, .provider.apple-tv-plus {
    background-color: #000000;
    color: var(--white);
}
.provider.crunchyroll {
    background-color: #f47521;
    color: var(--white);
}
.provider.mubi {
    background-color: #ff2a7b;
    color: var(--white);
}
.provider.lionsgate, .provider.lionsgate-play {
    background-color: #ff0000;
    color: var(--white);
}
.provider.youtube, .provider.youtubepremium, .provider.youtube-premium {
    background-color: #ff0000;
    color: var(--white);
}
.provider.sonyliv, .provider.sony-liv {
    background-color: #0b1e3d;
    color: var(--white);
}
.provider.zee5 {
    background-color: #9b26b6;
    color: var(--white);
}
.provider.jiocinema {
    background-color: #b50147;
    color: var(--white);
}
.provider.mxplayer {
    background-color: #002fac;
    color: var(--white);
}
.provider.voot, .provider.vootselect, .provider.voot-select, .provider.vi {
    background-color: #ff0000;
    color: var(--white);
}
.provider.eros, .provider.erosnow {
    background-color: #e31c79;
    color: var(--white);
}
.provider.altbalaji {
    background-color: #f36e21;
    color: var(--white);
}
.provider.cinema {
    background-color: var(--star-color);
    color: var(--black);
}
.provider.unknown {
    background-color: var(--lighter-bg);
    color: var(--secondary-text);
}
/* --- Content Grid Section End --- */


/* --- Header --- */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1rem 3rem;
    transition: background-color 0.3s ease;
    background-color: transparent;
}

.main-header.scrolled {
    background-color: var(--primary-bg);
}

.main-header .header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.logo {
    color: var(--primary-accent);
    font-size: 1.8rem;
    font-weight: 700;
    /*text-transform: uppercase;*/
    flex-shrink: 0;
}

.main-nav {
    flex-grow: 1;
    margin-left: 2rem;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

.main-nav a {
    font-weight: 500;
    transition: color 0.3s ease;
}

.main-nav a:hover, .main-nav a.active {
    color: var(--secondary-text);
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.hamburger-menu {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1100;
}

.search-bar {
    position: relative;
    display: flex;
    align-items: center;
}
.search-bar .search-icon {
    position: absolute;
    left: 10px;
    color: var(--secondary-text);
}
.search-bar input {
    background-color: rgba(0,0,0,0.7);
    border: 1px solid var(--secondary-text);
    border-radius: 4px;
    color: var(--primary-text);
    padding: 8px 8px 8px 35px;
    width: 0;
    opacity: 0;
    transition: width 0.4s ease, opacity 0.4s ease;
}
.search-bar:hover input,
.search-bar input:focus {
    width: 250px;
    opacity: 1;
}

.profile-dropdown {
    position: relative;
    cursor: pointer;
}
.profile-dropdown .avatar {
    width: 35px;
    height: 35px;
    border-radius: 4px;
    object-fit: cover;
}
.dropdown-menu {
    display: none;
    position: absolute;
    top: 50px;
    right: 0;
    background-color: rgba(0, 0, 0, 0.9);
    border: 1px solid var(--lighter-bg);
    border-radius: 4px;
    list-style: none;
    width: 150px;
    overflow: hidden;
}
.profile-dropdown.active .dropdown-menu {
    display: block;
}
.dropdown-menu li a {
    display: block;
    padding: 10px 15px;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
}
.dropdown-menu li a:hover {
    background-color: var(--lighter-bg);
}

.auth-links {
    display: flex;
    gap: 0.8rem;
}
.auth-links a {
    font-weight: 500;
    transition: color 0.3s ease;
}
.auth-links a:hover {
    color: var(--secondary-text);
}

/* --- Footer --- */
.main-footer {
    text-align: center;
    padding: 2rem;
    color: var(--secondary-text);
    border-top: 1px solid var(--lighter-bg);
    margin-top: 2rem;
}


/* --- Notification Popup --- */
/* This is the main container for the notification popup.
It's positioned fixed to stay in the top-right corner of the screen.
'z-index' is set very high to ensure it appears above all other content.
It starts hidden ('transform' and 'opacity') and will fade in with a transition.
*/
.notification-popup {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background-color: var(--darker-bg);
    color: var(--primary-text);
    border-radius: 8px;
    padding: 16px;
    min-width: 300px;
    max-width: 350px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    border-left: 5px solid var(--primary-accent); /* Default border color */
    
    /* Animation properties */
    transform: translateX(120%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.4s ease-in-out, opacity 0.4s ease, visibility 0.4s ease;
}

/*
The '.show' class is added by JavaScript to make the popup visible.
It slides in from the right and fades in.
*/
.notification-popup.show {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
}

/* Modifier class for a SUCCESS notification */
.notification-popup.success {
    border-left-color: var(--success-color);
}

/* Modifier class for an ERROR notification */
.notification-popup.error {
    border-left-color: var(--error-color);
}

/* --- Internal Layout --- */
.notification-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.notification-icon i {
    display: none;
    font-size: 1.8rem;
}

/* Set icon color based on type */
.notification-popup.success .notification-icon { color: var(--success-color); }
.notification-popup.error .notification-icon { color: var(--error-color); }

.notification-message {
    flex-grow: 1; /* Allows message to take up available space */
    font-size: 0.95rem;
    line-height: 1.4;
}

/* --- Close Button --- */
.notification-close {
    background: none;
    border: none;
    color: var(--secondary-text);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 5px;
    transition: color 0.2s;
}
.notification-close:hover {
    color: var(--primary-text);
}

/* --- Progress Bar --- */
.notification-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: var(--lighter-bg);
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* The inner bar that animates */
.notification-progress-bar div {
    height: 100%;
    background-color: var(--primary-accent); /* Default color */
    border-bottom-left-radius: 8px;
    width: 0%; /* Start at 0, animation will fill it */
}

/* Progress bar color based on type */
.notification-popup.success .notification-progress-bar div { background-color: var(--success-color); }
.notification-popup.error .notification-progress-bar div { background-color: var(--error-color); }

/* * When the 'show' class is added, we trigger the animation on the progress bar.
    * It animates the width from 100% to 0% over 6 seconds.
*/
.notification-popup.show .notification-progress-bar div {
    animation: progressBar 6s linear forwards;
}

@keyframes progressBar {
    from { width: 100%; }
    to { width: 0%; }
}


/* --- Responsive Design for Global Elements --- */
@media (max-width: 768px) {
    .main-header {
        padding: 1rem;
    }

    .header-content {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .logo {
        order: 1;
    }

    .user-actions {
        order: 2;
    }

    .main-nav {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100%;
        background-color: var(--primary-bg);
        z-index: 1050;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        padding-top: 5rem;
        margin-left: 0;
    }

    .main-nav.active {
        transform: translateX(0);
    }

    .main-nav ul {
        flex-direction: column;
        align-items: center;
        width: 100%;
        gap: 2rem;
    }

    .main-nav a {
        font-size: 1.2rem;
    }

    .hamburger-menu {
        display: block;
        position: absolute;
        top: 0.5rem;
        left: 1rem;
    }

    main {
        padding-top: 130px;
    }
    
    .search-bar:hover input, .search-bar input:focus {
        width: 150px;
    }

    /* Content Grid Section Adjustments */
    .content-grid-section {
        padding: 2rem 1rem;
        margin: 0 1rem;
    }
    .content-grid-section .content-grid-title-img {
        height: 22px;
    }
    .content-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
    /* Trending in Friends Section */
    .friend-activity-info {
        font-size: 0.75rem;
        padding: 0.5rem 0.6rem;
    }
    /* Content Card Styles */
    .content-card {
        max-width: none;
    }
    .card-info {
        padding: 0.75rem;
        gap: 0.5rem;
    }
    .card-title {
        font-size: 0.85rem;
        min-height: 2.2em;
    }
    .card-title .content-year {
        font-size: 0.8rem;
    }
    .card-meta {
        font-size: 0.75rem;
    }
    .card-ratings {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.25rem;
        padding: 0.4rem 0;
    }
    .rating-label {
        font-size: 0.65rem;
    }
    .rating-value {
        font-size: 0.8rem;
    }
    .card-overview {
        font-size: 0.8rem;
        -webkit-line-clamp: 3;
        line-clamp: 3;
    }
    .provider {
        font-size: 0.65rem;
        padding: 0.25rem 0.5rem;
    }
    /* End of Content Grid Section Adjustments */
}