/* ── Reset & základ ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #e91e63;
    --primary-dark: #c2185b;
    --bg: #0f0f1a;
    --surface: #1a1a2e;
    --surface2: #252540;
    --text: #f0f0f0;
    --text-dim: #a0a0b8;
    --gold: #ffd54f;
    --green: #66bb6a;
    --red: #ef5350;
    --radius: 12px;
    --max-w: 540px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-text-size-adjust: 100%;
}

.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 24px 16px 40px;
}

/* ── Nadpisy ─────────────────────────────────────────────────────────────── */
.title {
    text-align: center;
    font-size: 1.6rem;
    color: var(--gold);
    margin-bottom: 4px;
}
.subtitle {
    text-align: center;
    color: var(--text-dim);
    font-size: 0.95rem;
    margin-bottom: 24px;
}

/* ── QR blok ─────────────────────────────────────────────────────────────── */
.qr-block {
    text-align: center;
    margin-bottom: 28px;
}
.qr-img {
    width: 180px;
    height: 180px;
    border-radius: var(--radius);
    background: #fff;
    padding: 8px;
}
.qr-hint {
    color: var(--text-dim);
    font-size: 0.85rem;
    margin-top: 8px;
}

/* ── Upload ──────────────────────────────────────────────────────────────── */
.upload-area { text-align: center; margin-bottom: 20px; }

.btn-upload {
    display: inline-block;
    width: 85%;
    max-width: 360px;
    padding: 18px 24px;
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
    background: var(--primary);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    -webkit-tap-highlight-color: transparent;
}
.btn-upload:active {
    background: var(--primary-dark);
    transform: scale(0.97);
}
.upload-hint {
    color: var(--text-dim);
    font-size: 0.82rem;
    margin-top: 8px;
}

/* ── Progress ────────────────────────────────────────────────────────────── */
.progress-area { margin-bottom: 16px; }

.progress-item {
    background: var(--surface);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 8px;
    font-size: 0.85rem;
    position: relative;
    overflow: hidden;
}
.progress-item .bar {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    background: rgba(233, 30, 99, 0.18);
    transition: width 0.2s ease;
    border-radius: 8px;
}
.progress-item .label {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.progress-item.done     .bar { background: rgba(102, 187, 106, 0.2); }
.progress-item.dup      .bar { background: rgba(255, 213, 79, 0.2); width: 100% !important; }
.progress-item.error    .bar { background: rgba(239, 83, 80, 0.2); width: 100% !important; }

.progress-item .status-icon { font-size: 1rem; }

/* ── Statistiky ──────────────────────────────────────────────────────────── */
.stats {
    text-align: center;
    padding: 12px;
    background: var(--surface);
    border-radius: var(--radius);
    font-size: 0.9rem;
    color: var(--text-dim);
    margin-bottom: 20px;
}
.stats span { font-weight: 700; color: var(--text); margin: 0 2px; }

/* ── Navigace ────────────────────────────────────────────────────────────── */
.nav-links {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
}
.nav-links a {
    display: inline-block;
    padding: 10px 20px;
    background: var(--surface2);
    color: var(--text);
    text-decoration: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
    transition: background 0.2s;
}
.nav-links a:hover { background: var(--surface); }

/* ── Galerie ─────────────────────────────────────────────────────────────── */
.time-heading {
    color: var(--gold);
    font-size: 1rem;
    margin: 20px 0 10px;
    padding-left: 4px;
}
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 6px;
}
.gallery-item {
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 6px;
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.2s;
}
.gallery-item img:hover { transform: scale(1.05); }
.empty-msg {
    text-align: center;
    color: var(--text-dim);
    margin-top: 60px;
}
.empty-msg a { color: var(--primary); }

/* ── Slideshow ───────────────────────────────────────────────────────────── */
.page-slideshow {
    background: #000;
    overflow: hidden;
}

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

.slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 1.2s ease;
}
.slide.active { opacity: 1; }

.slide-overlay {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    padding: 16px 20px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    pointer-events: none;
    z-index: 10;
}
.slide-title {
    color: var(--gold);
    font-size: 1rem;
    font-weight: 600;
    opacity: 0.8;
}
.slide-counter {
    color: rgba(255,255,255,0.6);
    font-size: 0.9rem;
}

.slide-waiting {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    font-size: 1.2rem;
    z-index: 20;
}
.slide-waiting .qr-hint { margin-top: 30px; font-size: 0.9rem; }
.slide-url { color: var(--gold); font-size: 1.1rem; margin-top: 6px; }

.slide-controls {
    position: fixed;
    top: 12px; right: 12px;
    z-index: 30;
    display: flex;
    gap: 8px;
}
.slide-controls button {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.2s;
}
.slide-controls button:hover { background: rgba(255,255,255,0.3); }

.new-badge {
    position: fixed;
    top: 20px; left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: #fff;
    padding: 8px 24px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.95rem;
    z-index: 25;
    animation: fadeInOut 2.5s ease forwards;
}
@keyframes fadeInOut {
    0% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
    15% { opacity: 1; transform: translateX(-50%) translateY(0); }
    75% { opacity: 1; }
    100% { opacity: 0; }
}
