* {
    box-sizing: border-box;
}

:root {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #1d1d1f;
    background: #f5f5f7;
}

body {
    margin: 0;
    min-height: 100vh;
}

.header {
    height: 72px;
    padding: 0 7%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,255,255,.85);
    border-bottom: 1px solid #e8e8ed;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 17px;
    font-weight: 650;
    letter-spacing: -.3px;
}

.brand-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: #1d1d1f;
    color: white;
    font-weight: 700;
}

.admin-link {
    color: #555;
    text-decoration: none;
    font-size: 14px;
}

.hero {
    max-width: 1100px;
    margin: auto;
    padding: 100px 24px 70px;
    text-align: center;
}

.eyebrow {
    color: #86868b;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
}

h1 {
    margin: 24px 0 18px;
    font-size: clamp(42px, 7vw, 76px);
    line-height: 1.04;
    letter-spacing: -4px;
    font-weight: 750;
}

h1 span {
    color: #86868b;
}

.intro {
    max-width: 520px;
    margin: 0 auto;
    color: #6e6e73;
    font-size: 19px;
    line-height: 1.6;
}

.event-card {
    max-width: 850px;
    margin: 65px auto 0;
    padding: 12px;
    border-radius: 28px;
    background: white;
    box-shadow: 0 15px 50px rgba(0,0,0,.07);
}

.event-placeholder {
    min-height: 270px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 19px;
    background: linear-gradient(135deg, #f0f0f2, #e5e5ea);
}

.camera-icon {
    font-size: 38px;
    margin-bottom: 12px;
}

.event-placeholder h2 {
    margin: 0 0 8px;
    font-size: 25px;
}

.event-placeholder p {
    margin: 0 0 20px;
    color: #6e6e73;
}

.status {
    padding: 8px 14px;
    border-radius: 30px;
    background: white;
    color: #777;
    font-size: 12px;
}

.features {
    max-width: 1050px;
    margin: 0 auto;
    padding: 25px 24px 90px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 45px;
}

.feature {
    text-align: center;
}

.feature-icon {
    font-size: 29px;
    margin-bottom: 15px;
}

.feature h3 {
    margin: 0 0 10px;
    font-size: 19px;
}

.feature p {
    margin: 0;
    color: #777;
    font-size: 14px;
    line-height: 1.6;
}

footer {
    padding: 28px 7%;
    display: flex;
    justify-content: space-between;
    color: #999;
    border-top: 1px solid #e5e5e5;
    font-size: 12px;
}

@media (max-width: 650px) {
    .header {
        padding: 0 20px;
    }

    .hero {
        padding-top: 70px;
    }

    h1 {
        letter-spacing: -2px;
    }

    .intro {
        font-size: 16px;
    }

    .features {
        grid-template-columns: 1fr;
        gap: 35px;
    }

    footer {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

/* Party-Bilderpool – Gäste-Upload */

.guest-upload {
    max-width: 680px;
    margin: 30px auto 70px;
    padding: 38px 28px;
    background: white;
    border-radius: 28px;
    text-align: center;
    box-shadow: 0 15px 45px rgba(0,0,0,.06);
}

.guest-upload h2 {
    margin: 0 0 12px;
    font-size: 27px;
    letter-spacing: -.7px;
}

.guest-upload p {
    color: #6e6e73;
    line-height: 1.6;
}

.upload-select {
    display: block;
    margin: 25px auto 15px;
    padding: 18px;
    border: 2px dashed #d2d2d7;
    border-radius: 18px;
    background: #fafafa;
    cursor: pointer;
}

.upload-select input {
    max-width: 100%;
}

.guest-button {
    display: inline-block;
    margin-top: 15px;
    padding: 15px 28px;
    border: 0;
    border-radius: 14px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.guest-button:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.upload-progress {
    width: 100%;
    height: 9px;
    margin-top: 25px;
    overflow: hidden;
    border-radius: 20px;
    background: #e8e8ed;
}

.upload-progress-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    transition: width .2s ease;
}

.upload-status {
    margin-top: 18px;
    font-size: 14px;
    line-height: 1.6;
    color: #6e6e73;
}

.upload-results {
    margin-top: 20px;
    text-align: left;
    font-size: 14px;
    line-height: 1.7;
}

@media (max-width: 650px) {
    .guest-upload {
        margin: 20px 15px 45px;
        padding: 30px 18px;
    }
}

/* ===== Party-Bilderpool Galerie ===== */

.gallery-section {
    max-width: 1200px;
    margin: 0 auto 80px;
    padding: 0 24px;
}

.gallery-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 16px;
    margin: 55px 0 24px;
}

.gallery-heading h2 {
    margin: 8px 0;
    font-size: clamp(28px, 4vw, 38px);
    letter-spacing: -1.2px;
}

.gallery-heading p,
#galleryCounter {
    color: #6e6e73;
    font-size: 14px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.gallery-photo {
    display: block;
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
    padding: 0;
    border: 0;
    border-radius: 16px;
    background: #e8e8ed;
    cursor: pointer;
}

.gallery-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .25s ease;
}

.gallery-photo:hover img {
    transform: scale(1.04);
}

.gallery-sentinel {
    height: 1px;
}

.gallery-load-more {
    display: block;
    margin: 24px auto;
    padding: 12px 22px;
    border: 0;
    border-radius: 24px;
    background: #f0f0f5;
    color: #1d1d1f;
    cursor: pointer;
}

.gallery-empty {
    grid-column: 1 / -1;
    padding: 35px;
    color: #6e6e73;
    text-align: center;
}

.photo-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 65px 70px 25px;
    box-sizing: border-box;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: rgba(0, 0, 0, .94);
}

.photo-lightbox[hidden],
.gallery-load-more[hidden] {
    display: none !important;
}

body.lightbox-open {
    overflow: hidden;
}

.lightbox-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-height: 100%;
    min-width: 0;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 65vh;
    object-fit: contain;
    flex: 0 0 auto;
}

.lightbox-title {
    margin-top: 12px;
    color: #fff;
    font-size: 13px;
    text-align: center;
}

.lightbox-close,
.lightbox-nav {
    position: absolute;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .15);
    color: #fff;
    cursor: pointer;
}

.lightbox-close {
    top: 20px;
    right: 22px;
    width: 44px;
    height: 44px;
    font-size: 30px;
}

.lightbox-nav {
    position: fixed;
    top: 50%;
    width: 48px;
    height: 48px;
    font-size: 34px;
    transform: translateY(-50%);
}

.lightbox-previous {
    left: 16px;
}

.lightbox-next {
    right: 16px;
}

.lightbox-nav:disabled {
    opacity: .25;
    cursor: default;
}

@media (max-width: 800px) {
    .gallery-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .gallery-photo {
        border-radius: 11px;
    }
}

@media (max-width: 520px) {
    .gallery-section {
        padding: 0 12px;
    }

    .gallery-heading {
        align-items: start;
        flex-direction: column;
        gap: 5px;
        margin-top: 40px;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .photo-lightbox {
        padding: 60px 42px 20px;
    }

    .lightbox-content img {
        max-height: 48vh;
    }

    .lightbox-nav {
        width: 36px;
        height: 36px;
        font-size: 27px;
    }

    .lightbox-previous {
        left: 4px;
    }

    .lightbox-next {
        right: 4px;
    }
}

/* Bewertungs- und Kommentaranzeigen auf Vorschaubildern */

.gallery-rating,
.gallery-comments {
    position: absolute;
    bottom: 9px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 8px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    pointer-events: none;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.gallery-rating {
    left: 9px;
}

.gallery-comments {
    right: 9px;
}

/* Foto-Bewertungen und Kommentare */
.photo-social {
    width: min(100%, 680px);
    margin: 18px auto 0;
    padding: 18px;
    box-sizing: border-box;
    border-radius: 18px;
    background: rgba(255,255,255,.97);
    color: #1d1d1f;
    text-align: left;
}

.photo-social-heading {
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: 700;
}

.photo-rating-panel {
    padding-bottom: 17px;
    border-bottom: 1px solid #e8e8ed;
}

.photo-rating-stars {
    display: flex;
    gap: 8px;
    align-items: center;
}

.rating-star {
    padding: 0;
    border: 0;
    background: transparent;
    color: #c8c8ce;
    font-size: 36px;
    line-height: 1.2;
    cursor: pointer;
    transition: color .15s, transform .15s;
}

.rating-star.selected {
    color: #f5a623;
}

.rating-star:active {
    transform: scale(1.15);
}

.photo-rating-info,
.photo-comment-status {
    margin-top: 7px;
    color: #6e6e73;
    font-size: 12px;
}

.photo-comments-panel {
    padding-top: 17px;
}

.photo-comments-list {
    display: grid;
    gap: 10px;
    max-height: 230px;
    overflow-y: auto;
}

.photo-comment {
    padding: 11px 13px;
    border-radius: 12px;
    background: #f5f5f7;
}

.photo-comment-meta {
    margin-bottom: 5px;
    color: #777780;
    font-size: 11px;
}

.photo-comment-text {
    margin: 0;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    font-size: 14px;
}

.photo-comments-empty {
    margin: 4px 0 12px;
    color: #777780;
    font-size: 13px;
}

.photo-comment-form {
    display: grid;
    gap: 9px;
    margin-top: 13px;
}

.photo-comment-form textarea {
    width: 100%;
    box-sizing: border-box;
    resize: vertical;
    padding: 12px;
    border: 1px solid #d7d7dc;
    border-radius: 12px;
    font: inherit;
    font-size: 14px;
}

.photo-comment-form button {
    justify-self: end;
    padding: 11px 17px;
    border: 0;
    border-radius: 22px;
    background: #007aff;
    color: white;
    font-weight: 650;
    cursor: pointer;
}

.photo-comment-form button:disabled {
    opacity: .55;
    cursor: wait;
}

@media (max-width: 600px) {
    .photo-social {
        padding: 14px;
        border-radius: 14px;
    }

    .rating-star {
        font-size: 34px;
    }

    .photo-comments-list {
        max-height: 190px;
    }
}

/* Namenseingabe für Fotokommentare */
.photo-comment-form input[type="text"] {
    width: 100%;
    box-sizing: border-box;
    padding: 12px;
    border: 1px solid #d7d7dc;
    border-radius: 12px;
    background: #fff;
    color: #1d1d1f;
    font: inherit;
    font-size: 14px;
}

.photo-comment-form input[type="text"]:focus,
.photo-comment-form textarea:focus {
    outline: none;
    border-color: #007aff;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, .12);
}


/* Hervorhebung neu hochgeladener Fotos */
.gallery-photo.new-photo-highlight {
    outline: 3px solid var(--spark-color, #FFD700);
    outline-offset: 2px;
    animation: new-photo-glow 1.8s ease-out;
}

.spark-burst {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: block;
    pointer-events: none;
    overflow: hidden;
}

.spark-particle {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 7px;
    height: 7px;
    margin: -3.5px;
    border-radius: 50%;
    background: var(--spark-color, #FFD700);
    box-shadow: 0 0 8px var(--spark-color, #FFD700);
    opacity: 0;
    animation: photo-spark 850ms ease-out forwards;
}

@keyframes photo-spark {
    0% {
        opacity: 0;
        transform: rotate(var(--spark-angle)) translateY(0) scale(.4);
    }
    20% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: rotate(var(--spark-angle)) translateY(-65px) scale(0);
    }
}

@keyframes new-photo-glow {
    0%, 100% {
        box-shadow: 0 0 0 0 transparent;
    }
    25%, 65% {
        box-shadow: 0 0 18px 5px var(--spark-color, #FFD700);
    }
}

@media (prefers-reduced-motion: reduce) {
    .gallery-photo.new-photo-highlight {
        animation: none;
    }

    .spark-particle {
        animation: none;
        opacity: 1;
        transform: rotate(var(--spark-angle)) translateY(-45px);
    }
}


/* Horizontales Wischen in der Foto-Lightbox ermöglichen */
#lightboxImage {
    touch-action: pan-y;
}
