/* ===========================================
   Hochzeitsgalerie - Stylesheet
   Farben: Weiß, Olivgrün, Gold
   =========================================== */

:root {
    --white: #ffffff;
    --olive: #556B2F;
    --olive-light: #6B8E23;
    --olive-dark: #3d4f22;
    --gold: #D4AF37;
    --gold-light: #F0D77B;
    --gray: #f5f5f5;
    --text: #333333;
    --text-light: #666666;
}

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

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    background-color: var(--white);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* Gold Line Dekoration */
.gold-line {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    margin: 20px 0;
}

/* ===========================================
   Login Seite
   =========================================== */

.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, var(--white) 0%, var(--gray) 100%);
}

.login-box {
    background: var(--white);
    padding: 50px 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 400px;
    width: 100%;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.login-box h1 {
    color: var(--olive);
    font-size: 2rem;
    margin-bottom: 10px;
    font-weight: 300;
    letter-spacing: 2px;
}

.login-box p {
    color: var(--text-light);
    margin-bottom: 30px;
}

.login-box input[type="password"] {
    width: 100%;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    margin-bottom: 20px;
    transition: border-color 0.3s;
}

.login-box input[type="password"]:focus {
    border-color: var(--olive);
    outline: none;
}

.login-box button {
    width: 100%;
    padding: 15px;
    background: var(--olive);
    color: var(--white);
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
    letter-spacing: 1px;
}

.login-box button:hover {
    background: var(--olive-light);
}

.error {
    background: #ffe6e6;
    color: #c00;
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 20px;
}

/* ===========================================
   Header
   =========================================== */

header {
    background: var(--white);
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    color: var(--olive);
    font-weight: 300;
    letter-spacing: 3px;
    font-size: 1.5rem;
}

.logout-btn {
    color: var(--text-light);
    text-decoration: none;
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 5px;
    transition: all 0.3s;
    font-size: 14px;
}

.logout-btn:hover {
    border-color: var(--olive);
    color: var(--olive);
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.download-all-btn {
    color: var(--white);
    background: var(--olive);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 5px;
    transition: all 0.3s;
    font-size: 14px;
}

.download-all-btn:hover {
    background: var(--olive-light);
}

/* Paar-Namen */
.couple-names {
    color: var(--gold);
    font-size: 1.8rem;
    font-weight: 300;
    letter-spacing: 3px;
    margin-bottom: 5px;
}

.login-box .couple-names {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.header-title {
    text-align: left;
}

.header-title .couple-names {
    font-size: 1rem;
    margin-bottom: 2px;
}

/* Galerie Info (Bildanzahl) */
.gallery-info {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    color: var(--text-light);
    font-size: 14px;
}

.gallery-info .image-count,
.gallery-info .folder-count {
    display: flex;
    align-items: center;
    gap: 5px;
}

.gallery-info .image-count::before {
    content: "📷";
}

.gallery-info .folder-count::before {
    content: "📁";
}

/* ===========================================
   Breadcrumb Navigation
   =========================================== */

.breadcrumb {
    max-width: 1400px;
    margin: 20px auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--olive);
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumb a:hover {
    color: var(--gold);
}

.breadcrumb span {
    color: var(--text-light);
}

/* ===========================================
   Galerie
   =========================================== */

main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.gallery-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    background: var(--gray);
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Ordner */
.gallery-item.folder {
    text-decoration: none;
    color: var(--text);
    display: block;
    cursor: pointer;
}

.gallery-item.folder::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    pointer-events: none;
    transition: background 0.3s;
}

.gallery-item.folder:hover::after {
    background: rgba(0, 0, 0, 0.25);
}

.folder-name {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    color: var(--white);
    font-size: 1.3rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-align: center;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    padding: 15px 25px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    background: rgba(0, 0, 0, 0.2);
}

.no-cover {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--olive) 0%, var(--olive-dark) 100%);
}

/* Bilder */
.gallery-item.image {
    cursor: pointer;
}

.download-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    background: var(--olive);
    color: var(--white);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 18px;
    opacity: 0;
    transition: opacity 0.3s, background 0.3s;
    z-index: 10;
    cursor: pointer;
}

.gallery-item:hover .download-btn {
    opacity: 1;
}

.download-btn:hover {
    background: var(--olive-light);
}

/* Leere Galerie */
.empty-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-message code {
    background: var(--gray);
    padding: 2px 8px;
    border-radius: 3px;
    font-family: monospace;
}

/* ===========================================
   Lightbox
   =========================================== */

.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 85%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

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

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: none;
    border: none;
    color: var(--white);
    font-size: 40px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s;
    z-index: 1001;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    opacity: 1;
}

.lightbox-close {
    top: 20px;
    right: 20px;
}

.lightbox-prev {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-download-btn {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 30px;
    background: var(--olive);
    color: var(--white);
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.3s;
}

.lightbox-download-btn:hover {
    background: var(--olive-light);
}

/* ===========================================
   Responsive Design
   =========================================== */

@media (max-width: 768px) {
    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }

    .login-box {
        padding: 30px 20px;
    }

    .login-box h1 {
        font-size: 1.5rem;
    }

    header h1 {
        font-size: 1.2rem;
    }

    .lightbox-prev,
    .lightbox-next {
        font-size: 30px;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .download-btn {
        opacity: 1;
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    main {
        padding: 10px;
    }

    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}

/* ===========================================
   Download Modal
   =========================================== */

.download-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.download-modal.active {
    display: flex;
}

.download-modal-content {
    background: var(--white);
    padding: 40px;
    border-radius: 10px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.download-modal-content h3 {
    color: var(--olive);
    margin-bottom: 10px;
    font-weight: 400;
}

.download-modal-content p {
    color: var(--text-light);
    margin-bottom: 25px;
    font-size: 14px;
}

.download-modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
}

.download-modal-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
}

.download-modal-btn.web {
    background: var(--olive);
    color: var(--white);
}

.download-modal-btn.web:hover {
    background: var(--olive-light);
}

.download-modal-btn.org {
    background: var(--olive-dark);
    color: var(--white);
}

.download-modal-btn.org:hover {
    background: var(--olive);
}

.download-modal-cancel {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 14px;
    text-decoration: underline;
}

.download-modal-cancel:hover {
    color: var(--text);
}

/* ===========================================
   Fotos3 Sektion (Fotobox)
   =========================================== */

.section-divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    margin: 50px 0 30px;
}

.section-title {
    color: var(--olive);
    font-size: 1.5rem;
    font-weight: 300;
    letter-spacing: 3px;
    text-align: center;
    margin-bottom: 30px;
}

.fotos3-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.fotos3-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    text-decoration: none;
    display: block;
    background: var(--gray);
}

.fotos3-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

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

/* ===========================================
   Fotos3 Detailansicht (fotos3-view.php)
   =========================================== */

.fotos3-view {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.fotos3-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--olive);
    text-decoration: none;
    margin-bottom: 30px;
    font-size: 14px;
    transition: color 0.3s;
}

.fotos3-back:hover {
    color: var(--gold);
}

.fotos3-preview-wrapper {
    text-align: center;
    margin-bottom: 40px;
}

.fotos3-preview {
    position: relative;
    display: inline-block;
    border-radius: 8px;
    overflow: visible;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.fotos3-clickable {
    cursor: pointer;
}

.fotos3-preview img {
    max-width: 312px;
    max-height: 225px;
    object-fit: contain;
    display: block;
}

.fotos3-preview-download {
    position: absolute;
    bottom: 15px;
    right: -60px;
    width: 50px;
    height: 50px;
    background: var(--olive);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 20px;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.fotos3-preview-download:hover {
    background: var(--olive-light);
    transform: scale(1.1);
}

.fotos3-images {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.fotos3-single {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-width: 80%;
}

.fotos3-single img {
    width: 100%;
    height: auto;
    display: block;
}

.fotos3-single-download {
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 50px;
    height: 50px;
    background: var(--olive);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 20px;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.fotos3-single-download:hover {
    background: var(--olive-light);
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .fotos3-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }

    .fotos3-preview img {
        max-width: 180px;
    }

    .fotos3-single-download {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
}
