/* CSS to ensure the custom header is fixed */
html, body {
    height: 100%; /* Important for fixed positioning */
    min-height: 100vh; /* Fallback and ensures full viewport height */
    overflow-x: hidden; /* Prevents horizontal scrolling */
    margin: 0; /* Removes default margin */
    padding: 0; /* Removes default padding */
    background-color: #1a202c; /* Ensures background color matches custom theme */
    display: flex; /* Uses flexbox for the body */
    flex-direction: column; /* Arranges flex items in a column */
    align-items: center; /* Centers items horizontally */
    font-family: 'Roboto', sans-serif; /* Uses Roboto font */
}

/* Ensures the custom header remains fixed and sets its internal layout */
header {
    position: sticky; /* Sticky is generally better than fixed for headers */
    top: 0;
    left: 0;
    right: 0;
    width: 100%; /* Updated: Full width */
    z-index: 50; /* Ensures it's above other content */
    background-color: #1a202c; /* Ensures header has a dark background */
    box-sizing: border-box; /* Ensures padding doesn't increase width */
    padding-bottom: 0.5rem; /* Reduced from 1.25rem to 0.5rem */
    padding-top: 1.25rem;
}

/* Styles for the top part of the header container (logo, navigation, search) */
/* Removed custom CSS for .header-top-row to rely on Tailwind classes */

/* Styles for the genre buttons container (now part of the header) */
.genre-buttons-container { /* Uses existing class, not fixed/top */
    width: 100%;
    background-color: #1a202c; /* Matches main header background color */
    /* Removed padding: 1rem; to rely on Tailwind classes */
    border-top: 1px solid rgba(255, 255, 255, 0.1); /* Visual separation line */
}
/* Ensures main content starts right after the header */
main {
    margin-top: 0;
    padding-top: 0.5rem; /* Reduced from 1rem to 0.5rem for tighter spacing */
    width: 100%; /* Updated: Full width */
    margin-left: auto; /* Centers main content */
    margin-right: auto; /* Centers main content */
}

/* Adjust font size and padding for nav button to match genre button */
.nav-button {
    font-size: 0.875rem; /* text-sm */
    padding-left: 1rem; /* px-4 */
    padding-right: 1rem; /* px-4 */
    padding-top: 0.5rem; /* py-2 */
    padding-bottom: 0.5rem; /* py-2 */
}
/* Adjust font size for medium and up screens to remain large like genre button */
@media (min-width: 768px) {
    .nav-button {
        font-size: 1rem; /* md:text-base */
    }
}

/* Custom scrollbar for better aesthetics */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #2d3748; /* bg-gray-800 */
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: #4a5568; /* bg-gray-600 */
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #6b7280; /* bg-gray-500 */
}

/* Hide elements by default for layers */
.layer-2, .layer-3, .layer-4 { /* Added .layer-4 */
    display: none;
}

/* Ensures iframe fills its container responsively */
.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: 0.5rem; /* rounded-lg */
}
.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Basic spinner for loading */
.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #f97316; /* Orange-500 */
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Rainbow text style */
.rainbow-text {
    background-image: linear-gradient(to right, violet, indigo, blue, green, yellow, orange, red);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent; /* Makes text color transparent for gradient to show */
    display: inline-block; /* Important for background-clip to work correctly */
    font-size: 56px; /* Changed from 52px to 56px */
}

/* FIX: Ensures detail title is visible */
#detail-title {
    display: block;
    visibility: visible;
    height: auto;
    font-size: 3rem; /* Increased from 2.25rem (text-4xl) to 3rem (text-5xl) */
    line-height: normal;
    margin: 0 0 0.5rem 0; /* Adjust margin as needed */
}

/* Style for static movie cards in Layer 3 */
.static-movie-card {
    background-color: #1f2937; /* bg-gray-800 */
    border-radius: 0.5rem; /* rounded-lg */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); /* shadow-md */
    overflow: hidden;
    transform: scale(1);
    transition: all 0.3s ease-in-out; /* transition-all duration-300 */
    cursor: pointer;
}

.static-movie-card:hover {
    transform: scale(1.05); /* hover:scale-105 */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); /* hover:shadow-xl */
}

.static-movie-card img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
}

.static-movie-card .info {
    padding: 1rem; /* p-4 */
    text-align: center; /* Changed to center */
}

.static-movie-card h3 {
    font-size: 1.125rem; /* text-lg */
    font-weight: 600; /* font-semibold */
    color: #f9fafb; /* text-gray-100 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.25rem;
}

.static-movie-card p {
    font-size: 0.875rem; /* text-sm */
    color: #9ca3af; /* text-gray-400 */
}

/* CSS to remove underline from home logo link */
#home-logo-link {
    text-decoration: none; /* Removes default underline */
}
#home-logo-link:hover {
    text-decoration: none; /* Ensures no underline on hover */
}

/* Styling for Layer 4 SEO content */
.layer-4 { /* Target the section, not the inner content div */
    background-color: #1f2937; /* bg-gray-800 */
    padding: 2rem; /* p-8, or adjust as needed */
    border-radius: 0.75rem; /* rounded-xl */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    color: #e2e8f0; /* text-gray-200 */
    line-height: 1.6;
    position: relative; /* Ensure absolute positioning of back button works */
    width: 100%; /* Ensure it takes full width of its parent (main) */
}

.layer-4-content { /* This is the inner div for the text */
    /* Removed max-width and margin: auto to allow it to expand within the section's padding */
}

.layer-4-content h1, .layer-4-content h2, .layer-4-content h3 {
    color: #f9fafb; /* text-gray-100 */
    font-weight: 700; /* font-bold */
    margin-bottom: 1rem;
}

.layer-4-content h1 {
    font-size: 2.5rem; /* text-4xl */
    text-align: center;
    margin-bottom: 1.5rem;
}

.layer-4-content h2 {
    font-size: 2rem; /* text-3xl */
    margin-top: 2rem;
}

.layer-4-content h3 {
    font-size: 1.5rem; /* text-2xl */
    margin-top: 1.5rem;
}

.layer-4-content p {
    margin-bottom: 1rem;
    text-align: justify; /* Added for justified text */
}

.layer-4-content ul {
    list-style-type: disc;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.layer-4-content ol {
    list-style-type: decimal;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.layer-4-content li {
    margin-bottom: 0.5rem;
}

.layer-4-content strong {
    color: #cbd5e1; /* text-gray-300 */
}

.layer-4-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1.5rem auto;
    display: block;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}