/* ============================================
   Hochzeitsalbum - Styling
   ============================================ */

:root {
    --color-primary: #b98a6f;
    --color-primary-dark: #9c6f56;
    --color-bg: #fdfaf7;
    --color-card: #ffffff;
    --color-text: #3a332f;
    --color-text-light: #7a7169;
    --color-border: #e8e0d9;
    --color-success: #4a7c59;
    --color-error: #b94a48;
    --radius: 14px;
    --shadow: 0 4px 20px rgba(0,0,0,0.06);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Georgia', 'Times New Roman', serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
}

h1, h2, h3 {
    font-family: 'Georgia', serif;
    font-weight: 400;
    color: var(--color-primary-dark);
}

a { color: var(--color-primary-dark); }

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.site-header {
    background: var(--color-card);
    border-bottom: 1px solid var(--color-border);
    padding: 20px 0;
    text-align: center;
    position: relative;
}

.owner-back-link {
    position: absolute;
    top: 16px;
    left: 20px;
    color: var(--color-text-light);
    text-decoration: none;
    font-size: 0.85rem;
    opacity: 0.75;
    transition: opacity 0.15s ease;
}

.owner-back-link:hover {
    opacity: 1;
    color: var(--color-primary-dark);
}

.site-header h1 {
    margin: 0;
    font-size: 1.8rem;
}

.site-header .subtitle {
    color: var(--color-text-light);
    font-size: 0.95rem;
    margin-top: 4px;
}

/* Buttons */
.btn {
    display: inline-block;
    background: var(--color-primary);
    color: white !important;
    padding: 14px 28px;
    border-radius: 50px;
    text-decoration: none;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    font-family: inherit;
}

.btn:hover { background: var(--color-primary-dark); }
.btn:active { transform: scale(0.98); }

.btn-secondary {
    background: transparent;
    color: var(--color-primary-dark) !important;
    border: 2px solid var(--color-primary);
}

.btn-secondary:hover { background: var(--color-primary); color: white !important; }

.btn-small {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-danger {
    background: var(--color-error);
}
.btn-danger:hover { background: #8f3735; }

.btn-block { display: block; width: 100%; text-align: center; }

/* Cards */
.card {
    background: var(--color-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px;
    margin-bottom: 24px;
}

/* Forms */
form label {
    display: block;
    margin-top: 16px;
    margin-bottom: 6px;
    font-weight: bold;
    font-size: 0.9rem;
    color: var(--color-text);
}

form input[type="text"],
form input[type="password"],
form input[type="email"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
}

form input:focus {
    outline: none;
    border-color: var(--color-primary);
}

/* Alerts */
.alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin: 16px 0;
    font-size: 0.95rem;
}

.alert ul { margin: 0; padding-left: 20px; }

.alert-success { background: #e6f4ea; color: var(--color-success); border: 1px solid #b8dcc2; }
.alert-error { background: #fbe9e8; color: var(--color-error); border: 1px solid #eec2c0; }
.alert-info { background: #eef3fb; color: #3b5f8a; border: 1px solid #c6d7ee; }

/* Setup page */
.setup-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.setup-container {
    background: var(--color-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 40px;
    max-width: 480px;
    width: 90%;
}

.setup-container h1 {
    text-align: center;
    margin-bottom: 24px;
}

.hint { color: var(--color-text-light); font-size: 0.85rem; }

/* Installer Schritt-Anzeige */
.setup-steps {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
}

.setup-steps span {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--color-border);
    color: var(--color-text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: bold;
    transition: background 0.2s ease, color 0.2s ease;
}

.setup-steps span.active {
    background: var(--color-primary);
    color: white;
}

.setup-steps span.done {
    background: var(--color-success);
    color: white;
}

/* Hero / Landing */
.hero {
    text-align: center;
    padding: 60px 20px;
}

.hero h1 {
    font-size: 2.4rem;
    margin-bottom: 12px;
}

.hero p {
    color: var(--color-text-light);
    font-size: 1.1rem;
    max-width: 500px;
    margin: 0 auto 30px;
}

.qr-box {
    background: white;
    display: inline-block;
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin: 20px 0;
}

.qr-box img { display: block; max-width: 260px; width: 100%; height: auto; }

/* Upload page */
.upload-dropzone {
    border: 3px dashed var(--color-border);
    border-radius: var(--radius);
    padding: 50px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
    background: var(--color-card);
}

.upload-dropzone.dragover {
    border-color: var(--color-primary);
    background: #fbf3ee;
}

.upload-dropzone .icon { font-size: 3rem; margin-bottom: 10px; }

#file-input { display: none; }

.file-preview-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 20px;
}

.file-preview-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
    background: #eee;
}

.file-preview-item img,
.file-preview-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-preview-item .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    cursor: pointer;
    font-size: 0.8rem;
    line-height: 1;
}

.progress-bar {
    height: 8px;
    background: var(--color-border);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-bar-fill {
    height: 100%;
    background: var(--color-primary);
    width: 0%;
    transition: width 0.2s ease;
}

/* Sichtbarer Upload-Status mit Spinner */
.upload-status {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fbf3ee;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-top: 20px;
}

.upload-status > div { flex: 1; }

.spinner {
    width: 36px;
    height: 36px;
    border: 4px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

.spinner-small {
    width: 22px;
    height: 22px;
    border-width: 3px;
}

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

/* Status-Overlay auf einzelnen Datei-Vorschauen während/nach Upload */
.file-state-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.45);
    font-size: 1.4rem;
    color: white;
    font-weight: bold;
}

.file-state-overlay.file-state-done {
    background: rgba(74, 124, 89, 0.75);
}

.file-state-overlay.file-state-error {
    background: rgba(185, 74, 72, 0.75);
}

/* Gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.gallery-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 1;
    background: #eee;
    cursor: pointer;
}

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

.gallery-item .video-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0,0,0,0.6);
    color: white;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.gallery-item .uploader-tag {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: white;
    font-size: 0.75rem;
    padding: 16px 8px 6px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-light);
}

.empty-state .icon { font-size: 3rem; margin-bottom: 10px; }

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.lightbox.active { display: flex; }

.lightbox img,
.lightbox video {
    max-width: 92vw;
    max-height: 85vh;
    border-radius: 6px;
}

.lightbox-close,
.lightbox-nav {
    position: absolute;
    background: rgba(255,255,255,0.15);
    color: white;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* Navbar (admin) */
.admin-nav {
    background: var(--color-card);
    border-bottom: 1px solid var(--color-border);
    padding: 14px 0;
}

.admin-nav .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.admin-nav-links a {
    margin-left: 16px;
    text-decoration: none;
    font-size: 0.9rem;
    color: var(--color-text);
}

.admin-nav-links a:hover { color: var(--color-primary-dark); }

/* Stats */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-box {
    background: var(--color-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    text-align: center;
}

.stat-box .number {
    font-size: 2rem;
    color: var(--color-primary-dark);
    font-weight: bold;
}

.stat-box .label {
    color: var(--color-text-light);
    font-size: 0.85rem;
}

/* Table */
table {
    width: 100%;
    border-collapse: collapse;
}

table th, table td {
    text-align: left;
    padding: 10px;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.9rem;
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 30px 20px;
    color: var(--color-text-light);
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 600px) {
    .hero h1 { font-size: 1.8rem; }
    .setup-container { padding: 28px 20px; }
}

.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mb-0 { margin-bottom: 0; }
.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

/* ============================================
   Live-Diashow (Vollbild)
   ============================================ */
.slideshow-body {
    background: #000;
    margin: 0;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

.slideshow-stage {
    position: fixed;
    inset: 0;
    background: #000;
}

.slideshow-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slideshow-slide.active {
    opacity: 1;
}

.slideshow-slide img,
.slideshow-slide video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.slideshow-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 24px 32px;
    background: linear-gradient(rgba(0,0,0,0.55), transparent);
    color: white;
    z-index: 10;
    pointer-events: none;
}

.slideshow-title {
    font-family: 'Georgia', serif;
    font-size: 1.6rem;
}

.slideshow-uploader {
    margin-top: 6px;
    font-size: 1rem;
    opacity: 0.85;
    min-height: 1.4em;
}

.slideshow-qr {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: white;
    border-radius: 12px;
    padding: 10px;
    text-align: center;
    z-index: 10;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.slideshow-qr img {
    display: block;
    width: 110px;
    height: 110px;
}

.slideshow-qr span {
    display: block;
    font-size: 0.7rem;
    color: var(--color-text);
    margin-top: 4px;
}

.slideshow-empty {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    padding: 20px;
}

.slideshow-empty .icon { font-size: 4rem; margin-bottom: 16px; }
.slideshow-empty h2 { color: white; font-size: 1.8rem; }
.slideshow-empty p { color: rgba(255,255,255,0.75); }

.slideshow-exit {
    position: fixed;
    top: 16px;
    right: 16px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    text-decoration: none;
    z-index: 20;
    transition: background 0.2s ease, color 0.2s ease;
}

.slideshow-exit:hover {
    background: rgba(255,255,255,0.25);
    color: white;
}

/* Album-Übersicht (Multi-User Dashboard) */
.event-card {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.event-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0,0,0,0.09);
}

.event-card h3 { color: var(--color-text); }

.event-card-arrow {
    font-size: 1.4rem;
    color: var(--color-primary);
}

/* ============================================
   Neue Marketing-Landingpage
   ============================================ */
.landing-nav {
    background: var(--color-card);
    border-bottom: 1px solid var(--color-border);
    padding: 16px 0;
}

.landing-brand { font-size: 1.2rem; }

.beta-badge {
    display: inline-block;
    background: var(--color-primary);
    color: white;
    font-size: 0.65rem;
    font-weight: bold;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 50px;
    vertical-align: middle;
    margin-left: 8px;
}

.beta-notice {
    background: #fff8e6;
    border-bottom: 1px solid #f0d98a;
    color: #6b5a1e;
    text-align: center;
    padding: 10px 20px;
    font-size: 0.85rem;
}

.brand-logo {
    max-height: var(--logo-height, 40px);
    max-width: 240px;
    vertical-align: middle;
    display: inline-block;
}

.brand-name {
    vertical-align: middle;
    font-weight: bold;
}

.legal-content {
    line-height: 1.7;
    color: var(--color-text);
}

/* Superadmin Settings-Tabs */
.settings-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 20px 0;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0;
}

.settings-tab {
    padding: 10px 16px;
    text-decoration: none;
    color: var(--color-text-light);
    font-size: 0.9rem;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
}

.settings-tab:hover { color: var(--color-primary-dark); }

.settings-tab.active {
    color: var(--color-primary-dark);
    border-bottom-color: var(--color-primary);
    font-weight: bold;
}

.textarea-field {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.5;
}

.logo-preview {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.logo-preview img {
    max-height: 80px;
    max-width: 100%;
}

/* Statistik-Balkendiagramme (reines CSS, keine Abhängigkeiten) */
.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 160px;
    margin-top: 20px;
    padding: 0 4px;
    overflow-x: auto;
}

.bar-chart-col {
    flex: 1;
    min-width: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
}

.bar-chart-bar {
    width: 100%;
    border-radius: 3px 3px 0 0;
    min-height: 3px;
    transition: opacity 0.15s ease;
}

.bar-chart-col:hover .bar-chart-bar {
    opacity: 0.75;
}

.bar-chart-label {
    font-size: 0.6rem;
    color: var(--color-text-light);
    margin-top: 4px;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    white-space: nowrap;
}

.heatmap-canvas-wrapper {
    display: flex;
    justify-content: center;
}

#heatmap-canvas {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--color-border);
    border-radius: 8px;
}

.breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.breakdown-row {
    display: grid;
    grid-template-columns: 140px 1fr 120px;
    align-items: center;
    gap: 12px;
}

.breakdown-label {
    font-size: 0.9rem;
    color: var(--color-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.breakdown-bar-track {
    background: #f0e8e0;
    border-radius: 6px;
    height: 10px;
    overflow: hidden;
}

.breakdown-bar-fill {
    background: var(--color-primary);
    height: 100%;
    border-radius: 6px;
}

.breakdown-value {
    font-size: 0.85rem;
    color: var(--color-text-light);
    text-align: right;
    white-space: nowrap;
}

@media (max-width: 600px) {
    .breakdown-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    .breakdown-value {
        text-align: left;
    }
}

/* Cookie-Hinweis-Banner */
.cookie-notice {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--color-text);
    color: white;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 0.85rem;
    z-index: 100;
}

.cookie-notice button {
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* HEIC-Foto-Platzhalter (iPhone-Fotos, die die meisten Browser nicht
   direkt anzeigen können) */
.heic-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f0e9e2;
    gap: 6px;
    text-align: center;
    padding: 10px;
}

.heic-icon { font-size: 1.8rem; }

.heic-label {
    font-size: 0.7rem;
    color: var(--color-text-light);
    line-height: 1.3;
}

.heic-lightbox {
    background: white;
    border-radius: var(--radius);
    padding: 40px 30px;
    text-align: center;
    max-width: 400px;
}

.heic-lightbox .heic-icon { font-size: 3rem; margin-bottom: 16px; }
.heic-lightbox p { color: var(--color-text); margin-bottom: 20px; }

/* Mehrfachauswahl im Admin-Dashboard */
.bulk-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.item-checkbox {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 5;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.item-quick-delete {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 5;
}

.landing-nav-link {
    margin-right: 16px;
    text-decoration: none;
    color: var(--color-text);
    font-size: 0.95rem;
}

.landing-hero {
    text-align: center;
    padding: 70px 20px 50px;
}

.landing-hero h1 {
    font-size: 2.2rem;
    max-width: 700px;
    margin: 0 auto 20px;
    line-height: 1.3;
}

.landing-hero-subtext {
    color: var(--color-text-light);
    font-size: 1.1rem;
    max-width: 560px;
    margin: 0 auto 28px;
}

.landing-steps {
    background: var(--color-card);
    padding: 60px 20px;
}

.landing-steps h2 { margin-bottom: 40px; }

.steps-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 28px;
    max-width: 900px;
    margin: 0 auto;
}

.step-card { text-align: center; }

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin: 0 auto 14px;
}

.step-card h3 { margin: 0 0 8px; font-size: 1.1rem; }
.step-card p { color: var(--color-text-light); font-size: 0.92rem; }

.landing-features {
    padding: 60px 20px;
}

.landing-features h2 { margin-bottom: 40px; }

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.feature-card {
    background: var(--color-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 26px 22px;
}

.feature-icon { font-size: 1.8rem; margin-bottom: 10px; }
.feature-card h3 { margin: 0 0 8px; font-size: 1.05rem; }
.feature-card p { color: var(--color-text-light); font-size: 0.92rem; margin: 0; }

.landing-pricing {
    background: var(--color-card);
    padding: 60px 20px;
}

.landing-pricing h2 { margin-bottom: 40px; }

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    max-width: 700px;
    margin: 0 auto;
}

.pricing-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 30px 26px;
    text-align: center;
}

.pricing-card-highlight {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

.pricing-card-highlight h3,
.pricing-card-highlight .hint { color: white; }

.pricing-price {
    font-size: 2rem;
    font-weight: bold;
    margin: 6px 0;
}

.pricing-list {
    list-style: none;
    padding: 0;
    margin: 20px 0 0;
    text-align: left;
    font-size: 0.92rem;
}

.pricing-list li { margin-bottom: 10px; }

.landing-cta {
    padding: 60px 20px;
    text-align: center;
}

.landing-cta h2 { margin-bottom: 24px; }
