/* --- 1. Global & Background Styles --- */
:root {
    /* Define a color variable for easy theme changes */
    --accent-color: #ffd700; /* Gold, from a previous discussion! */
    --text-color: #ffffff;
    --dark-bg: rgba(0, 0, 0, 0.7);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: sans-serif;
    color: var(--text-color);
    /* Prevents scrollbar flash from full-height elements */
    overflow-x: hidden; 
}

/* Add support for mobile scroll lock */
body.no-scroll {
    overflow: hidden;
}

/* Full-screen Background Image Setup */
.background-container {
    position: fixed; /* Fixes the image to the viewport */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Use your image URL here */
    background-image: url('images/home.png');
    background-size: cover; /* ESSENTIAL: Ensures the image covers the whole screen */
    background-position: center center; /* Centers the image */
    background-repeat: no-repeat;
    z-index: -1; /* Pushes the background behind all content */
}

/* Optional: Text styling for the main content */
.hero-text {
    /* Padding added to the main content wrapper to prevent overlap with the fixed header */
    padding-top: 80px; 
    height: 100vh; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    /* Add a subtle dark overlay to ensure text is readable */
    background-color: rgba(0, 0, 0, 0.2); 
}

/* --- 2. Navigation Styles --- */

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    background-color: var(--dark-bg);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    z-index: 100;
    
    /* FIX: Make the header fixed at the top and full width */
    position: fixed; 
    width: 100%;
    top: 0;
    left: 0;
}

.logo {
    font-size: 1.5rem;
    color: var(--accent-color);
}

.nav-links {
    list-style: none;
    display: flex;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    padding: 0 15px;
    font-size: 1rem;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--accent-color);
}

/* --- 3. Hamburger Menu Styles (Mobile Default) --- */

.hamburger-menu {
    display: none; /* Hidden by default on desktop */
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 200;
}

.bar {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--text-color);
    transition: all 0.3s ease-in-out;
}

/* --- 4. Mobile Responsiveness via Media Query --- */

/* Styles applied when the screen width is 768px or less (Mobile/Tablet) */
@media screen and (max-width: 768px) {
    
    .hamburger-menu {
        display: flex; /* Show the hamburger on mobile */
    }

    .nav-links {
        /* Mobile menu is stacked vertically and full-screen */
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: 100%;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        background-color: var(--dark-bg);
        
        /* Start off-screen */
        transform: translateX(100%); 
        transition: transform 0.5s ease-in-out;
    }

    .nav-links.active {
        /* Slide in when active */
        transform: translateX(0); 
    }

    .nav-links li {
        opacity: 0;
        margin: 20px 0;
        transition: opacity 0.3s ease-in-out 0.2s;
    }

    .nav-links.active li {
        opacity: 1;
    }
    
    .nav-links a {
        font-size: 2rem;
        padding: 10px 0;
    }

    /* Hamburger Animation (X-mark) */
    .hamburger-menu.active .bar:nth-child(2) {
        opacity: 0; /* Hide the middle bar */
    }

    .hamburger-menu.active .bar:nth-child(1) {
        transform: translateY(11px) rotate(45deg);
    }

    .hamburger-menu.active .bar:nth-child(3) {
        transform: translateY(-11px) rotate(-45deg);
    }
}

/* --- 5. Photo Album Styles --- */

.photo-grid {
    display: grid;
    /* Default: 1 column on small screens */
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); 
    gap: 20px; /* Space between photos */
    margin-top: 20px;
}

.photo-item {
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    background-color: rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease;
    cursor: pointer; /* Indicate it's clickable */
}

.photo-item:hover {
    transform: scale(1.03);
}

.photo-item img {
    width: 100%;
    height: 250px; /* Fixed height for uniformity */
    object-fit: cover; /* ESSENTIAL: Crops to fit the box without distortion */
    display: block;
}

/* 🔑 FIX: Lightbox Modal Styles */
.lightbox {
    /* CRITICAL FIX: Set to none by default */
    display: none; 
    position: fixed; 
    z-index: 2000; /* High z-index to cover everything */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; 
    background-color: rgba(0, 0, 0, 0.95); /* Black w/ high opacity */
    
    /* These styles make it appear when JS changes display from 'none' to 'flex' */
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.lightbox-content {
    display: block;
    width: auto;
    max-width: 95%; /* Maximum width */
    height: auto;
    max-height: 95vh; /* Maximum height to fit the screen */
    object-fit: contain; /* Scales down to fit without cropping */
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
    /* Prevent backdrop click from registering on the image */
    pointer-events: auto; 
}

/* The Close Button (X) */
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #f1f1f1;
    font-size: 50px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    user-select: none;
    z-index: 2001;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: var(--accent-color);
}

/* --- 6. Form/Contact/Login Styles --- */
.login-box, .register-box {
    position: absolute; 
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 400px;
    padding: 30px;
    background: rgba(0, 0, 0, 0.85); 
    color: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    text-align: center;
    z-index: 5;
}

.login-box label, .register-box label {
    display: block;
    text-align: left;
    margin-bottom: 5px;
    font-weight: bold;
}

.login-box input, .register-box input {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #555;
    border-radius: 5px;
    background-color: #333;
    color: white;
}

.login-submit, .register-submit {
    width: 100%;
    padding: 10px;
    background-color: var(--accent-color); 
    color: black;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.register-link-container, .login-link-container {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.register-link-button, .login-link-button {
    display: block;
    padding: 10px;
    text-decoration: none;
    color: #ccc;
    background-color: transparent;
    border: 1px solid #555;
    border-radius: 5px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.register-link-button:hover, .login-link-button:hover {
    background-color: #555;
    color: white;
}

/* Contact form styles */
.contact-form {
    width: 90%; 
    max-width: 500px; 
    margin: 20px auto;
    padding: 20px;
    background: rgba(255, 255, 255, 0.9); 
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5); 
    display: flex;
    flex-direction: column;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    color: #333; 
}

.contact-form textarea {
    resize: vertical; 
    min-height: 120px;
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--accent-color); 
    outline: none;
    box-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}
.contact-form button[type="submit"] {
    background-color: var(--accent-color); 
    color: #333; 
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.1s ease;
}

.contact-form button[type="submit"]:hover {
    background-color: #e6c500; 
}

.contact-form button[type="submit"]:active {
    transform: translateY(1px); 
}
