@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=Montserrat:wght@300;400;500;600&display=swap');

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

body {
    font-family: 'Montserrat', sans-serif;
    background: #FAF6F1 url('tlo.png') center/cover fixed no-repeat;
    color: #3a3a3a;
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

body::before {
    content:''; position:fixed; inset:0; z-index:0;
    background:rgba(250,246,241,0.55);
    pointer-events:none;
}

/* ── Corner Decorations ── */
.corner {
    position: fixed;
    pointer-events: none;
    z-index: 0;
}
.corner-tl { top: 0; left: 0; width: 280px; height: 280px; }
.corner-tr { top: 0; right: 0; width: 200px; height: 200px; }
.corner-bl { bottom: 0; left: 0; width: 180px; height: 180px; }
.corner-br { bottom: 0; right: 0; width: 280px; height: 280px; }

.corner svg { width: 100%; height: 100%; }

/* Gold sparkle animation */
@keyframes sparkle {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}
.sparkle { animation: sparkle 3s ease-in-out infinite; }
.sparkle:nth-child(2) { animation-delay: 0.8s; }
.sparkle:nth-child(3) { animation-delay: 1.6s; }
.sparkle:nth-child(4) { animation-delay: 2.4s; }

/* ── Container ── */
.container {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

/* ── Title ── */
.section-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 22px;
    font-weight: 300;
    letter-spacing: 12px;
    text-transform: uppercase;
    color: #b8a07a;
    margin-top: 60px;
    margin-bottom: 0;
}

/* ── Names ── */
.names {
    font-family: 'Playfair Display', serif;
    font-size: 64px;
    font-weight: 400;
    color: #2d2d2d;
    text-align: center;
    margin: 8px 0 0;
    line-height: 1.15;
    letter-spacing: 2px;
}

/* ── Divider ── */
.divider {
    margin: 24px auto 20px;
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #c9b389, transparent);
}

/* ── Thank You ── */
.thanks {
    font-family: 'Montserrat', sans-serif;
    font-weight: 300;
    font-size: 15px;
    color: #5a5a5a;
    text-align: center;
    max-width: 60%;
    line-height: 1.8;
    margin-bottom: 36px;
}
.thanks .heart { color: #c9b389; }

/* ── Upload Panel ── */
.upload-panel {
    width: 70%;
    min-height: 280px;
    background: rgba(255,255,255,0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1.5px solid rgba(201,179,137,0.5);
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    cursor: pointer;
    transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
    position: relative;
}
.upload-panel:hover {
    border-color: rgba(201,179,137,0.9);
    box-shadow: 0 12px 40px rgba(0,0,0,0.09);
}
.upload-panel.drag-over {
    border-color: #c9b389;
    background: rgba(255,255,255,0.9);
    box-shadow: 0 0 0 4px rgba(201,179,137,0.2);
}

.upload-panel input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.cloud-icon { margin-bottom: 8px; color: #c9b389; }
.cloud-icon svg { width: 56px; height: 56px; }

.upload-title {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    color: #3a3a3a;
    margin-bottom: 4px;
    font-weight: 400;
}
.upload-sub {
    font-size: 13px;
    color: #999;
    font-weight: 300;
    letter-spacing: 2px;
}

/* ── Wybierz pliki button ── */
.btn-select {
    margin-top: 24px;
    width: 220px;
    height: 52px;
    border: 1.5px solid #c9b389;
    border-radius: 30px;
    background: transparent;
    color: #c9b389;
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 3px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-select:hover {
    background: #c9b389;
    color: #fff;
}

/* ── File Info ── */
.file-info {
    display: none;
    margin-top: 16px;
    text-align: center;
    font-size: 14px;
    font-weight: 300;
    color: #7a7a7a;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
}
.file-info.visible { display: flex; }
.file-info span {
    background: rgba(201,179,137,0.12);
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid rgba(201,179,137,0.25);
}

/* ── Meta Fields ── */
.meta-fields {
    width: 70%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 18px;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.4s, max-height 0.4s, margin 0.4s;
}
.meta-fields.visible {
    opacity: 1;
    max-height: 200px;
}
.meta-fields input,
.meta-fields textarea {
    width: 100%;
    padding: 12px 18px;
    border: 1.5px solid rgba(201,179,137,0.3);
    border-radius: 14px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 300;
    background: rgba(255,255,255,0.7);
    color: #3a3a3a;
    transition: border-color 0.3s;
    outline: none;
}
.meta-fields input::placeholder,
.meta-fields textarea::placeholder { color: #bbb; }
.meta-fields input:focus,
.meta-fields textarea:focus {
    border-color: #c9b389;
    background: #fff;
}
.meta-fields textarea { resize: vertical; min-height: 60px; }

/* ── Submit ── */
.btn-submit {
    margin-top: 30px;
    width: 260px;
    height: 56px;
    border: none;
    border-radius: 30px;
    background: #4E6B57;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 3px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}
.btn-submit:hover { background: #3f5a48; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(78,107,87,0.25); }
.btn-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ── Spinner ── */
.spinner {
    display: none;
    width: 22px;
    height: 22px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
.btn-submit.loading .spinner { display: block; }
.btn-submit.loading .btn-text { display: none; }
.btn-submit.loading { pointer-events: none; }

/* ── Upload progress bar ── */
.upload-progress { display:none; margin-top:12px; width:100%; max-width:70%; text-align:center; }
.upload-progress.visible { display:block; }
.progress-bar-wrap { width:100%; height:6px; background:rgba(201,179,137,0.15); border-radius:3px; overflow:hidden; }
.progress-bar-inner { width:0%; height:100%; background:#4E6B57; border-radius:3px; transition:width 0.3s; }
.progress-text { font-size:11px; color:#7a7a7a; margin-top:4px; font-family:'Montserrat',sans-serif; }

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

/* ── Success overlay ── */
.success-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(250,246,241,0.95);
    backdrop-filter: blur(8px);
    z-index: 100;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
    text-align: center;
    padding: 20px;
}
.success-overlay.visible { display: flex; }
.success-overlay .check {
    width: 72px; height: 72px;
    border-radius: 50%;
    background: #4E6B57;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #fff;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes popIn {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
.success-overlay h2 {
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    font-weight: 400;
    color: #2d2d2d;
}
.success-overlay p { color: #7a7a7a; font-weight: 300; }
.success-overlay a {
    margin-top: 12px;
    display: inline-block;
    padding: 14px 36px;
    border: 1.5px solid #c9b389;
    border-radius: 30px;
    color: #c9b389;
    text-decoration: none;
    font-weight: 500;
    letter-spacing: 2px;
    font-size: 14px;
    transition: all 0.3s;
}
.success-overlay a:hover { background: #c9b389; color: #fff; }

/* ── Error / Success message ── */
.error-msg, .success-msg {
    display: none;
    margin-top: 14px;
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 400;
    text-align: center;
    max-width: 70%;
}
.error-msg {
    background: rgba(220, 100, 100, 0.08);
    border: 1px solid rgba(220, 100, 100, 0.25);
    color: #b05353;
}
.success-msg {
    background: rgba(78, 107, 87, 0.08);
    border: 1px solid rgba(78, 107, 87, 0.25);
    color: #4E6B57;
}
.error-msg.visible, .success-msg.visible { display: block; }

/* ── Wish card ── */
.wish-card {
    width:100%; max-width:480px; margin-top:28px;
    background:#fff; border-radius:24px; padding:28px;
    box-shadow:0 8px 40px rgba(0,0,0,0.04); border:1px solid rgba(201,179,137,0.15);
}

/* ── Total stats counter ── */
.total-stats {
    text-align:center; margin-top:24px;
    font-family:'Montserrat',sans-serif; font-size:13px;
    color:#7a7a7a; font-weight:300; letter-spacing:1px;
}
.total-stats strong { color:#4E6B57; font-weight:500; }

/* ── Wish message ── */
.wish-msg { display:none; margin-top:12px; padding:8px 16px; border-radius:12px; font-size:13px; text-align:center; }
.wish-msg.visible { display:block; }
.wish-msg.success { background:rgba(78,107,87,0.08); border:1px solid rgba(78,107,87,0.25); color:#4E6B57; }
.wish-msg.error { background:rgba(220,100,100,0.08); border:1px solid rgba(220,100,100,0.25); color:#b05353; }

/* ── Gallery link ── */
.gallery-link {
    margin-top: 32px;
    margin-bottom: 40px;
}
.gallery-link a {
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 2px;
    color: #b8a07a;
    text-decoration: none;
    border-bottom: 1px solid rgba(184,160,122,0.3);
    padding-bottom: 3px;
    transition: border-color 0.3s;
}
.gallery-link a:hover { border-color: #b8a07a; }

/* ══════════════════════════════════════
   GALLERY PAGE STYLES
   ══════════════════════════════════════ */
.gallery-title {
    font-family: 'Playfair Display', serif;
    font-size: 42px;
    font-weight: 400;
    color: #2d2d2d;
    text-align: center;
    margin-top: 40px;
}

.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 900px;
    margin-top: 20px;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 12px;
}
.gallery-header a {
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 2px;
    color: #b8a07a;
    text-decoration: none;
    border: 1px solid rgba(184,160,122,0.4);
    padding: 10px 24px;
    border-radius: 30px;
    transition: all 0.3s;
}
.gallery-header a:hover {
    background: #b8a07a;
    color: #fff;
}

.gallery-container {
    width: 100%;
    max-width: 900px;
    padding-bottom: 60px;
}

.empty-gallery {
    text-align: center;
    padding: 100px 20px;
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    color: #b8a07a;
    font-weight: 400;
}
.empty-gallery p { margin-bottom: 20px; }

.upload-card {
    background: #fff;
    border-radius: 20px;
    padding: 28px;
    margin-bottom: 28px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    border: 1px solid rgba(201,179,137,0.15);
}
.upload-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}
.upload-card-date {
    font-size: 12px;
    color: #bbb;
    font-weight: 300;
    letter-spacing: 1px;
}
.upload-card-caption {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    font-weight: 400;
    color: #2d2d2d;
}
.upload-card-desc {
    font-size: 14px;
    color: #7a7a7a;
    font-weight: 300;
    line-height: 1.7;
    margin: 8px 0;
}
.upload-card-count {
    font-size: 12px;
    color: #c9b389;
    font-weight: 400;
    letter-spacing: 1px;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 14px;
}
.media-item {
    border-radius: 12px;
    overflow: hidden;
    background: #f8f6f3;
    position: relative;
    transition: transform 0.2s;
}
.media-item:hover { transform: translateY(-3px); }
.media-item img,
.media-item video {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    background: #f0ede8;
}
.media-item video { object-fit: contain; background: #1a1a1a; }
.media-item .media-label {
    padding: 6px 10px;
    font-size: 11px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: #fff;
}

/* ── Lightbox ── */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 20px;
    cursor: zoom-out;
}
.lightbox.visible { display: flex; }
.lightbox img,
.lightbox video {
    max-width: 95%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
}
.lightbox video { max-width: 90%; }

/* ── Slideshow button ── */
.btn-slideshow {
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 2px;
    color: #4E6B57;
    text-decoration: none;
    border: 1px solid rgba(78,107,87,0.4);
    padding: 10px 24px;
    border-radius: 30px;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s;
}
.btn-slideshow:hover {
    background: #4E6B57;
    color: #fff;
}

/* ── Slideshow overlay ── */
.slideshow-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 300;
    flex-direction: column;
}
.slideshow-overlay.visible { display: flex; }

.slideshow-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: rgba(0,0,0,0.5);
    z-index: 2;
    flex-shrink: 0;
}
.slideshow-qr {
    width: 48px;
    height: 48px;
    border-radius: 4px;
    opacity: 0.9;
}
.slideshow-counter {
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 300;
    letter-spacing: 2px;
    color: rgba(255,255,255,0.6);
}
.slideshow-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    padding: 0 8px;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.slideshow-close:hover { opacity: 1; }

.slideshow-stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    min-height: 0;
}
#slideshowImage {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.slideshow-desc-box {
    display: none;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.75));
    padding: 60px 30px 24px;
    color: #fff;
    text-align: center;
}
.slideshow-caption {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    font-weight: 400;
    margin-bottom: 6px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.slideshow-desc {
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    font-weight: 300;
    line-height: 1.6;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    min-height: 1.4em;
}

.slideshow-bottom-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    background: rgba(0,0,0,0.5);
    z-index: 2;
    flex-shrink: 0;
}
.slideshow-nav, .slideshow-play {
    background: none;
    border: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.7);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}
.slideshow-nav:hover, .slideshow-play:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border-color: rgba(255,255,255,0.4);
}
.slideshow-play { width: 44px; height: 44px; font-size: 14px; }
.slideshow-progress {
    flex: 1;
    height: 3px;
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
    overflow: hidden;
}
.slideshow-progress-bar {
    width: 0%;
    height: 100%;
    background: #c9b389;
    border-radius: 2px;
    transition: width linear;
}

@media (max-width: 768px) {
    .slideshow-qr { width: 36px; height: 36px; }
    .slideshow-caption { font-size: 18px; }
    .slideshow-desc { font-size: 13px; }
    .slideshow-desc-box { padding: 40px 16px 16px; }
    .slideshow-nav, .slideshow-play { width: 36px; height: 36px; font-size: 14px; }
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .corner-tl { width: 160px; height: 160px; }
    .corner-br { width: 160px; height: 160px; }
    .corner-tr { width: 120px; height: 120px; }
    .corner-bl { width: 100px; height: 100px; }

    .section-title { font-size: 18px; letter-spacing: 8px; margin-top: 30px; }
    .names { font-size: 42px; }

    .thanks { max-width: 92%; font-size: 14px; }
    .upload-panel { width: 92%; min-height: 220px; }
    .btn-select { width: 100%; max-width: 92%; }
    .btn-submit { width: 100%; max-width: 92%; }
    .meta-fields { width: 92%; }
    .error-msg { max-width: 92%; }

    .media-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .gallery-title { font-size: 32px; }
}

@media (max-width: 480px) {
    .names { font-size: 36px; }
    .section-title { font-size: 16px; letter-spacing: 6px; }
    .upload-title { font-size: 18px; }
    .upload-panel { min-height: 200px; padding: 20px 16px; }
    .media-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .media-item img, .media-item video { height: 130px; }
}
