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

:root {
    --primary: #e91e63;
    --accent: #ff5722;
    --gold: #ff9800;
    --bg-dark: #1a1a2e;
    --bg-medium: #16213e;
    --bg-light: #1e2a47;
    --card-bg: rgba(255, 255, 255, 0.06);
    --card-border: rgba(255, 255, 255, 0.1);
    --text: rgba(255, 255, 255, 0.92);
    --text-muted: rgba(255, 255, 255, 0.55);
    --text-hint: rgba(255, 255, 255, 0.35);
    --white: #fff;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 30px rgba(233, 30, 99, 0.15);
    --radius: 16px;
    --radius-sm: 10px;
}

body {
    font-family: 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(165deg, #1a1a2e 0%, #16213e 40%, #0f3460 100%);
    background-attachment: fixed;
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(233, 30, 99, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(255, 87, 34, 0.06) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ── Header ──────────────────────────────────────────── */
.app-header {
    position: relative;
    z-index: 1;
    padding: 1.5rem 1rem 1.2rem;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
    border-radius: 50%;
}

.header-text {
    flex: 1;
    min-width: 0;
}

.header-title {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #e91e63, #ff5722, #ff9800);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.header-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    line-height: 1.4;
}

/* ── Container ───────────────────────────────────────── */
.container {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 0.8rem 1rem 2rem;
}

/* ── Cards ───────────────────────────────────────────── */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 1.2rem;
    margin-top: 1rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 0.8rem;
}

/* ── Danke-Text ──────────────────────────────────────── */
.welcome-text {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.7;
    padding: 1rem 0;
}

/* ── Kategorie-Buttons ───────────────────────────────── */
.category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 1rem;
}

.category-btn {
    position: relative;
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.25s;
    text-align: center;
    overflow: hidden;
    aspect-ratio: 4/3;
    display: flex;
    align-items: flex-end;
}

.category-btn:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.category-btn-thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s, opacity 0.4s;
}

.category-btn:hover .category-btn-thumb {
    transform: scale(1.05);
}

.category-btn-overlay {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 0.8rem 0.6rem 0.6rem;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 70%, transparent 100%);
}

.category-btn-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 0.15rem;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.category-btn-count {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.7);
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}


/* ── Banner / Carousel ───────────────────────────────── */
.liked-banner {
    margin-top: 1.2rem;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.liked-banner-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 0.8rem 1rem 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.liked-banner-scroll {
    display: flex;
    gap: 8px;
    padding: 0.5rem 1rem 1rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.liked-banner-scroll::-webkit-scrollbar {
    display: none;
}

.liked-banner-item {
    flex-shrink: 0;
    width: 120px;
    height: 90px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s;
}

.liked-banner-item:hover {
    transform: scale(1.05);
}

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

.liked-banner-badge {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(233, 30, 99, 0.85);
    color: var(--white);
    border-radius: 12px;
    padding: 1px 6px;
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 2px;
}

/* ── Galerie ─────────────────────────────────────────── */
.gallery-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-bottom: 0.8rem;
}

.gallery-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--white);
}

.gallery-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.gallery-item {
    position: relative;
    aspect-ratio: 4/3;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
}

.gallery-item:hover {
    transform: scale(1.03);
}

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

.like-badge {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.6);
    color: var(--white);
    border-radius: 20px;
    padding: 2px 8px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 3px;
    backdrop-filter: blur(4px);
}

.like-badge.liked {
    background: rgba(233, 30, 99, 0.8);
}

.select-checkbox {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 2px solid rgba(255, 255, 255, 0.6);
    background: rgba(0, 0, 0, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    backdrop-filter: blur(4px);
    z-index: 2;
}

.select-checkbox.checked {
    background: var(--primary);
    border-color: var(--primary);
}

.select-checkbox.checked::after {
    content: '✓';
    color: white;
    font-size: 14px;
    font-weight: 700;
}

/* ── Buttons ─────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: var(--white);
    box-shadow: 0 4px 16px rgba(233, 30, 99, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(233, 30, 99, 0.4);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.btn-back {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--white);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 1rem 0.45rem 0.7rem;
    margin-bottom: 0.8rem;
    border-radius: 2rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.2s;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

/* ── Modal ───────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.2s;
}

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

.modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    touch-action: pan-y;
    -webkit-user-select: none;
    user-select: none;
}

.modal-image {
    max-width: 100%;
    max-height: 70vh;
    border-radius: var(--radius-sm);
    object-fit: contain;
    pointer-events: none;
    -webkit-user-drag: none;
}

.modal-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.8rem;
    align-items: center;
}

.like-button {
    background: rgba(233, 30, 99, 0.1);
    border: 2px solid rgba(233, 30, 99, 0.3);
    border-radius: 30px;
    padding: 0.6rem 1.5rem;
    color: var(--white);
    font-family: inherit;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    backdrop-filter: blur(4px);
}

.like-button:hover {
    background: rgba(233, 30, 99, 0.2);
    border-color: rgba(233, 30, 99, 0.5);
    transform: scale(1.05);
}

.like-button.liked {
    border-color: var(--primary);
    background: rgba(233, 30, 99, 0.35);
}

.download-button {
    background: rgba(255, 152, 0, 0.15);
    border: 2px solid rgba(255, 152, 0, 0.4);
    border-radius: 30px;
    padding: 0.6rem 1.5rem;
    color: var(--gold);
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    backdrop-filter: blur(4px);
    text-decoration: none;
}

.download-button:hover {
    background: rgba(255, 152, 0, 0.25);
    border-color: rgba(255, 152, 0, 0.6);
    transform: scale(1.05);
}

/* ── Modal Navigation ───────────────────────────────── */
.modal-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.6);
    font-size: 2.5rem;
    line-height: 1;
    width: 44px;
    height: 72px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 101;
}

.modal-nav:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.3);
}

.modal-nav-prev {
    left: 0.6rem;
}

.modal-nav-next {
    right: 0.6rem;
}

.modal-nav.nav-pulse {
    animation: navPulse 1.2s ease-in-out 2;
}

@keyframes navPulse {
    0%   { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.15); color: rgba(255, 255, 255, 0.6); transform: translateY(-50%) scale(1); }
    50%  { background: rgba(233, 30, 99, 0.5); border-color: rgba(233, 30, 99, 0.8); color: #fff; transform: translateY(-50%) scale(1.15); }
    100% { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.15); color: rgba(255, 255, 255, 0.6); transform: translateY(-50%) scale(1); }
}

@media (max-width: 599px) {
    .modal-nav {
        width: 36px;
        height: 56px;
        font-size: 2rem;
        background: rgba(0, 0, 0, 0.3);
        border-color: rgba(255, 255, 255, 0.1);
    }
    .modal-nav-prev { left: 0.3rem; }
    .modal-nav-next { right: 0.3rem; }
}

/* ── Download Dialog ────────────────────────────────── */
.download-dialog {
    background: var(--bg-medium);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    width: 280px;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow);
}

.download-dialog-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--white);
    text-align: center;
    margin-bottom: 0.3rem;
}

.download-dialog-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    color: var(--white);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.download-dialog-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.download-dialog-cancel {
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 0.2rem;
}

/* ── Archiv-Seite ────────────────────────────────────── */
.archive-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-top: 1rem;
}

.archive-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.archive-info {
    flex: 1;
    min-width: 0;
}

.archive-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--white);
}

.archive-size {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.archive-warning {
    background: rgba(255, 152, 0, 0.1);
    border: 1px solid rgba(255, 152, 0, 0.3);
    border-radius: var(--radius-sm);
    padding: 0.8rem 1rem;
    color: var(--gold);
    font-size: 0.85rem;
    margin-top: 1rem;
}

/* ── Loading ─────────────────────────────────────────── */
.loading-spinner {
    display: flex;
    justify-content: center;
    padding: 2rem;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem 0;
    font-size: 0.95rem;
}

/* ── Toast / Notification ────────────────────────────── */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: var(--white);
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 200;
    backdrop-filter: blur(10px);
    animation: toastIn 0.3s ease-out;
    pointer-events: none;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}


/* ── Responsive ──────────────────────────────────────── */
@media (min-width: 600px) {
    .header-logo {
        width: 72px;
        height: 72px;
    }

    .header-title {
        font-size: 2rem;
    }

    .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }

    .card {
        padding: 1.5rem;
    }

    .liked-banner-item {
        width: 150px;
        height: 112px;
    }
}

@media (min-width: 900px) {
    .gallery-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}
