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

body {
    font-family: Arial, sans-serif;
    background-color: #121212;
    color: #ecf0f1;
    padding-top: 65px;
}

nav {
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    width: 100%;
    height: 65px;
    background-color: #2b2b35;
    color: #ecf0f1;
    z-index: 800;
    padding: 0 20px;
    gap: 20px; /* adds spacing between items */
}

nav a {
    display: flex;
    align-items: center;
    height: 100%;
    color: white;
    text-decoration: none;
}

nav img {
    max-width: 180px;
    max-height: 35px;
}

nav a:visited {
    color: white;
    text-decoration: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 6em;
    padding-bottom: 2em;
    padding-left: 1em;
    padding-right: 1em;
    width: 100%;
}

h1 {
    text-align: center;
    margin-bottom: 20px;
    color: #ffffff;
    font-size: clamp(24px, 5vw, 36px);
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 15px;
    padding: 15px;
}

.gallery-item {
    overflow: hidden;
    border-radius: 0px;
    box-shadow: 0 0px 0px rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease;
    background-color: #111111;
    position: relative;
    aspect-ratio: 1;
    width: 100%;
}

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

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
    .container {
        padding: 5px;
    }

    .gallery {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 10px;
        padding: 10px;
    }

    .gallery-item {
        border-radius: 4px;
    }

    /* Adjust modal controls for touch devices */
    .close-btn {
        top: 10px;
        right: 10px;
        font-size: 40px;
        padding: 10px;
    }

    .nav-btn {
        padding: 12px 15px;
        font-size: 20px;
        bottom: 10px;
    }

    .prev-btn {
        left: 10px;
    }

    .next-btn {
        right: 10px;
    }
}

@media screen and (max-width: 480px) {
    .gallery {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 8px;
        padding: 8px;
    }

    .gallery-item:hover {
        transform: scale(1.02);
    }

    /* Further adjust modal controls */
    .close-btn {
        font-size: 35px;
    }

    .nav-btn {
        padding: 10px 12px;
        font-size: 18px;
    }
}

/* Add touch-friendly improvements */
@media (hover: none) {
    .gallery-item:hover {
        transform: none;
    }

    .nav-btn, .close-btn {
        -webkit-tap-highlight-color: transparent;
    }

    /* Make buttons more touch-friendly */
    .nav-btn {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    padding: 0;
}

.modal-content {
    display: block;
    max-width: 100%;
    width: 100%;
    height: 100vh;
    margin: 0;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    object-fit: contain;
    background-color: black;
    max-height: 90vh;
    object-fit: contain;
    width: 100%;
    height: auto;
}

.close-btn {
    position: fixed;
    top: 70px;
    right: 40px;
    color: #ffffff;
    font-size: 50px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1000;
    text-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.close-btn:hover {
    color: #bbb;
}

/* Create a container for bottom controls */
.modal-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: rgba(0, 0, 0, 0.8);
    padding: 15px 20px;
    z-index: 1000;
}

/* Update caption styles */
.caption {
    position: static; /* Remove fixed positioning */
    flex-grow: 1; /* Allow caption to take available space */
    text-align: center;
    color: white;
    font-size: 18px;
    padding: 0 20px;
    margin: 0;
    background: none;
}

/* Update navigation button styles */
.nav-btn {
    position: static; /* Remove fixed positioning */
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 10px 15px;
    border: none;
    cursor: pointer;
    font-size: 24px;
    font-weight: bold;
    transition: background-color 0.3s, color 0.3s;
    border-radius: 5px;
}

/* Update modal content to not overlap with controls */
.modal-content {
    max-height: calc(100vh - 70px); /* Adjust for controls height */
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
    .modal-controls {
        padding: 10px;
    }
    
    .caption {
        font-size: 16px;
        padding: 0 10px;
    }
    
    .nav-btn {
        padding: 8px 12px;
        font-size: 20px;
    }
}

@media screen and (max-width: 480px) {
    .modal-controls {
        padding: 8px;
    }
    
    .caption {
        font-size: 14px;
        padding: 0 8px;
    }
    
    .nav-btn {
        padding: 6px 10px;
        font-size: 18px;
    }
}

/* Optional: Add hover effect for better visibility */
.nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Add smooth scrolling for the whole page */
html {
    scroll-behavior: smooth;
}

/* Optimize for different screen orientations */
@media screen and (orientation: landscape) and (max-height: 500px) {
    .nav-btn {
        bottom: 10px;
    }

    .caption {
        bottom: 60px;
    }

    .modal-content {
        max-height: 80vh;
    }
}

@media screen and (max-width: 768px) {
    .caption {
        bottom: 80px;
        font-size: 16px;
        padding: 10px;
    }
}

@media screen and (max-width: 480px) {
    .caption {
        bottom: 70px;
        font-size: 14px;
        padding: 8px;
    }
} 