/* --- General Body & Container Styling --- */
body {
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif; /* Modern, readable font */
    margin: 0;
    padding: 0; /* Let main container handle padding */
    background-color: #0A0A0A; /* Deep black background for consistency */
    color: #E0E0E0; /* Off-white for general text */
    line-height: 1.6;
    min-height: 100vh; /* Ensure body covers full viewport height */
    display: flex;
    flex-direction: column; /* For overall page layout */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1400px; /* Slightly wider container for more content */
    margin: 0 auto; /* Center the container */
}

/* --- Global Header Section --- */
header {
    background: linear-gradient(160deg, #1A1A1A 0%, #0A0A0A 100%); /* Dark, subtle gradient */
    color: white;
    padding: 25px 25px 20px; /* Adjusted padding */
    text-align: left;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    position: sticky; /* Make header sticky */
    top: 0;
    z-index: 990;
    border-bottom: 1px solid #282828;
    display: flex; /* Use flexbox for header content */
    justify-content: space-between; /* Space out title and right buttons */
    align-items: center;
}

header h1 {
    margin: 0;
    font-size: 2.2em; /* Larger, more impactful title */
    font-weight: 700;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
    letter-spacing: -0.8px;
}

.header-ads-nav {
    padding: 0; /* Remove padding if handled by header */
    text-align: left; /* Aligned with header content */
    margin-left: 30px; /* Space from title */
}

.header-ads-nav a {
    color: #F8F8F8; /* Pure white */
    margin: 0 20px; /* More space between links */
    font-size: 1.1em; /* Slightly smaller for secondary nav */
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
    padding-bottom: 5px;
}

.header-ads-nav a:hover {
    color: #2E8B57; /* Kinema+ Green on hover */
    transform: scale(1.05);
}
.header-ads-nav a:active {
    color: #1A5432;
}
.header-ads-nav a.active { /* Style for active link */
    color: #2E8B57;
    font-weight: 700;
}
.header-ads-nav a.active::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    width: 80%;
    height: 3px;
    background-color: #2E8B57; /* Kinema+ Green accent */
    border-radius: 2px;
}
.header-ads-nav i {
    pointer-events: none; /* Keep icons non-interactive to clicks */
}

/* --- Page Specific Heading --- */
main > h1 {
    text-align: center;
    color: #FFFFFF; /* Pure white for prominent heading */
    font-size: 2.8em; /* Very large and impactful */
    margin-top: 40px;
    margin-bottom: 40px;
    font-weight: 700;
    letter-spacing: -1px;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

/* --- Main Content Area --- */
main {
    flex-grow: 1; /* Allows main content to fill available space */
    padding: 35px; /* Increased padding */
    max-width: 1400px; /* Match container width */
    margin: 40px auto 100px auto; /* Margin for sticky header/bottom nav */
    background-color: #111111; /* Dark background for main content area */
    border-radius: 15px; /* More rounded */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4); /* Deeper shadow */
    border: 1px solid #282828; /* Subtle border */
}

/* --- Producer Block Styling --- */
.producer-block {
    background-color: #1C1C1E; /* Dark gray background for producer blocks */
    border-radius: 15px; /* More rounded corners */
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3); /* Deeper shadow */
    margin-bottom: 50px; /* More space between blocks */
    padding: 35px; /* Increased padding */
    border: 1px solid #282828; /* Subtle border */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.producer-block:hover {
    transform: translateY(-8px); /* More pronounced lift effect */
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.45); /* Even deeper shadow on hover */
}

.producer-block h2 {
    color: #FFFFFF; /* Pure white for producer names */
    font-size: 2.5em; /* Larger, more prominent */
    border-bottom: 2px solid #2E8B57; /* Kinema+ Green border */
    padding-bottom: 15px;
    margin-bottom: 25px;
    text-align: left; /* Align to left */
    font-weight: 700;
    position: relative;
}

.producer-block h2::after { /* Small accent under title */
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 60px;
    height: 4px;
    background-color: #2E8B57; /* Kinema+ Green accent */
    border-radius: 2px;
}

/* --- Film Grid --- */
.film-grid {
    display: grid;
    /* Adjusted minmax for smaller cards */
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); 
    gap: 20px; /* Reduced gap for a tighter look */
    margin-top: 20px; /* Adjusted margin */
}

/* --- Film Card Styling --- */
.film-card {
    border: 1px solid #282828; /* Darker, subtler border */
    border-radius: 12px; /* More rounded corners */
    overflow: hidden; /* Ensures content respects border-radius */
    background-color: #0F0F0F; /* Very dark background for film cards */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3); /* Deeper shadow for cards */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex; /* Use flexbox for internal layout */
    flex-direction: column; /* Stack video and info */
    cursor: pointer; /* Indicate interactivity */
}

.film-card:hover {
    transform: translateY(-5px); /* Subtle lift */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4); /* Deeper shadow on hover */
    background-color: #1A1A1A; /* Slightly lighter on hover */
}

.film-card video {
    width: 100%;
    /* Reduced height for a more compact card */
    height: 120px; 
    background-color: #000000; /* Pure black background for video player */
    display: block;
    object-fit: cover; /* Ensures video fills space while maintaining aspect ratio */
    border-bottom: 1px solid #282828; /* Separator below video */
}

.film-info {
    padding: 15px; /* Reduced padding */
    flex-grow: 1; /* Allows info to take available height */
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Pushes button to the bottom */
}

.film-info h3 {
    margin-top: 0;
    margin-bottom: 8px; /* Reduced margin */
    color: #FFFFFF; /* Pure white for film titles */
    font-size: 1.1em; /* Smaller, more compact title */
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap; /* Prevent wrapping */
    overflow: hidden; /* Hide overflow */
    text-overflow: ellipsis; /* Add ellipsis */
}

.film-info p {
    font-size: 0.85em; /* Smaller description font */
    color: #A0A0A0; /* Softer gray for description */
    line-height: 1.4; /* Slightly tighter line height */
    margin-bottom: 12px; /* Reduced space below description */
    flex-grow: 1; /* Allows description to take available height */
    overflow: hidden; /* Hide overflow */
    display: -webkit-box; /* For multiline ellipsis */
    -webkit-line-clamp: 2; /* Limit to 2 lines for compactness */
    -webkit-box-orient: vertical;
}

.film-info button {
    display: block;
    width: 100%;
    padding: 10px; /* Reduced padding for button */
    margin-top: 10px; /* Reduced margin */
    background-color: #2E8B57; /* Kinema+ Green for action button */
    color: #fff;
    border: none;
    border-radius: 20px; /* Slightly less rounded for a more subtle look */
    cursor: pointer;
    font-size: 0.95em; /* Slightly smaller font */
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3); /* Slightly less pronounced shadow */
}

.film-info button:hover {
    background-color: #246B44; /* Darker green on hover */
    transform: translateY(-2px); /* Subtle lift effect */
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.4);
}
.film-info button:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4) inset;
    background-color: #1A5432;
}

/* --- Global Top-Right Buttons (Profile, Share, Notification) --- */
.top-right-buttons {
    display: flex;
    justify-content: flex-end; /* Align right */
    gap: 15px; /* More space between buttons */
}

.icon-btn {
    background: linear-gradient(to bottom right, #1A1A1A, #0A0A0A);
    border: 1px solid #282828;
    padding: 12px;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
}

.icon-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.5);
    background: linear-gradient(to bottom right, #2E8B57, #246B44); /* Kinema+ Green on hover */
}
.icon-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4) inset;
}

.icon-btn img {
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(1); /* Makes icon white */
}
.icon-btn:hover img {
    filter: brightness(100%) invert(0); /* Removes filter to show original (white) */
}

/* --- Footer Section --- */
footer {
    text-align: center;
    padding: 25px; /* More padding */
    margin-top: auto; /* Pushes footer to the bottom */
    background-color: #111111; /* Dark background */
    color: #A0A0A0; /* Softer gray text */
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.4); /* Deeper shadow */
    border-top: 1px solid #282828; /* Subtle top border */
    font-size: 0.95em;
}

/* --- Global Bottom Navigation --- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #111111; /* Dark background */
    display: flex;
    justify-content: space-around;
    padding: 12px 0; /* More padding */
    z-index: 999;
    box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.4);
    border-top-left-radius: 20px; /* More rounded */
    border-top-right-radius: 20px; /* More rounded */
    border-top: 1px solid #282828; /* Subtle top border */
}

.bottom-nav .nav-item {
    color: #888888; /* Muted gray for inactive items */
    text-align: center;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 12px;
    padding: 8px 5px;
    border-radius: 12px; /* More rounded */
    transition: all 0.3s ease;
    flex-grow: 1;
    max-width: 90px; /* Max width for each item */
}

.bottom-nav .nav-item img {
    filter: invert(70%); /* Grayish filter for inactive icons */
    margin-bottom: 5px;
    width: 26px; /* Larger icons */
    height: 26px;
    transition: filter 0.3s ease;
}

.bottom-nav .nav-item span {
    font-size: 0.9em;
    font-weight: 500;
}

.bottom-nav .nav-item:hover {
    background-color: #1A1A1A; /* Darker background on hover */
    color: #E0E0E0; /* Off-white on hover */
    transform: translateY(-3px); /* Subtle lift */
}
.bottom-nav .nav-item:hover img {
    filter: invert(100%); /* White icon on hover */
}

.bottom-nav .nav-item.active {
    background-color: #2E8B57; /* Kinema+ Green for active item */
    color: #fff;
    transform: translateY(-5px); /* More pronounced lift for active */
    box-shadow: 0 -5px 15px rgba(46, 139, 87, 0.3); /* Green glow */
}
.bottom-nav .nav-item.active img {
    filter: invert(0%) brightness(100%); /* Pure white icon for active */
}


/* --- Responsive Adjustments --- */
@media (max-width: 992px) {
    header h1 {
        font-size: 2em;
    }
    .header-ads-nav a {
        margin: 0 15px;
        font-size: 1em;
    }
    main > h1 {
        font-size: 2.2em;
        margin-top: 30px;
        margin-bottom: 30px;
    }
    main {
        margin: 30px auto 90px auto;
        padding: 25px;
    }
    .producer-block {
        padding: 30px;
        margin-bottom: 40px;
    }
    .producer-block h2 {
        font-size: 2.2em;
        padding-bottom: 12px;
        margin-bottom: 20px;
    }
    .film-grid {
        /* Adjusted minmax for smaller cards */
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 18px; /* Reduced gap */
    }
    .film-card video {
        height: 100px; /* Reduced height */
    }
    .film-info {
        padding: 15px; /* Consistent padding */
    }
    .film-info h3 {
        font-size: 1em; /* Smaller title */
    }
    .film-info p {
        font-size: 0.8em; /* Smaller description */
        -webkit-line-clamp: 2; /* Limit to 2 lines on small screens */
    }
    .film-info button {
        padding: 8px; /* Smaller button padding */
        font-size: 0.9em; /* Smaller button font */
    }
}

@media (max-width: 768px) {
    header {
        padding: 20px 20px 15px;
        flex-direction: column; /* Stack header elements */
        align-items: flex-start; /* Align header items to start */
    }
    header h1 {
        font-size: 1.8em;
    }
    .top-right-buttons {
        position: relative; /* Remove absolute positioning */
        top: auto;
        right: auto;
        margin-top: 15px; /* Space below header title */
        width: 100%; /* Take full width */
        justify-content: center; /* Center buttons */
    }
    .header-ads-nav {
        margin-top: 15px;
        margin-left: 0;
        width: 100%;
        text-align: center; /* Center nav links */
        display: flex; /* Allow horizontal scroll if needed */
        overflow-x: auto;
        padding-bottom: 5px; /* For scrollbar */
        justify-content: flex-start; /* Align left for scroll */
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Hide scrollbar for Firefox */
    }
    .header-ads-nav::-webkit-scrollbar {
        display: none; /* Hide scrollbar for Webkit */
    }
    .header-ads-nav a {
        flex-shrink: 0; /* Prevent shrinking */
        margin: 0 10px;
        font-size: 0.95em;
    }
    main > h1 {
        font-size: 1.8em;
        margin-top: 25px;
        margin-bottom: 25px;
    }
    main {
        margin: 20px 15px 80px 15px;
        padding: 20px;
        border-radius: 12px;
    }
    .producer-block {
        padding: 25px;
        margin-bottom: 30px;
        border-radius: 12px;
    }
    .producer-block h2 {
        font-size: 2em;
        padding-bottom: 10px;
        margin-bottom: 20px;
    }
    .producer-block h2::after {
        width: 40px;
    }
    .film-grid {
        /* Adjusted minmax for smaller cards */
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px; /* Reduced gap */
    }
    .film-card video {
        height: 90px; /* Reduced height */
    }
    .film-info {
        padding: 12px; /* Reduced padding */
    }
    .film-info h3 {
        font-size: 0.9em; /* Smaller title */
    }
    .film-info p {
        font-size: 0.75em; /* Smaller description */
        margin-bottom: 10px;
        -webkit-line-clamp: 2; /* Limit to 2 lines */
    }
    .film-info button {
        padding: 8px;
        font-size: 0.85em;
        margin-top: 10px;
    }
    footer {
        padding: 20px;
        font-size: 0.9em;
    }
    .bottom-nav {
        padding: 10px 0;
        border-top-left-radius: 15px;
        border-top-right-radius: 15px;
    }
    .bottom-nav .nav-item {
        font-size: 10px;
        padding: 5px 3px;
        max-width: 80px;
    }
    .bottom-nav .nav-item img {
        width: 22px;
        height: 22px;
    }
}

@media (max-width: 480px) {
    header {
        padding: 15px 15px 10px;
    }
    header h1 {
        font-size: 1.5em;
    }
    .top-right-buttons {
        gap: 10px;
        margin-top: 10px;
    }
    .icon-btn {
        width: 40px;
        height: 40px;
        padding: 8px;
    }
    .icon-btn img {
        width: 20px;
        height: 20px;
    }
    .header-ads-nav a {
        margin: 0 8px;
        font-size: 0.85em;
    }
    main > h1 {
        font-size: 1.6em;
        margin-top: 20px;
        margin-bottom: 20px;
    }
    main {
        margin: 15px 10px 70px 10px;
        padding: 15px;
        border-radius: 12px;
    }
    .producer-block {
        padding: 20px;
        margin-bottom: 25px;
    }
    .producer-block h2 {
        font-size: 1.8em;
        padding-bottom: 8px;
        margin-bottom: 15px;
    }
    .producer-block h2::after {
        width: 30px;
    }
    .film-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); /* Even smaller cards */
        gap: 10px; /* Even tighter gap */
    }
    .film-card video {
        height: 80px; /* Significantly reduced height */
    }
    .film-info {
        padding: 10px; /* Reduced padding */
    }
    .film-info h3 {
        font-size: 0.85em; /* Smallest title */
    }
    .film-info p {
        font-size: 0.7em; /* Smallest description */
        margin-bottom: 8px;
        -webkit-line-clamp: 2; /* Keep it concise */
    }
    .film-info button {
        padding: 7px;
        font-size: 0.8em;
        margin-top: 8px;
    }
    footer {
        padding: 15px;
        font-size: 0.85em;
    }
    .bottom-nav {
        padding: 8px 0;
    }
    .bottom-nav .nav-item {
        font-size: 9px;
        padding: 4px 2px;
        max-width: 70px;
    }
    .bottom-nav .nav-item img {
        width: 20px;
        height: 20px;
    }
}

/* Star Rating System Styles */
.rating {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px; /* Adjusted margin */
}

.rating .stars {
    display: flex;
    direction: rtl; /* For right-to-left star display */
}

.rating .star {
    font-size: 18px; /* Slightly smaller stars */
    color: #ccc;
    cursor: pointer;
    transition: color 0.2s;
}

.rating .star.selected,
.rating .star:hover,
.rating .star:hover~.star {
    color: gold;
}

.rating .vote-count {
    font-size: 0.8em; /* Smaller font for vote count */
    color: #888;
    margin-left: 8px; /* Adjusted margin */
}

.rating .average-rating {
    font-weight: bold;
    color: #E0E0E0; /* Consistent with overall text color */
    margin-left: 8px; /* Adjusted margin */
}

/* Category Badges */
.category-badge {
    display: inline-block;
    background-color: #333; /* Default dark background for badges */
    color: white;
    padding: 3px 8px; /* Adjusted padding */
    border-radius: 12px;
    font-size: 0.65em; /* Smaller font for badges */
    margin-bottom: 5px; /* Adjusted margin */
    text-transform: uppercase;
    font-weight: 600;
}

.series-badge { background-color: #e74c3c; } /* Red */
.longmetrage-badge { background-color: #3498db; } /* Blue */
.documentaire-badge { background-color: #2ecc71; } /* Green */
.courtmetrage-badge { background-color: #f39c12; } /* Orange */
