/* General Styling */
body {
    margin: 0;
    padding: 0;
    background-color: #000;
    color: white;
    font-family: Arial, sans-serif;
    min-height: 100vh; /* Ensure body is at least viewport height */
    overflow-x: hidden; /* Prevent horizontal overflow */

    /* Flexbox for sticky footer */
    display: flex;
    flex-direction: column; /* Stack children vertically */
}


/* New wrapper for main content */
.main-content-wrap {
    flex-grow: 1; /* This will make the content area expand to fill available space */
    display: flex; /* Use flex to potentially arrange internal elements if needed */
    flex-direction: column; /* Stack its children vertically */
}

/* Header and Logo Styling */
header {
    display: flex;
    flex-shrink: 0;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 0;
    position: relative;
}

.gallery-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 0;
    position: relative;
}


.logo-link {
    position: relative; /* Ensure it doesn't overlap or float unexpectedly */
    z-index: 1000;
}

header .logo {
    width: 80px;
    height: auto;
    margin-bottom: 10px;
}

/* Footer Styling */
footer {
    position: relative; /* CRITICAL: Creates anchor for absolute children */
    width: 100%;
    text-align: center;
    color: white;
    margin-top: 20px;
    font-size: 0.8em;
    padding-bottom: 280px; /* Create space for buildings to prevent overlap with content above */
    z-index: 20;
}

footer > p {
    position: absolute;
    bottom: 10px; /* Adjust this value! Position it above the icons */
    left: 50%;
    transform: translateX(-50%);
    z-index: 30; /* Same as social-icons to stay on top */
    width: 100%;
    margin: 0; /* Remove default paragraph margins */
    color: #ddd; /* Optional: adjust color for better visibility */
}

/* Social Icons Styling */
.social-icons {
    position: absolute;
    bottom: 25px; /* Adjust this value to move icons up/down over the buildings */
    left: 50%;
    transform: translateX(-50%);
    z-index: 30; /* HIGHER than buildings -> ensures they are on top */
    width: 100%;
}

.social-icons .icon {
    display: inline-block;
    width: 40px;
    height: 40px;
    background-size: cover;
    margin: 0 10px;
}

.social-icons .twitter {
    background-image: url('images/twitter-icon.png');
}

.social-icons .bluesky {
    background-image: url('images/Bluesky-icon.png');
}

.social-icons .tiktok {
    background-image: url('images/tiktok-icon.png');
}


.social-icons .instagram {
    background-image: url('images/Instagram-icon.png');
}

.social-icons .telegram {
    background-image: url('images/telegram-icon.png');
}

.social-icons .speedtest {
    background-image: url('images/speedtest-logo.png');
}

.social-icons .home {
    background-image: url('images/home-icon.png');
}

/* Centered Content Styling */
.centered-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

/* Gallery Layout */
#gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); /* Adjusts number of columns based on screen size */
    gap: 20px; /* Space between grid items */
    padding: 20px;
    z-index: 30; /* Ensure gallery is above most elements */
    position: relative; /* Ensure gallery remains in context of the page */
    margin-top: 20px; /* Space from other content */
}

/* Artwork Card Styling */
.artwork-card {
    background-color: #562f76;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 10px;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative; /* Ensures the card is above other elements */
    z-index: 25; /* Make sure cards stay above the stars and comets */
}

.artwork-card:hover {
    transform: scale(1.05); /* Slight zoom effect on hover */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.artwork-card img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 10px;
}

.artwork-details h2 {
    font-size: 1.2em;
    margin-bottom: 10px;
}

.artwork-details p {
    margin: 0;
    font-size: 0.9em;
    color: #ddd; /* Lighter text colour */
}

/* Link Styling in Artwork Cards */
.artwork-details a {
    color: #add8e6; /* Light blue (sky blue) for normal links */
    text-decoration: none;
    font-weight: bold;
}

.artwork-details a:hover {
    color: #87ceeb; /* Slightly darker sky blue for hover */
    text-decoration: underline; /* Underline on hover for clarity */
}

.artwork-details a:visited {
    color: #afeeee; /* Light teal for visited links */
    text-decoration: none;
}

/* Buildings Styling */
#buildings-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    height: 254px;
    width: 100%;
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 10;
    background: rgba(0, 0, 0, 0.8);
    padding: 0 10px;
    box-sizing: border-box;
    /* NEW: Prevent horizontal overflow */
    overflow-x: hidden;
    max-width: 100vw;
}

/* Ensure individual buildings can scale down */
.building {
    display: inline-block;
    max-width: 100%; /* Prevent individual buildings from overflowing */
    height: auto; /* Maintain aspect ratio */
}

/* Star Styling */
#star-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0; /* Stars behind everything else */
}

.star {
    position: absolute;
    width: 4px;
    height: 4px;
    background-color: white;
    border-radius: 50%;
    pointer-events: auto;
    animation: rainbowEffect 5s infinite linear;
}

@keyframes rainbowEffect {
    0%, 100% {
        background-color: red;
    }

    14% {
        background-color: orange;
    }

    28% {
        background-color: yellow;
    }

    42% {
        background-color: green;
    }

    57% {
        background-color: blue;
    }

    71% {
        background-color: indigo;
    }

    85% {
        background-color: violet;
    }
}

/* Comet Styling */
.comet-container {
    position: absolute;
    will-change: left, top, transform;
    transform-origin: 50% 50%;
}

.comet {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background-color: white;
    position: relative;
}

.tail-segment {
    position: absolute;
    width: 2px;
    height: 2px;
    background-color: rgba(255, 165, 0, 0.6);
    box-shadow: 0 0 6px 2px rgba(255, 165, 0, 0.6);
}

.tail-segment:nth-child(2) {
    background-color: rgba(255, 140, 0, 0.6);
    right: 10px;
}

.tail-segment:nth-child(3) {
    background-color: rgba(255, 115, 0, 0.6);
    right: 20px;
}

.tail-segment:nth-child(4) {
    background-color: rgba(255, 90, 0, 0.6);
    right: 30px;
}

.tail-segment:nth-child(5) {
    background-color: rgba(255, 65, 0, 0.6);
    right: 40px;
}

.tail-segment:nth-child(6) {
    background-color: rgba(255, 40, 0, 0.6);
    right: 50px;
}

/* Button Styling */
button {
    background-color: #4C8E94;
    border: none;
    color: white;
    padding: 15px 32px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 10px auto;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.3s, box-shadow 0.3s;
}

button:hover {
    background-color: #437880;
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
}

button:active {
    background-color: #3A666E;
    box-shadow: 0 2px 4px 0 rgba(0,0,0,0.2);
}

/* Input Box Styling */
input[type="number"] {
    padding: 10px;
    margin: 10px auto;
    border: 3px solid #4C8E94;
    border-radius: 4px;
    font-size: 16px;
    display: block;
    width: 80%;
    max-width: 400px;
    box-sizing: border-box;
    transition: border-color 0.3s, box-shadow 0.3s;
}

input[type="number"]:focus {
    outline: none;
    border-color: #437880;
    box-shadow: 0 0 8px 0 rgba(0,0,0,0.2);
}

/* Mobile Adjustments */
@media (max-width: 600px) {
    input[type="number"], button {
        width: 95%;
    }

    #gallery {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}


/* Header Menu Styling */
.menu-header {
    background-color: #222; /* Dark background */
    padding: 10px 0;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); /* Subtle shadow */
}

.menu {
    display: flex;
    justify-content: center;
    gap: 40px; /* Spacing between menu items */
}

.menu-item {
    position: relative;
    color: white; /* Text colour */
    text-decoration: none; /* Remove underline */
    font-size: 18px;
    font-weight: bold;
    padding: 5px 0;
    transition: color 0.3s ease; /* Smooth hover transition */
    z-index: 2;
}

.menu-item:hover {
    color: #ffd700; /* Golden hover effect */
}

/* Underline Effect */
.menu-item::after {
    content: "";
    position: absolute;
    bottom: -5px; /* Adjust the line's position */
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background-color: #ffd700; /* Golden underline */
    transition: width 0.3s ease;
    z-index: 1;
}

.menu-item:hover::after {
    width: 120%; /* Slightly wider than the text */
}


/* Popup Overlay Styling */
.popup-overlay {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7); /* Semi-transparent background */
    z-index: 9999; /* Make sure it covers all other content */
    justify-content: center;
    align-items: center;
}

.popup {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    color: black;
    max-width: 300px;
    width: 100%;
}

.popup h2 {
    margin-bottom: 20px;
    font-size: 20px;
}

/* Re-adding button styles that were duplicated */
button {
    padding: 10px 20px;
    font-size: 16px;
    margin: 10px;
    cursor: pointer;
    border: none;
    border-radius: 5px;
    transition: background-color 0.3s;
    background-color: #4C8E94; /* Fallback for other buttons */
}

button:hover {
    background-color: #ff8c00;
}

.blurry {
    filter: blur(5px); /* Apply the blur effect */
    pointer-events: none; /* Disable interactions with blurred content */
}

/* Styles for the age verification popup */
.age-popup {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.popup-content {
    text-align: center;
    background: #333;
    padding: 20px;
    border-radius: 10px;
    max-width: 90%;
    width: 300px;
}

.popup-content h2 {
    margin-bottom: 20px;
    font-size: 20px;
}

/* Style the image when it's in fullscreen mode */
img:fullscreen {
    object-fit: contain; /* Ensures the image fits within the screen, maintaining aspect ratio */
    width: 100%;
    height: 100%;
    background-color: #000; /* Black background for a clean look */
}

/* Fallback for prefixed versions */
img:-webkit-full-screen {
    object-fit: contain;
    width: 100%;
    height: 100%;
    background-color: #000;
}

img:-moz-full-screen {
    object-fit: contain;
    width: 100%;
    height: 100%;
    background-color: #000;
}

img:-ms-fullscreen {
    object-fit: contain;
    width: 100%;
    height: 100%;
    background-color: #000;
}

/* The Modal (background) */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 10000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.9); /* Black w/ opacity */
    justify-content: center;
    align-items: center;
}

/* Modal Content (The Image) */
.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90vh;
}

/* Caption of Modal Image */
#caption {
    margin: auto;
    display: block;
    width: 80%;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    height: 150px;
}

/* The Close Button */
.close-modal {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
}

.close-modal:hover,
.close-modal:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}


/* Media Query for Mobile Devices */
@media screen and (max-width: 768px) {
    .modal-content {
        max-width: 95%;
        max-height: 85vh;
    }

    .close-modal {
        top: 10px;
        right: 15px;
        font-size: 30px;
    }

    #caption {
        font-size: 1em;
        bottom: 10px;
        padding: 0 10px;
    }

    .popup-content {
        padding: 15px;
    }

    .popup-content h2 {
        font-size: 18px;
    }

    #buildings-container {
        padding: 0 5px; /* Reduce padding on very small screens */
        height: 200px; /* Optional: Reduce height on mobile */
    }
    
    /* If buildings are images, ensure they scale */
    .building img {
        max-width: 100%;
        height: auto;
    }
    
    /* Adjust social icon positioning for mobile if needed */
    .social-icons {
        bottom: 25px; /* Adjust this value for mobile */
        transform: translateX(-50%) scale(0.9); /* Slightly scale down icons if needed */
    }
    
    /* Adjust text positioning for mobile if needed */
    footer > p {
        bottom: 10px; /* Adjust this value for mobile */
        font-size: 0.7em; /* Slightly smaller text */
    }
}