/* ============================================
   KATARINA & NIKOLA — Wedding Upload
   Modern · White · Elegant
   ============================================ */

:root {
    --bg: #fcfaf6;
    --bg-warm: #f7f2e9;
    --bg-card: #ffffff;
    --bg-card-soft: #faf6ef;
    --border: rgba(42, 31, 21, 0.08);
    --border-strong: rgba(42, 31, 21, 0.18);
    --text: #1f1a14;
    --text-soft: #4a3f33;
    --text-dim: #7a6e60;
    --text-muted: #a89b89;
    --accent: #b8945a;
    --accent-dark: #8d6f3d;
    --accent-soft: #e8d4b0;
    --rose: #c9928d;
    --rose-soft: #f3d9d4;
    --sage: #a8b59c;
    --danger: #c25555;
    --success: #6e9e7a;
    --serif: 'Cormorant Garamond', 'Times New Roman', serif;
    --sans: 'Inter', system-ui, -apple-system, sans-serif;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --shadow-soft: 0 4px 30px -8px rgba(42, 31, 21, 0.08);
    --shadow-card: 0 10px 50px -20px rgba(42, 31, 21, 0.12);
    --shadow-lift: 0 20px 70px -25px rgba(42, 31, 21, 0.2);
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
    font-family: var(--sans);
    font-weight: 400;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

img, video { max-width: 100%; display: block; }

/* ============================================
   PRIMARNI EKRAN
   ============================================ */
.primary-screen {
    min-height: 100vh;
    padding: 1.5rem 1.5rem 4rem;
    background:
        radial-gradient(ellipse 70% 50% at 50% 0%, rgba(232, 212, 176, 0.25) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 50% 100%, rgba(243, 217, 212, 0.18) 0%, transparent 60%),
        var(--bg);
    display: flex;
    flex-direction: column;
    position: relative;
}

/* ====== Top header (imena + datum) ====== */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 0.5rem 0;
    margin-bottom: 3rem;
    animation: fade-down 1s var(--ease);
}

.top-names {
    font-family: var(--serif);
    font-weight: 400;
    font-size: 1.4rem;
    letter-spacing: 0.02em;
    color: var(--text);
}

.top-names .amp {
    color: var(--accent);
    font-style: italic;
    margin: 0 0.3rem;
}

.top-date {
    font-family: var(--serif);
    font-style: italic;
    font-size: 0.95rem;
    color: var(--text-dim);
    letter-spacing: 0.05em;
}

/* ====== Primary content ====== */
.primary-content {
    flex: 1;
    max-width: 640px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    animation: fade-up 1.2s var(--ease);
}

.primary-intro {
    text-align: center;
    margin-bottom: 2.5rem;
}

.eyebrow {
    font-size: 0.72rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1rem;
    font-weight: 400;
}

.primary-title {
    font-family: var(--serif);
    font-weight: 300;
    font-size: clamp(2.6rem, 7vw, 4.2rem);
    line-height: 1.05;
    letter-spacing: -0.01em;
    color: var(--text);
    margin-bottom: 1.2rem;
}

.primary-lede {
    color: var(--text-soft);
    font-size: 1rem;
    line-height: 1.7;
    max-width: 480px;
    margin: 0 auto;
}

/* ============================================
   UPLOAD KARTICA
   ============================================ */
.upload-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.8rem;
    box-shadow: var(--shadow-card);
}

/* ====== DROPZONE ====== */
.dropzone {
    border: 1.5px dashed var(--border-strong);
    border-radius: var(--radius);
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s var(--ease);
    background: var(--bg-card-soft);
    margin-bottom: 1.2rem;
    position: relative;
    overflow: hidden;
}

.dropzone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%, rgba(184, 148, 90, 0.08) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
}

.dropzone:hover,
.dropzone.is-dragging {
    border-color: var(--accent);
    background: #fff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
}

.dropzone:hover::before,
.dropzone.is-dragging::before { opacity: 1; }

.dropzone-content { position: relative; z-index: 1; }

.dropzone-icon {
    color: var(--accent);
    margin-bottom: 1rem;
    opacity: 0.9;
    display: inline-flex;
}

.dropzone h3 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: 1.45rem;
    color: var(--text);
    margin-bottom: 0.4rem;
}

.dropzone-hint {
    color: var(--text-dim);
    font-size: 0.92rem;
    margin-bottom: 0.5rem;
}

.dropzone-meta {
    color: var(--text-muted);
    font-size: 0.75rem;
    letter-spacing: 0.04em;
}

/* ====== PREVIEW ====== */
.preview-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1.2rem;
}

.preview-list:empty { margin: 0; }

.preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-xs);
    overflow: hidden;
    background: var(--bg-warm);
    border: 1px solid var(--border);
    animation: fade-in 0.3s var(--ease);
}

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

.preview-item .video-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    background: rgba(31, 26, 20, 0.8);
    color: #fff;
    font-size: 0.62rem;
    padding: 2px 5px;
    border-radius: 3px;
    letter-spacing: 0.05em;
}

.preview-item .remove-btn {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(31, 26, 20, 0.78);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.preview-item .remove-btn:hover { background: var(--danger); }

/* ====== FORM FIELDS ====== */
.form-fields {
    margin-bottom: 1.2rem;
}

.field {
    display: block;
    margin-bottom: 0.9rem;
}

.field:last-child { margin-bottom: 0; }

.field-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    margin-bottom: 0.45rem;
    color: var(--text-soft);
}

.field-label em {
    font-style: normal;
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.74rem;
    margin-left: 0.3rem;
}

.field input,
.field textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    background: var(--bg-card-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--sans);
    font-size: 0.95rem;
    transition: border-color 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
    resize: vertical;
}

.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(184, 148, 90, 0.12);
}

.field input::placeholder,
.field textarea::placeholder {
    color: var(--text-muted);
}

/* ====== BUTTON ====== */
.btn-primary {
    width: 100%;
    padding: 1.05rem 1.5rem;
    background: var(--text);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--sans);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.25s var(--ease);
    position: relative;
    overflow: hidden;
}

.btn-primary:not(:disabled):hover {
    background: var(--accent-dark);
    transform: translateY(-2px);
    box-shadow: 0 12px 30px -10px rgba(141, 111, 61, 0.4);
}

.btn-primary:disabled {
    background: #d4cabe;
    color: #fff;
    cursor: not-allowed;
}

.btn-loading {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}

.btn-primary.is-loading .btn-label { display: none; }
.btn-primary.is-loading .btn-loading { display: inline-flex; }

.spinner { animation: spin 0.9s linear infinite; }

/* ====== PROGRESS ====== */
.progress-wrapper {
    margin-top: 1.2rem;
    text-align: center;
}

.progress-bar {
    height: 4px;
    background: var(--bg-warm);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-soft));
    width: 0;
    transition: width 0.3s var(--ease);
    border-radius: 4px;
}

.progress-text {
    font-size: 0.8rem;
    color: var(--text-dim);
    letter-spacing: 0.05em;
}

/* ====== STATUS ====== */
.status-message {
    margin-top: 1.2rem;
    padding: 0.9rem 1.1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    text-align: center;
    animation: fade-up 0.4s var(--ease);
}

.status-message.success {
    background: #eef5f0;
    border: 1px solid rgba(110, 158, 122, 0.3);
    color: var(--success);
}

.status-message.error {
    background: #fbecec;
    border: 1px solid rgba(194, 85, 85, 0.25);
    color: var(--danger);
}

.status-message strong { font-weight: 600; }

/* ====== SCROLL DOWN ====== */
.scroll-down {
    margin: 2.5rem auto 0;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.7rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    text-decoration: none;
    transition: color 0.2s;
    align-self: center;
}

.scroll-down:hover { color: var(--accent); }
.scroll-down svg { animation: bounce 2.4s ease-in-out infinite; }

/* ============================================
   LJUBAVNA PORUKA SEKCIJA
   ============================================ */
.letter-section {
    position: relative;
    padding: 6rem 1.5rem 5rem;
    background:
        radial-gradient(ellipse 80% 50% at 50% 0%, rgba(243, 217, 212, 0.3) 0%, transparent 60%),
        var(--bg-warm);
}

.letter-container {
    max-width: 580px;
    margin: 0 auto;
    text-align: center;
}

.letter-portrait {
    width: 180px;
    aspect-ratio: 9 / 16;
    margin: 0 auto 2.5rem;
    border-radius: 4px;
    overflow: hidden;
    background: var(--bg-card);
    box-shadow:
        0 0 0 1px rgba(184, 148, 90, 0.2),
        0 0 0 8px #fff,
        0 30px 80px -25px rgba(42, 31, 21, 0.3);
    transform: rotate(-1.5deg);
    transition: transform 0.5s var(--ease);
}

.letter-portrait:hover { transform: rotate(0) scale(1.02); }

.letter-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.letter-ornament {
    color: var(--accent);
    opacity: 0.7;
    margin: 0 auto 1.5rem;
    display: flex;
    justify-content: center;
}

.letter {
    font-family: var(--serif);
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.15rem, 2.3vw, 1.35rem);
    line-height: 1.85;
    color: var(--text);
    padding: 1rem 0;
    border: none;
    quotes: none;
}

.letter p {
    margin-bottom: 1.4rem;
    color: var(--text-soft);
}

.letter p:last-of-type { margin-bottom: 2rem; }

.letter-greeting {
    font-size: 1.1em;
    color: var(--accent-dark) !important;
    font-style: italic;
    margin-bottom: 1.6rem !important;
    letter-spacing: 0.01em;
}

.letter-sign {
    margin-top: 2.5rem;
    font-style: normal;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.letter-sign .sign-prefix {
    font-family: var(--serif);
    font-style: italic;
    font-size: 0.95em;
    color: var(--text-dim);
    font-weight: 300;
}

.letter-sign .sign-names {
    font-family: var(--serif);
    font-weight: 400;
    font-style: italic;
    font-size: 1.45em;
    color: var(--accent-dark);
    letter-spacing: 0.02em;
    line-height: 1.2;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    padding: 2.5rem 1.5rem;
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-muted);
    letter-spacing: 0.12em;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

.site-footer .dot { margin: 0 0.6rem; opacity: 0.5; }

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fade-up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fade-down {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(4px); }
}

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

/* ============================================
   MOBILE
   ============================================ */
@media (max-width: 600px) {
    .primary-screen { padding: 1rem 1rem 3rem; }
    .top-header {
        flex-direction: column;
        align-items: center;
        gap: 0.3rem;
        text-align: center;
        margin-bottom: 2rem;
    }
    .top-names { font-size: 1.25rem; }
    .top-date { font-size: 0.88rem; }
    .upload-card { padding: 1.3rem; border-radius: 14px; }
    .dropzone { padding: 2rem 1rem; }
    .primary-intro { margin-bottom: 1.8rem; }
    .letter-section { padding: 4rem 1.25rem 3.5rem; }
    .letter { line-height: 1.75; }
    .letter-portrait { width: 150px; margin-bottom: 2rem; }
}

/* ============================================
   ADMIN PANEL (svjetla tema)
   ============================================ */
.page-admin {
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    padding: 2rem 1.5rem;
}

.admin-wrap { max-width: 1200px; margin: 0 auto; }

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.admin-header h1 {
    font-family: var(--serif);
    font-weight: 300;
    font-size: 1.8rem;
    color: var(--text);
}

.admin-header .actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1.2rem;
    box-shadow: var(--shadow-soft);
}

.stat-value {
    font-family: var(--serif);
    font-size: 2rem;
    font-weight: 400;
    color: var(--accent-dark);
    line-height: 1;
    margin-bottom: 0.4rem;
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.btn-secondary, .btn-danger, .btn-link {
    padding: 0.65rem 1.1rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid var(--border-strong);
    background: var(--bg-card);
    color: var(--text);
    transition: all 0.2s var(--ease);
}

.btn-secondary:hover { background: var(--bg-card-soft); border-color: var(--accent); color: var(--accent-dark); }
.btn-danger { border-color: rgba(194, 85, 85, 0.35); color: var(--danger); background: #fff; }
.btn-danger:hover { background: #fbecec; }

.section-title {
    font-family: var(--serif);
    font-weight: 300;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.2rem;
}

.gallery-info {
    font-size: 0.78rem;
    color: var(--text-muted);
    max-width: 480px;
    text-align: right;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.4rem;
}

/* === PHOTO CARD === */
.photo-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
    display: flex;
    flex-direction: column;
}

.photo-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lift);
}

.photo-card-image {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--bg-warm);
}

.photo-card-image img,
.photo-card-image video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(31, 26, 20, 0.0) 60%, rgba(31, 26, 20, 0.55) 100%);
    opacity: 0;
    transition: opacity 0.25s var(--ease);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0.8rem;
}

.photo-card:hover .card-overlay { opacity: 1; }

.card-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.card-actions a,
.card-actions button {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    color: var(--text);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    text-decoration: none;
    font-size: 1rem;
    transition: all 0.2s var(--ease);
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.card-actions a:hover,
.card-actions button:hover {
    background: #fff;
    transform: translateY(-2px);
    color: var(--accent-dark);
}

.card-actions .delete-btn:hover { color: var(--danger); }
.card-actions .overlay-btn { color: var(--accent-dark); }
.card-actions .overlay-btn:hover { background: var(--accent); color: #fff; }

/* Card meta (ispod fotke) */
.photo-card-meta {
    padding: 0.9rem 1rem 1rem;
    border-top: 1px solid var(--border);
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.meta-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
}

.meta-from {
    font-family: var(--serif);
    font-size: 1.1rem;
    color: var(--text);
    font-weight: 500;
    line-height: 1.2;
    word-break: break-word;
}

.meta-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    white-space: nowrap;
    flex-shrink: 0;
}

.meta-message {
    font-family: var(--serif);
    font-style: italic;
    font-size: 0.95rem;
    line-height: 1.45;
    color: var(--text-soft);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.meta-actions {
    margin-top: 0.3rem;
}

.btn-mini {
    width: 100%;
    padding: 0.55rem 0.8rem;
    background: var(--bg-card-soft);
    color: var(--accent-dark);
    border: 1px solid rgba(184, 148, 90, 0.25);
    border-radius: var(--radius-xs);
    cursor: pointer;
    font-family: var(--sans);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    transition: all 0.2s var(--ease);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.btn-mini:hover:not(:disabled) {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.btn-mini:disabled {
    opacity: 0.6;
    cursor: wait;
}

.video-indicator {
    position: absolute;
    top: 0.6rem;
    left: 0.6rem;
    background: rgba(31, 26, 20, 0.8);
    color: white;
    font-size: 0.65rem;
    padding: 3px 7px;
    border-radius: 4px;
    letter-spacing: 0.08em;
    backdrop-filter: blur(8px);
}

/* Login */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    background:
        radial-gradient(ellipse 60% 40% at 50% 0%, rgba(232, 212, 176, 0.3) 0%, transparent 60%),
        var(--bg);
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    max-width: 380px;
    width: 100%;
    box-shadow: var(--shadow-card);
}

.login-card h1 {
    font-family: var(--serif);
    font-weight: 300;
    font-size: 2rem;
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.login-card .subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 2rem;
    letter-spacing: 0.05em;
}

.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-dim);
}

.empty-state h3 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.messages-list {
    margin-bottom: 2.5rem;
    padding: 1.2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    max-height: 280px;
    overflow-y: auto;
    box-shadow: var(--shadow-soft);
}

.message-item {
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
}

.message-item:last-child { border-bottom: none; }
.message-item .from { color: var(--accent-dark); font-weight: 500; }
.message-item .ts { color: var(--text-muted); font-size: 0.78rem; margin-left: 0.5rem; }
.message-item .text { color: var(--text-soft); margin-top: 0.2rem; font-style: italic; }
