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

:root {
    --cream: #fbf8f2;
    --paper: #ffffff;
    --ink: #2c2620;
    --ink-soft: #6b6259;
    --gold: #c9a24a;
    --gold-deep: #a3812f;
    --gold-pale: #f3e6c9;
    --line: #ece5d6;
    --success: #4a7c59;
    --error: #b3453f;
    --shadow: 0 10px 30px rgba(43, 34, 16, 0.08);
    --radius: 16px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--cream);
    background-image:
        radial-gradient(circle at 15% 10%, rgba(201, 162, 74, 0.06), transparent 40%),
        radial-gradient(circle at 85% 90%, rgba(201, 162, 74, 0.06), transparent 40%);
    color: var(--ink);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

a {
    color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
label:focus-visible {
    outline: 2px solid var(--gold-deep);
    outline-offset: 2px;
}

/* ---------- Header / Monogram ---------- */

header {
    text-align: center;
    padding: 56px 20px 44px;
    background-color: var(--paper);
    width: 100%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    position: relative;
}

.monogram {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: 'Playfair Display', serif;
    font-size: 3.2rem;
    color: var(--gold-deep);
    letter-spacing: 1px;
    animation: fadeUp 0.8s ease both;
}

.monogram .amp {
    font-style: italic;
    font-weight: 400;
    color: var(--gold);
    font-size: 2.2rem;
    transform: translateY(-4px);
}

header p.subtitle {
    font-size: 1.05rem;
    color: var(--ink-soft);
    font-style: italic;
    margin-top: 10px;
    animation: fadeUp 0.8s ease 0.1s both;
}

header .rule {
    width: 60px;
    height: 2px;
    background: var(--gold);
    margin: 18px auto 0;
    border-radius: 2px;
    animation: fadeUp 0.8s ease 0.15s both;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
    html { scroll-behavior: auto; }
}

/* ---------- Layout ---------- */

.container {
    max-width: 720px;
    width: 100%;
    padding: 48px 20px 90px;
    text-align: center;
}

.upload-section {
    background: var(--paper);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
}

.upload-section h2 {
    font-family: 'Playfair Display', serif;
    font-weight: 500;
    font-size: 1.4rem;
    margin-bottom: 8px;
}

.upload-section .hint {
    color: var(--ink-soft);
    font-size: 0.92rem;
    margin-bottom: 26px;
}

/* ---------- Drag & drop zone ---------- */

.dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--gold-pale);
    border-radius: 12px;
    padding: 36px 20px;
    cursor: pointer;
    transition: border-color 0.25s ease, background-color 0.25s ease;
    background: #fffefb;
}

.dropzone.dragover {
    border-color: var(--gold);
    background: var(--gold-pale);
}

.dropzone svg {
    width: 40px;
    height: 40px;
    color: var(--gold);
    margin-bottom: 10px;
}

.dropzone .dz-title {
    font-weight: 500;
    margin-bottom: 4px;
}

.dropzone .dz-sub {
    color: var(--ink-soft);
    font-size: 0.85rem;
}

input[type="file"] {
    display: none;
}

/* ---------- Photo previews ---------- */

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

.preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    animation: fadeUp 0.35s ease both;
}

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

.preview-item .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(20, 16, 10, 0.65);
    color: #fff;
    border: none;
    font-size: 0.85rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* ---------- Buttons ---------- */

button {
    padding: 13px 32px;
    background-color: var(--ink);
    color: #fff;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    transition: transform 0.15s ease, background-color 0.2s ease, opacity 0.2s ease;
}

button:hover:not(:disabled) {
    background-color: #423a2e;
    transform: translateY(-1px);
}

button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

button.primary {
    background-color: var(--gold-deep);
}

button.primary:hover:not(:disabled) {
    background-color: #8c6f28;
}

button.ghost {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--line);
}

button.ghost:hover:not(:disabled) {
    background: var(--gold-pale);
    color: var(--ink);
}

button.danger {
    background-color: var(--error);
    padding: 8px 16px;
    font-size: 0.85rem;
}

button.danger:hover:not(:disabled) {
    background-color: #8f332e;
}

#uploadBtn {
    margin-top: 24px;
    width: 100%;
}

/* ---------- Progress bar ---------- */

.progress-wrap {
    display: none;
    margin-top: 18px;
    background: var(--line);
    border-radius: 20px;
    overflow: hidden;
    height: 8px;
}

.progress-wrap.active {
    display: block;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--gold), var(--gold-deep));
    transition: width 0.2s ease;
}

/* ---------- Toasts ---------- */

.toast-stack {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 999;
    width: 90%;
    max-width: 380px;
}

.toast {
    background: var(--ink);
    color: #fff;
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 0.9rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    animation: toastIn 0.25s ease both;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--error); }

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- Modal ---------- */

.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(20, 16, 10, 0.55);
    justify-content: center;
    align-items: center;
    z-index: 500;
    padding: 20px;
}

.modal-content {
    background: var(--paper);
    padding: 40px;
    border-radius: var(--radius);
    width: 100%;
    max-width: 400px;
    text-align: center;
    position: relative;
    box-shadow: var(--shadow);
    animation: fadeUp 0.25s ease both;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--ink-soft);
    background: none;
    border: none;
    padding: 4px;
}

.modal-content h2 {
    font-family: 'Playfair Display', serif;
    color: var(--gold-deep);
    margin-bottom: 22px;
    font-weight: 500;
}

.modal-content input {
    width: 100%;
    padding: 12px 14px;
    margin: 8px 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
}

.modal-content input:focus {
    border-color: var(--gold);
}

.modal-content button {
    width: 100%;
    margin-top: 10px;
}

.modal-content .close-btn {
    width: auto;
    margin-top: 0;
}

#loginStatus {
    color: var(--error);
    margin-top: 12px;
    font-size: 0.88rem;
    min-height: 1.2em;
}

.admin-link {
    position: fixed;
    bottom: 20px;
    right: 20px;
    font-size: 0.78rem;
    color: #b8ad9c;
    cursor: pointer;
    text-decoration: none;
    background: var(--paper);
    padding: 8px 14px;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    border: none;
}

.admin-link:hover {
    color: var(--gold-deep);
}

/* ---------- Admin page ---------- */

.admin-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto 24px;
    padding: 0 4px;
    flex-wrap: wrap;
}

.admin-header-bar .back-link {
    text-decoration: none;
    color: var(--ink-soft);
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.admin-header-bar .back-link:hover {
    color: var(--gold-deep);
}

.badge {
    background: var(--gold-pale);
    color: var(--gold-deep);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.admin-actions {
    display: flex;
    gap: 10px;
}

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

.photo-card {
    background: var(--paper);
    padding: 10px;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
    animation: fadeUp 0.35s ease both;
    transition: transform 0.15s ease;
}

.photo-card:hover {
    transform: translateY(-3px);
}

.photo-card .thumb-wrap {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: zoom-in;
}

.photo-card img {
    width: 100%;
    height: 190px;
    object-fit: cover;
    display: block;
}

.photo-card .card-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.download-btn {
    flex: 1;
    display: block;
    text-align: center;
    text-decoration: none;
    background: var(--gold);
    color: white;
    padding: 8px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.download-btn:hover {
    background: var(--gold-deep);
}

.empty-state {
    grid-column: 1 / -1;
    padding: 60px 20px;
    text-align: center;
    color: var(--ink-soft);
}

.empty-state .big {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    color: var(--ink);
    margin-bottom: 6px;
}

.skeleton {
    background: linear-gradient(90deg, var(--line) 25%, #f7f2e6 37%, var(--line) 63%);
    background-size: 400% 100%;
    animation: skeletonShine 1.4s ease infinite;
    border-radius: 12px;
    height: 240px;
}

@keyframes skeletonShine {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

/* ---------- Lightbox ---------- */

.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 8, 5, 0.9);
    z-index: 600;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.lightbox img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.lightbox .lb-close {
    position: absolute;
    top: 20px;
    right: 24px;
    color: #fff;
    font-size: 2rem;
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
}

/* ---------- Responsive ---------- */

@media (max-width: 480px) {
    .monogram { font-size: 2.3rem; }
    .upload-section { padding: 28px 20px; }
    .container { padding: 32px 14px 90px; }
    .admin-header-bar { justify-content: center; text-align: center; }
}
