body {
    margin: 0;
    padding: 0;
    background-color: black;
    /* background-image: url(../assets/engineering-code-computation0000.mp4); */
    background-position-x: 0px;
    background-position-y: 0px;
    background-size: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 200;
}

.video-background {
    position: fixed;
    top: 10%;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: black; /* Fallback */
}

#bg-video {
     /* Horizontal centering */
     position: absolute;
     left: 50%;
     transform: translateX(-50%); /* Only horizontal centering */
     
     /* Vertical locking */
     top: 0; /* Stick to top - change to 'bottom: 0' if you prefer */
     
     /* Size control */
     height: 100vh; /* Fill full viewport height */
     width: auto; /* Maintain aspect ratio */
     min-width: 100%; /* Prevent gaps on sides */
     
     /* Ensure full video is visible */
     object-fit: contain;
}

.gallery-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 20px 0; /* Optional spacing */
}
.gallery {
    display: inline-flex; /* Changed from flex */
    gap: 10px;
    overflow-x: auto;
    padding: 10px;
    max-width: 100%; /* Prevent overflow */
    margin: 0 auto; /* Keep this */
}

.gallery-item {
    width: 150px;
    height: 150px;
    overflow: hidden; /* Prevent internal scrolling */
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease;
    flex-shrink: 0; /* Prevent items from shrinking */
    z-index: 1; /* Ensure items are above other content */
}

.gallery-item img, .gallery-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img, .gallery-item:hover video {
    transform: scale(1.2);
}

.popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    color: rgb(213, 229, 241);
    text-align: center;
    overflow: auto; /* Add scroll if content overflows */
    z-index: 1000; /* Ensure popup is above other content */
}

.popup-content {
    /* Background settings (keeps full image) */
    background-image: url(../assets/night.JPEG);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    
    /* Text container settings */
    display: flex;
    flex-direction: column;
    width: 80%;
    max-width: 800px;
    height: 90vh;
    max-height: 90vh;
    overflow-y: auto; /* Vertical scroll only */
    overflow-x: hidden;
    
    /* Visual styling */
    border-radius: 10px;
    position: relative;
    margin: 20px auto;
}

/* Add this new container for your text */
.text-container {
    /* background-color: rgba(0, 0, 0, 0.7);  */
    padding: 25px;
    margin: 20px;
    border-radius: 8px;
    color: white;
    text-shadow: 1px 1px 2px black;
    
    /* Text wrapping */
    white-space: normal; /* Allows line breaks */
    word-wrap: break-word; /* Breaks long words */
    overflow-wrap: break-word;
    line-height: 1.6;
}
.popup-content img, .popup-content video {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
}

.close {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 30px;
    cursor: pointer;
    color: black;
}

.close:hover {
    color: red;
}

#popup-media {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px; /* Space between pages and buttons */
}

/* Style for PDF pages */
#popup-media canvas {
    border: 1px solid #ccc;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 10px; /* Space between pages */
}

/* Style for navigation buttons */
#popup-media .nav-buttons {
    display: flex;
    justify-content: center;
    gap: 10px; /* Space between buttons */
    margin-top: 10px;
}

#home {
    position: fixed; /* Fix the home link to the viewport */
    left: 5%;
    bottom: 5%;
    z-index: 100; /* Ensure it's above other content */
    text-shadow: 0 0 10px rgba(251, 188, 248, 0.8);
}

/* Add this instead - only affects non-fairy videos */
.gallery-item video:not(.fairy-preview),
.popup-content video:not(#fairy-video-popup) {
    pointer-events: none;
}

.gallery-item video:not(.fairy-preview)::-webkit-media-controls,
.popup-content video:not(#fairy-video-popup)::-webkit-media-controls {
    display: none !important;
}

a {
    color: rgb(239, 188, 248);
}

#data-heading {
    position: relative;
}

#song {
    position: fixed; /* Fix the song text to the viewport */
    right: 1%; /* Adjust as needed */
    bottom: 80px;
    padding-left: 6%;
    color: rgb(205, 252, 252);
    z-index: 100; /* Ensure it's above other content */
    text-shadow: 0 0 10px rgba(175, 234, 252, 0.8);
}

#audio {
    position: fixed; /* Fix the audio player to the viewport */
    bottom: 20px; /* Position it 20px from the bottom */
    right: 20px; /* Position it 20px from the right */
    z-index: 1000; /* Ensure it's above other content */
    border-radius: 10px; /* Rounded corners */
    padding: 10px; /* Add some padding */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Add a subtle shadow */
}

#audio audio {
    width: 200px; /* Adjust the width of the audio player */
    height: 40px; /* Set a fixed height for the controls */
    -webkit-appearance: none; /* Disable default Chrome/Safari styling */
    appearance: none; /* Disable default styling in other browsers */
    background-color: transparent; /* Make the background transparent */
}

#audio audio::-webkit-media-controls-panel {
    background-color: rgba(255, 255, 255, 0.8); /* Semi-transparent white background for controls */
    border-radius: 10px; /* Rounded corners for controls */
}

/* Remove this rule to show video controls
video::-webkit-media-controls {
    display: none !important;
} */

/* Add this for fairy video controls */
/* Fairy Video Preview in Gallery */
.gallery-item .fairy-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none; /* Prevent blocking clicks */
}

/* Fairy Video Popup Styles */
.fairy-video-container {
    width: 100%;
    background: black;
    margin: 0 auto;
    border-radius: 8px;
    overflow: hidden;
    position: relative; /* Required for spinner positioning */
}

.fairy-video-container::before {
    content: "✨";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 24px;
    z-index: 10;
    opacity: 1;
    transition: opacity 0.5s ease-out;
    pointer-events: none;
    /* Spinning animation */
    animation: spin 2s linear infinite, pulse 1.5s ease-in-out infinite;
}

/* @keyframes spin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
} */

/* New pulse animation */
@keyframes pulse {
    0% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.3); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

#fairy-video-popup.playing + .fairy-video-container::before {
    opacity: 0;
}

#fairy-video-popup {
    width: 100%;
    display: block;
    /* Force controls to NEVER hide */
    --controls-visibility: visible !important;
}

/* Nuclear option for controls */
#fairy-video-popup::-webkit-media-controls {
    display: flex !important;
    opacity: 1 !important;
    visibility: var(--controls-visibility);
}

#fairy-video-popup::-webkit-media-controls-panel {
    background: rgba(0,0,0,0.8) !important;
}
/* Keep this for other videos */
.popup-content video:not(#fairy-video-popup)::-webkit-media-controls {
    display: none !important;
}

#home:hover {  
    animation: float 2s ease-in-out infinite;
    filter: drop-shadow(0 0 8px rgba(239, 188, 248, 0.7));
}  
@keyframes float {  
    0% { transform: translateY(0); }  
    50% { transform: translateY(-5px); }  
    100% { transform: translateY(0); }  
}  

/* SCROLL INDICATOR SECTION */
/* Scroll indicators */
.scroll-indicator {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 40px;
    color: rgba(240, 157, 255, 0.792);
    z-index: 10;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.7s ease;
    text-shadow: 0 0 5px black;
    font-weight: bolder;
}

.left-indicator {
    left: 50px;
}

.right-indicator {
    right: 50px;
}

/* Show indicators when scrollable */
.gallery:hover .scroll-indicator {
    opacity: 0.7;
}

/* Pulse animation */
@keyframes pulse {
    0% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(1.2); }
    100% { transform: translateY(-50%) scale(1); }
}

.scroll-indicator {
    animation: pulse 2s infinite;
    z-index: 1000;
}

/* Hide when at scroll limits */
.gallery.at-start .left-indicator,
.gallery.at-end .right-indicator {
    opacity: 0 !important;
    animation: none;
}

/* Hover overlay styles */
.gallery-item .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 1px;
    box-sizing: border-box;
    pointer-events: none;
    z-index: 2; /* Higher than the gallery-item */
}

.gallery-item:hover .overlay {
    opacity: 1;
    z-index: 3; /* Highest when hovered */
}

/* Ensure videos/images don't interfere */
.gallery-item img, 
.gallery-item video {
    position: relative;
    z-index: 1;
}
