body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
}

main {
    padding: 20px;
    margin: 0, auto;
}

header {
    background-color: #333;
    color: white;
    padding: 10px 0;
    text-align: center;
}

nav {
    margin: 20px 0;
}

nav ul {
    list-style: none;
    padding: 0;
}

nav ul li {
    display: inline;
}

nav a {
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border: 1px solid transparent;
    margin: 0 5px;
}

nav a:hover {
    background-color: #555;
    border: 1px solid white;
}

.gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin: 20px;
}

.gallery img {
    max-width: 100%;
    height: auto;
    margin: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    transition: transform 0.2s;
}

.gallery img:hover {
    transform: scale(1.05);
}
.gallery-item {
    margin: 15px;
    text-align: center;
    width: 220px;
    display: inline-block;
    vertical-align: top;
}

.image-desc {
    margin-top: 8px;
    font-size: 0.95em;
    color: #333;
}
.image-grid img,
.image-container img {
    max-width: 180px;
    max-height: 180px;
    width: auto;
    height: auto;
    object-fit: cover;
    display: block;
    margin: 0 auto;
}
/* Overlay styles */
.img-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.img-overlay img {
    max-width: 90vw;
    max-height: 80vh;
    margin-bottom: 10px;
    background: #fff;
    padding: 8px;
    border-radius: 4px;
}
.close-btn {
    position: absolute;
    top: 24px;
    right: 40px;
    font-size: 2.5em;
    color: #fff;
    cursor: pointer;
    z-index: 10001;
}
.overlay-caption {
    color: #fff;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.1em;
}
.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2em;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    cursor: pointer;
    padding: 10px 18px;
    z-index: 10001;
}
#prevImg { left: 30px; }
#nextImg { right: 30px; }

.random-gallery-previews {
    display: flex;
    gap: 40px;
    justify-content: center;
    margin: 30px 0;
}
.preview-img {
    max-width: 220px;
    max-height: 220px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: transform 0.2s;
}
.preview-img:hover {
    transform: scale(1.05);
}

.main-tabs {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.main-tabs ul {
    display: flex;
    gap: 20px;
    list-style: none;
    padding: 0;
    margin: 0;
    justify-content: center;
    align-items: center;
}
.main-tabs a {
    display: block;
    padding: 10px 24px;
    text-decoration: none;
    color: #333;
    background: #f0f0f0;
    border-radius: 8px 8px 0 0;
    font-weight: bold;
    transition: background 0.2s, color 0.2s;
}
.main-tabs a.selected,
.main-tabs a:disabled {
    background: #fff;
    color: #0074d9;
    cursor: default;
    pointer-events: none;
    border-bottom: 2px solid #0074d9;
}