﻿@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --bg: #0d0f14;
    --surface: #151923;
    --surface-soft: #1b2130;
    --text: #f3f6ff;
    --muted: #9ca6bf;
    --border: #2a3144;
    --accent: #ff2f6d;
    --accent-2: #ff7a18;
    --accent-3: #ffd34d;
    --shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
    --ok: #4dd58a;
    --ring: 0 0 0 3px rgba(255, 47, 109, 0.25);
}

* { box-sizing: border-box; }

/* Modern scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: #ff5c93 #151a25;
}

*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-track {
    background: #151a25;
    border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #ff2f6d, #ff7a18);
    border-radius: 999px;
    border: 2px solid #151a25;
}

*::-webkit-scrollbar-thumb:hover {
    filter: brightness(1.08);
}

body {
    margin: 0;
    font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
    color: var(--text);
    background:
        radial-gradient(900px 300px at -10% -25%, rgba(255, 209, 93, 0.14), transparent 58%),
        radial-gradient(800px 280px at 110% -20%, rgba(255, 86, 132, 0.12), transparent 56%),
        var(--bg);
}

a {
    color: #ff80ac;
    text-decoration: none;
    font-weight: 600;
}

a:hover { text-decoration: underline; }

.layout {
    width: min(1020px, 94vw);
    margin: 0 auto;
    padding: 1.2rem 0 2.2rem;
}

.hero,
.upload-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: var(--shadow);
}

.hero {
    padding: 1.2rem;
    position: relative;
    overflow: hidden;
}

.hero > .invite-btn {
    position: absolute;
    right: 1rem;
    top: 1rem;
    z-index: 2;
    border-radius: 999px;
    padding: 0.55rem 0.9rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    border: 1px solid rgba(255, 255, 255, 0.16);
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(255, 79, 109, 0.25);
}

.hero::before {
    content: '';
    position: absolute;
    inset: -1px;
    background: linear-gradient(120deg, rgba(255, 47, 109, 0.28), rgba(255, 122, 24, 0.24), rgba(255, 211, 77, 0.2));
    z-index: 0;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    padding: 1px;
    pointer-events: none;
}

.hero > * {
    position: relative;
    z-index: 1;
}

.upload-card {
    margin-top: 1rem;
    padding: 1rem;
}

.eyebrow {
    margin: 0;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.76rem;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

h1,
h2 {
    margin: 0.46rem 0 0.65rem;
    line-height: 1.18;
}

.subtitle {
    margin: 0;
    color: var(--muted);
}

.event-chip {
    margin: 0.9rem 0 0;
    display: inline-block;
    padding: 0.48rem 0.78rem;
    border-radius: 999px;
    border: 1px solid #50354b;
    background: linear-gradient(90deg, #2a1e2b, #302127 55%, #312b1f);
    font-weight: 600;
}

.hero-links {
    margin-top: 0.8rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
}

.guest-row {
    margin-top: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.guest-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.34rem 0.7rem;
    border: 1px solid #4b5368;
    background: #121825;
    color: #d9e0f1;
    font-size: 0.86rem;
    font-weight: 600;
}

.guest-change-btn {
    padding: 0.42rem 0.8rem;
    font-size: 0.86rem;
}

.app-footer {
    margin-top: 1.15rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.invite-card {
    display: grid;
    justify-items: center;
    gap: 0.75rem;
    text-align: center;
}

.invite-qr {
    width: min(420px, 86vw);
    border-radius: 14px;
    background: #fff;
    padding: 8px;
}

.upload-hidden { display: none; }

.upload-overlay {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    background: rgba(7, 10, 16, 0.72);
    backdrop-filter: blur(2px);
}

.upload-overlay-card {
    min-width: min(320px, 84vw);
    padding: 1rem 1.1rem;
    border-radius: 16px;
    border: 1px solid #2f3850;
    background: #111827;
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.45);
    text-align: center;
}

.upload-overlay-card p {
    margin: 0.6rem 0 0;
    font-weight: 700;
    color: #e8ecf9;
}

.spinner {
    width: 34px;
    height: 34px;
    margin: 0 auto;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.18);
    border-top-color: #ff5f95;
    animation: spin 0.8s linear infinite;
}

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

button {
    border-radius: 999px;
    border: 0;
    padding: 0.66rem 1.15rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    box-shadow: 0 10px 24px rgba(255, 79, 109, 0.25);
}

button:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

button:focus-visible,
#imageInput:focus-visible,
.author:focus,
.comment:focus {
    outline: none;
    box-shadow: var(--ring);
}

.ghost {
    background: #1a2130;
    color: #ff8cb1;
    border: 1px solid #5b3f56;
    box-shadow: none;
}

#imageInput {
    max-width: 460px;
    font: inherit;
    color: var(--text);
}

#imageInput::file-selector-button {
    border: none;
    border-radius: 999px;
    padding: 0.62rem 1rem;
    margin-right: 0.6rem;
    font-weight: 700;
    cursor: pointer;
    color: #ffd9e7;
    background: linear-gradient(90deg, #4f2940, #583323);
}

.message {
    min-height: 1.1rem;
    margin: 0.66rem 0 0;
    color: var(--ok);
    font-weight: 600;
}

.gallery-head {
    margin-top: 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hint {
    color: var(--muted);
    font-size: 0.9rem;
}

.filter-panel {
    margin: 0.65rem 0 0.8rem;
    padding: 0.85rem;
    border: 1px solid #2d3448;
    border-radius: 14px;
    background: #111724;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.6rem;
}

.filter-item {
    display: grid;
    gap: 0.3rem;
    font-size: 0.82rem;
    color: #a6b0c8;
}

.filter-item input,
.filter-item select {
    width: 100%;
    border: 1px solid #333c52;
    background: #0f1420;
    color: var(--text);
    border-radius: 12px;
    padding: 0.5rem 0.6rem;
    font: inherit;
}

.filter-actions {
    margin-top: 0.7rem;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

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

.photo-card {
    background: var(--surface);
    border-radius: 5px;
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.photo-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.4);
}

.photo-open {
    display: block;
    width: 100%;
    border: 0;
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
}

.photo-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: #090b10;
}

.photo-content { padding: 0.55rem 0.55rem 0.65rem; }
.date {
    margin: 0;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 500;
}

.meta {
    margin: 0.46rem 0 0;
    color: #d4daea;
    font-size: 0.88rem;
}

.like-btn {
    background: #201827;
    color: #ff78a4;
    border: 1px solid #5d3447;
    box-shadow: none;
    padding: 0.45rem 0.8rem;
}

.like-btn.liked {
    background: linear-gradient(90deg, #3b1f2f, #402820);
    border-color: #a14c6d;
}

.comment-form {
    margin-top: 0.7rem;
    display: grid;
    gap: 0.44rem;
}

.author,
.comment {
    width: 100%;
    border: 1px solid #333c52;
    background: #111624;
    color: var(--text);
    border-radius: 12px;
    padding: 0.54rem 0.66rem;
    font: inherit;
    resize: vertical;
}

.author[readonly] {
    opacity: 0.92;
}

.comments {
    margin-top: 0.58rem;
    display: grid;
    gap: 0.45rem;
    max-height: 220px;
    overflow: auto;
}

.comment-item {
    background: var(--surface-soft);
    border: 1px solid #333b50;
    border-radius: 12px;
    padding: 0.5rem 0.58rem;
    font-size: 0.92rem;
}

.comment-meta {
    color: #98a3bd;
    font-size: 0.78rem;
    margin-bottom: 0.14rem;
}

.empty {
    background: var(--surface);
    border: 1px dashed #5a3d50;
    border-radius: 14px;
    padding: 1rem;
    color: var(--muted);
    text-align: center;
    grid-column: 1 / -1;
}

.upload-tile-card {
    border: 1px dashed #5a3d50;
}

.upload-tile-btn {
    width: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.35rem;
    background: linear-gradient(140deg, #1f2636, #1a1f2d);
    color: #f6f7fd;
    box-shadow: none;
    border-radius: 12px;
}

.upload-plus {
    font-size: 2rem;
    line-height: 1;
    font-weight: 500;
}

.upload-label {
    font-size: 0.75rem;
    color: #bcc4da;
}

.lightbox {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 20;
}

.lightbox.open { display: block; }

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(6, 8, 14, 0.86);
}

.lightbox-card {
    position: relative;
    width: min(980px, 94vw);
    max-height: 92vh;
    overflow: hidden;
    margin: 3vh auto;
    background: var(--surface);
    border-radius: 18px;
    border: 1px solid #2c3449;
    box-shadow: 0 20px 44px rgba(0, 0, 0, 0.55);
    transform: translate3d(0, 0, 0);
    transition: transform 0.32s cubic-bezier(.2, .82, .26, 1);
    will-change: transform;
}

.lightbox-card.no-feed-transition {
    transition: none !important;
}

.lightbox-card.is-feed-swipe-up {
    transform: translate3d(0, -112vh, 0);
}

.lightbox-card.is-feed-swipe-down {
    transform: translate3d(0, 112vh, 0);
}

.lightbox-card.is-feed-enter-from-bottom {
    transform: translate3d(0, 112vh, 0);
}

.lightbox-card.is-feed-enter-from-top {
    transform: translate3d(0, -112vh, 0);
}

.lightbox-media-wrap {
    position: relative;
    overflow: hidden;
}

.side-actions {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    gap: 0.45rem;
    z-index: 3;
}

.side-btn {
    min-width: 66px;
    justify-content: center;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
    background: rgba(15, 18, 29, 0.85);
    color: #f3f6ff;
    border: 1px solid #3a425a;
    box-shadow: none;
    text-decoration: none;
    padding: 0.5rem 0.7rem;
}

.side-icon {
    width: 1.35rem;
    height: 1.35rem;
    flex: 0 0 auto;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 1.45rem;
    line-height: 1;
    padding: 0;
    z-index: 2;
    box-shadow: none;
    background: rgba(21, 25, 35, 0.95);
    color: #f1f4ff;
}

.lightbox-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
    background: #080a0f;
}

.lightbox-body { padding: 0.95rem; }

.lightbox-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.7rem;
}

.lightbox-name {
    text-align: center;
    opacity: 0.92;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 0.4rem;
}

.comments-sheet {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: #121826;
    border-top: 1px solid #2c3449;
    border-radius: 16px 16px 0 0;
    padding: 0.8rem 0.85rem 0.95rem;
    transform: translateY(102%);
    transition: transform 0.24s ease;
    z-index: 5;
    max-height: 58vh;
    overflow: auto;
}

.comments-sheet.open {
    transform: translateY(0);
}

.sheet-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
}

.sheet-head h3 {
    margin: 0;
    font-size: 1rem;
}

.modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 40;
}

.modal.open {
    display: grid;
    place-items: center;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 7, 12, 0.8);
}

.modal-card {
    position: relative;
    z-index: 1;
    width: min(520px, 92vw);
    border-radius: 18px;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: 0 24px 52px rgba(0, 0, 0, 0.58);
    padding: 1rem;
}

@media (max-width: 680px) {
    .hero-links { gap: 0.6rem; }
    .side-actions {
        right: 8px;
        gap: 0.35rem;
    }
    .side-btn {
        min-width: 58px;
        font-size: 0.85rem;
        padding: 0.45rem 0.58rem;
    }
}
