/* Color Palette Variables */
:root {
    --color-background: #282828; /* Charcoal */
    --color-text: #FF8C00;     /* Dark Orange */
    --color-light-text: #F0F0F0; /* Slightly lighter for general text */
    --color-play-button: rgba(255, 140, 0, 0.8); /* Semi-transparent orange for play button */
    --color-play-button-hover: rgba(255, 140, 0, 1);
    --color-close-button: #F0F0F0;
    --color-close-button-hover: #FF8C00;

    /* Font Variables */
    --font-body: 'Lexend', sans-serif;
    --font-title: 'Permanent Marker', cursive;

    /* Spacing */
    --spacing-md: 0.5rem;
    --spacing-lg: 3rem;
    --border-radius-md: 15px;
}

/* General Body Styles */
body {
    font-family: var(--font-body);
    background-color: var(--color-background);
    color: var(--color-light-text);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.strong {
    color: #FF8C00;
}


.emphasis {
     color: #FF8C00;
     font-weight: bold;

}

.social {
    color: rgb(0, 0, 0); background-color: #58627c; padding: 4px 4px; border-radius: 4px;

}

 a {
            color: #FF8C00;
            text-decoration: none;
            transition: color 0.3s ease;
        }

        a:visited {
            color: #FFA07A;
        }

        a:hover {
            color: #FFD700;
            text-decoration: underline;
        }

        a:active {
            color: #FF4500;
        }

        a:focus {
            color: #FFD700;
            outline: 2px solid #FFD700;
            outline-offset: 3px;
            text-decoration: underline;
        }


/* Headings */
h1, h2, h3 {
    font-family: var(--font-title);
    color: var(--color-text);
    text-align: center;
    margin-bottom: var(--spacing-md);
}

h1 {
    font-size: 2rem;
    margin-top: var(--spacing-md);
}

h2 {
    font-size: 1.7rem;
    margin-top: var(--spacing-md);
}

h3 {
    font-size: 1.5rem;
    margin-top: var(--spacing-md);
    text-align: left;
    padding-left: 5%;
    padding-right: 5%;
}

/* Container for main content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 5%; /* Responsive padding for smaller screens */
}

/* Language Switcher */
.language-switcher {
    text-align: right;
    padding: 0.5rem 25%;
    background-color: var(--color-background);
    position: sticky;
    top: 0;
    z-index: 100; /* Ensure it stays on top */
}

.language-switcher select {
    background-color: var(--color-background);
    color: var(--color-text);
    border: 1px solid var(--color-text);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    font-family: var(--font-body);
    cursor: pointer;
    outline: none;
}

.language-switcher select option {
    background-color: var(--color-background);
    color: var(--color-light-text);
}


/* Section Styling */
.intro-section, .playlist-section, .gallery-section, .about-creators-section {
    padding: var(--spacing-md) 0;
    margin-bottom: var(--spacing-md);
}

.intro-section p {
    font-size: 1.1rem;
    margin-bottom: var(--spacing-md);
    text-align: left;
}

/* Video Thumbnail Styling (Common for playlist and individual videos) */
.video-container, .video-item {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    cursor: pointer;
    overflow: hidden; /* Ensures border-radius applies cleanly */
    margin-bottom: var(--spacing-md);
}

.video-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--border-radius-md);
    transition: transform 0.3s ease;
}

.video-container:hover .video-thumbnail,
.video-item:hover .video-thumbnail {
    transform: scale(1.03);
}

/* Play Button Overlay */
.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background-color: var(--color-play-button);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s ease;
}

.play-button::before {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-top: 15px solid transparent;
    border-bottom: 15px solid transparent;
    border-left: 25px solid var(--color-light-text);
    margin-left: 5px; /* Adjust for optical centering of triangle */
}

.video-container:hover .play-button,
.video-item:hover .play-button {
    background-color: var(--color-play-button-hover);
}


/* Video Grid for individual videos */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Responsive grid */
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

/* Fullscreen Video Overlay */
.video-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95); /* Darker background for focus */
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
    z-index: 1000; /* Ensure it's on top of everything */
}

.video-overlay-content {
    position: relative;
    width: 90%;
    height: 90%;
    max-width: 1600px; /* Limit max width for very large screens */
    max-height: 900px; /* Limit max height */
    display: flex;
    justify-content: center;
    align-items: center;
}

.video-overlay iframe {
    width: 100%;
    height: 100%;
    border-radius: var(--border-radius-md); /* Apply border-radius to iframe */
}

.close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    color: var(--color-close-button);
    font-size: 3rem;
    cursor: pointer;
    z-index: 1001; /* Ensure close button is above iframe */
    line-height: 1; /* Adjust line height for better vertical centering of 'x' */
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: color 0.3s ease, background-color 0.3s ease;
}

.close-button:hover {
    color: var(--color-close-button-hover);
    background-color: rgba(0, 0, 0, 0.8);
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.6rem;
    }

    h3 {
        font-size: 1.3rem;
        text-align: center; /* Center "About" titles on mobile */
        padding: 0;
    }

    .intro-section p {
        font-size: 1rem;
    }

    .video-grid {
        grid-template-columns: 1fr; /* Single column for mobile */
    }

    .language-switcher {
        padding: 0.5rem 5%;
    }

    .close-button {
        font-size: 2.5rem;
        width: 40px;
        height: 40px;
        top: 5px;
        right: 5px;
    }

    .video-overlay-content {
        width: 95%;
        height: 95%;
    }
}


/* CSS Section for Carousel (carousel.css) */

/* Basic Carousel Container Styling */
.carousel-section {
    width: 100%;
    margin: 20px 0; /* Adjust vertical spacing for the entire section */
    box-sizing: border-box;
    font-family: sans-serif; /* Example font */
}

.carousel-container {
    position: relative;
    max-width: 900px; /* Max width of the carousel. Adjust as needed. */
    margin: 0 auto; /* Center the carousel on the page */
    overflow: hidden; /* Hide parts of slides that are outside the visible area */
    border-radius: 8px; /* Optional: adds rounded corners to the carousel */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); /* Optional: adds a subtle shadow */

    /* Highlight: CSS Variable for Transition Time */
    /* This variable is set by JavaScript to ensure consistency,
       but you can override it here if you wish (e.g., --carousel-transition-time: 0.5s;).
       It controls how long the slide animation (slide or fade) takes. */
    --carousel-transition-time: 0.7s; 
}

/* Slides Container (for Sliding Transition) */
.carousel-slides {
    display: flex; /* Arranges slides in a row for sliding effect */
    transition: transform var(--carousel-transition-time) ease-in-out; /* Default sliding transition */
    will-change: transform; /* Optimizes browser rendering for smooth animation */
}

/* Individual Slide Styling */
.carousel-slide {
    min-width: 100%; /* Each slide takes the full width of the container */
    box-sizing: border-box;
    position: relative; /* Allows caption to be positioned relative to the slide */
    overflow: hidden; /* Ensures image/caption doesn't spill if content is large */
}

.carousel-slide img {
    width: 100%;
    height: auto; /* Maintain aspect ratio */
    display: block; /* Removes extra space below image often caused by inline elements */
    object-fit: cover; /* Ensures the image covers the slide area, cropping if necessary */
    min-height: 300px; /* Minimum height for better visual consistency on larger screens */
    max-height: 600px; /* Maximum height to prevent excessively tall images */
    /* Adjust min-height and max-height based on your content and design */
}

/* Caption Styling */
.carousel-caption {
    position: absolute;
    bottom: 0; /* Position caption at the bottom of the slide */
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Semi-transparent black background */
    color: #fff;
    padding: 15px 20px;
    text-align: center;
    font-size: 1.1em;
    box-sizing: border-box;
}

/* Navigation Buttons Styling */
.carousel-prev,
.carousel-next {
    position: absolute;
    top: 50%; /* Center vertically */
    transform: translateY(-50%); /* Adjust for accurate vertical centering */
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
    color: #fff;
    border: none;
    padding: 10px 15px;
    font-size: 1.8em;
    cursor: pointer;
    z-index: 1; /* Ensure buttons are above slides */
    border-radius: 4px; /* Slightly rounded corners */
    transition: background-color 0.3s ease, opacity 0.3s ease; /* Smooth hover effect */
    user-select: none; /* Prevent text selection when clicking buttons */
    opacity: 0.8; /* Slightly transparent by default */
}

.carousel-prev:hover,
.carousel-next:hover {
    background-color: rgba(0, 0, 0, 0.7);
    opacity: 1; /* Fully opaque on hover */
}

.carousel-prev {
    left: 10px; /* Position left arrow */
}

.carousel-next {
    right: 10px; /* Position right arrow */
}

/* Dot Navigation Styling */
.carousel-dots {
    position: absolute;
    bottom: 10px; /* Position dots at the bottom */
    left: 50%;
    transform: translateX(-50%); /* Center horizontally */
    display: flex; /* For horizontal alignment of dots */
    gap: 8px; /* Space between dots */
    z-index: 1;
}

.dot {
    display: block;
    width: 12px;
    height: 12px;
    border-radius: 50%; /* Makes dots circular */
    background-color: rgba(255, 255, 255, 0.5); /* Semi-transparent white */
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.dot.active {
    background-color: rgba(255, 255, 255, 0.9); /* More opaque when active */
    transform: scale(1.2); /* Slightly enlarge active dot */
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .carousel-slide img {
        min-height: 250px;
        max-height: 400px;
    }
    .carousel-caption {
        font-size: 1em;
        padding: 10px 15px;
    }
    .carousel-prev,
    .carousel-next {
        padding: 8px 12px;
        font-size: 1.5em;
    }
    .carousel-dots {
        bottom: 5px;
    }
    .dot {
        width: 10px;
        height: 10px;
    }
}

@media (max-width: 480px) {
    .carousel-slide img {
        min-height: 200px;
        max-height: 300px;
    }
    .carousel-caption {
        font-size: 0.9em;
        padding: 8px 10px;
    }
    .carousel-prev,
    .carousel-next {
        font-size: 1.2em;
        padding: 6px 10px;
    }
}


/* --- ALTERNATIVE: FADING TRANSITION (Uncomment this section to use) --- */
/*
If you want a fading transition instead of sliding, uncomment the CSS rules below
AND set `isFadingTransition = true;` in the JavaScript file.
Also, make sure to comment out or remove the `display: flex;` and `transition`
properties from the `.carousel-slides` rule above, and `min-width: 100%;` from `.carousel-slide`.
*/

/*
.carousel-slides {
    display: block; // Important: override 'display: flex' for fading
    position: relative;
    height: 500px; // IMPORTANT: For fading, define a fixed height or max-height for the slides container. Adjust as needed.
    overflow: hidden;
    transition: none; // Disable transform transition for fading
}

.carousel-slide {
    position: absolute; // Position slides on top of each other for fading
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0; // Hidden by default
    transition: opacity var(--carousel-transition-time) ease-in-out; // Fading transition
    z-index: 0; // Ensure inactive slides are behind the active one
}

.carousel-slide.active-fade {
    opacity: 1; // Show current slide
    z-index: 1; // Bring active slide to the front
}

.carousel-slide img {
    height: 100%; // Make image fill the fixed height of the slide container
    object-fit: cover;
}

*/


/* Tablet Adjustments for 2 or 3 columns */
@media (min-width: 769px) and (max-width: 1024px) {
    .video-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columns for tablets */
    }
}

/* Desktop Adjustments for 3 or 4 columns */
@media (min-width: 1025px) {
    .video-grid {
        grid-template-columns: repeat(3, 1fr); /* Default 3 columns for desktop */
        /* If you want 4 columns, change to: grid-template-columns: repeat(4, 1fr); */
        /* If you want 2 columns, change to: grid-template-columns: repeat(2, 1fr); */
    }
}
