/* Reset und Basis-Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* Header */
.header {
    background-color: #2c3e50;
    color: white;
    padding: 1.5rem 1rem;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

/* Navigation (oben und unten) */
.page-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem 0;
    flex-wrap: wrap;
}

.nav-button {
    padding: 0.75rem 1rem;
    background-color: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
    border: none;
    cursor: pointer;
}

.nav-button:hover {
    background-color: #2980b9;
}

.nav-button:disabled,
.nav-button.disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
    pointer-events: none;
}

.current-page {
    font-weight: bold;
    padding: 0.75rem 1rem;
    color: #2c3e50;
}

/* Galerie Masonry - Mobile First */
.gallery {
    column-count: 2;
    column-gap: 0.75rem;
    padding: 1rem 0;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: white;
    margin-bottom: 0.75rem;
    break-inside: avoid;
    page-break-inside: avoid;
    display: inline-block;
    width: 100%;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
}

/* Tablet (ab 600px) */
@media (min-width: 600px) {
    .header h1 {
        font-size: 2rem;
    }

    .gallery {
        column-count: 3;
        column-gap: 1rem;
    }

    .gallery-item {
        margin-bottom: 1rem;
    }

    .nav-button {
        padding: 0.875rem 1.25rem;
        font-size: 1rem;
    }
}

/* Desktop (ab 900px) */
@media (min-width: 900px) {
    .gallery {
        column-count: 4;
        column-gap: 1.25rem;
    }

    .gallery-item {
        margin-bottom: 1.25rem;
    }

    .container {
        padding: 2rem;
    }
}

/* Large Desktop (ab 1200px) */
@media (min-width: 1200px) {
    .gallery {
        column-count: 5;
        column-gap: 1.5rem;
    }

    .gallery-item {
        margin-bottom: 1.5rem;
    }
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.lightbox.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
}

/* Lightbox Navigation */
.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2.5rem;
    color: white;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
    z-index: 1001;
}

.lightbox-close:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2rem;
    color: white;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    padding: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    z-index: 1001;
    border-radius: 4px;
}

.lightbox-prev {
    left: 1rem;
}

.lightbox-next {
    right: 1rem;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

/* Counter */
.lightbox-counter {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    background: rgba(0, 0, 0, 0.5);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    z-index: 1001;
}

/* Mobile optimizations für Lightbox */
@media (max-width: 600px) {
    .lightbox-close {
        top: 0.5rem;
        right: 0.5rem;
        width: 40px;
        height: 40px;
        font-size: 2rem;
    }

    .lightbox-prev,
    .lightbox-next {
        font-size: 1.5rem;
        padding: 0.75rem;
    }

    .lightbox-prev {
        left: 0.5rem;
    }

    .lightbox-next {
        right: 0.5rem;
    }

    .lightbox-counter {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}

/* Loading indicator */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem 1rem;
    color: #7f8c8d;
    font-size: 0.9rem;
}
