/* ==========================================================================
   Gatenwalls Visits — shared stylesheet
   Palette: deep navy + muted gold + warm cream, Playfair Display + DM Sans
   ========================================================================== */

:root {
    --navy-950: #0a1424;
    --navy-900: #0f1e33;
    --navy-800: #17304e;
    --navy-700: #1f3a5f;
    --gold-500: #c6a052;
    --gold-400: #d9bd7f;
    --cream-100: #f4efe4;
    --cream-200: #e7e0d0;
    --slate-400: #93a1b5;
    --slate-500: #6f7d92;
    --ok-500: #7d9b71;
    --hold-500: #c8985a;
    --sold-500: #b06256;
    --radius: 3px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--navy-950);
    color: var(--cream-100);
    font-family: 'DM Sans', -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 600;
    margin: 0;
    letter-spacing: 0.01em;
}

a { color: inherit; }

.wordmark {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
    color: var(--cream-100);
    text-decoration: none;
    display: inline-flex;
    align-items: baseline;
    gap: 0.4em;
}
.wordmark span {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: 0.62em;
    color: var(--gold-400);
    letter-spacing: 0.14em;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    padding: 0.75em 1.4em;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.2;
    transition: background-color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}
.btn-gold {
    background: var(--gold-500);
    color: var(--navy-950);
}
.btn-gold:hover { background: var(--gold-400); }

.btn-outline {
    background: transparent;
    border-color: var(--slate-500);
    color: var(--cream-200);
}
.btn-outline:hover { border-color: var(--gold-500); color: var(--gold-400); }

.btn-ghost {
    background: transparent;
    color: var(--slate-400);
    padding: 0.6em 0.9em;
}
.btn-ghost:hover { color: var(--cream-100); }

.btn-danger {
    background: transparent;
    color: var(--sold-500);
    border-color: rgba(176, 98, 86, 0.4);
}
.btn-danger:hover { background: rgba(176, 98, 86, 0.12); }

.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------------- Auth (login / setup) ---------------- */

.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background:
        radial-gradient(circle at 15% 10%, rgba(198,160,82,0.10), transparent 45%),
        var(--navy-950);
}
.auth-card {
    width: 100%;
    max-width: 380px;
    padding: 2.4rem 2rem;
    border: 1px solid var(--navy-700);
    border-radius: var(--radius);
    background: var(--navy-900);
}
.auth-card .wordmark { display: flex; margin-bottom: 0.4rem; }
.auth-card p.sub { color: var(--slate-400); font-size: 0.9rem; margin: 0 0 1.8rem; }

.field { margin-bottom: 1.1rem; }
.field label {
    display: block;
    font-size: 0.82rem;
    color: var(--gold-400);
    margin-bottom: 0.4rem;
}
.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 0.7em 0.85em;
    background: var(--navy-950);
    border: 1px solid var(--navy-700);
    border-radius: var(--radius);
    color: var(--cream-100);
    font-family: inherit;
    font-size: 0.95rem;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--gold-500);
}
.field .hint { font-size: 0.78rem; color: var(--slate-500); margin-top: 0.35rem; }

.alert {
    padding: 0.8em 1em;
    border-radius: var(--radius);
    font-size: 0.88rem;
    margin-bottom: 1.2rem;
}
.alert-error { background: rgba(176,98,86,0.14); color: #e7b3ab; border: 1px solid rgba(176,98,86,0.35); }
.alert-ok { background: rgba(125,155,113,0.14); color: #bcd3b0; border: 1px solid rgba(125,155,113,0.35); }

/* ---------------- Admin shell ---------------- */

.admin-shell { min-height: 100vh; }
.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.6rem;
    border-bottom: 1px solid var(--navy-700);
    background: var(--navy-900);
}
.admin-topbar .who { color: var(--slate-400); font-size: 0.85rem; }
.admin-main { max-width: 1080px; margin: 0 auto; padding: 2rem 1.6rem 4rem; }

.admin-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 1.6rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.admin-header h1 { font-size: 1.6rem; }
.admin-header p { color: var(--slate-400); margin: 0.3rem 0 0; font-size: 0.9rem; }

.listing-table { width: 100%; border-collapse: collapse; }
.listing-table th {
    text-align: left;
    font-weight: 500;
    font-size: 0.78rem;
    color: var(--slate-400);
    padding: 0.6em 0.8em;
    border-bottom: 1px solid var(--navy-700);
}
.listing-table td {
    padding: 0.85em 0.8em;
    border-bottom: 1px solid var(--navy-800);
    font-size: 0.92rem;
    vertical-align: middle;
}
.listing-table tr:last-child td { border-bottom: none; }
.listing-thumb {
    width: 64px; height: 42px; border-radius: var(--radius);
    object-fit: cover; background: var(--navy-800);
    display: block;
}
.listing-title-cell .t { font-weight: 500; }
.listing-title-cell .p { color: var(--slate-400); font-size: 0.82rem; }

.status-dot {
    display: inline-flex; align-items: center; gap: 0.45em;
    font-size: 0.82rem;
}
.status-dot::before {
    content: ''; width: 7px; height: 7px; border-radius: 50%;
    background: var(--slate-500);
}
.status-available::before { background: var(--ok-500); }
.status-on_hold::before { background: var(--hold-500); }
.status-sold::before { background: var(--sold-500); }

.row-actions { display: flex; gap: 0.4rem; align-items: center; white-space: nowrap; }
.row-actions .btn { padding: 0.45em 0.8em; font-size: 0.82rem; }

.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--slate-400);
    border: 1px dashed var(--navy-700);
    border-radius: var(--radius);
}
.empty-state h2 { font-size: 1.25rem; color: var(--cream-100); margin-bottom: 0.5rem; }

.copy-link-row {
    display: flex; align-items: center; gap: 0.5rem;
}
.copy-link-row input {
    flex: 1; background: var(--navy-950); border: 1px solid var(--navy-700);
    color: var(--slate-400); padding: 0.4em 0.6em; border-radius: var(--radius);
    font-size: 0.78rem;
}

/* ---------------- Admin form ---------------- */

.form-card {
    max-width: 620px;
    border: 1px solid var(--navy-700);
    border-radius: var(--radius);
    background: var(--navy-900);
    padding: 2rem;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.2rem; }
.form-grid .field-full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 0.8rem; margin-top: 0.6rem; }
.current-video { margin: -0.2rem 0 1.1rem; font-size: 0.82rem; color: var(--slate-400); }

/* ---------------- Public view page ---------------- */

.visit-shell { min-height: 100vh; display: flex; flex-direction: column; align-items: center; }
.visit-header {
    width: 100%; max-width: 640px;
    padding: 1.1rem 1.2rem 0;
}
.visit-stage {
    width: 100%; max-width: 640px;
    padding: 0.8rem 1.2rem 0;
}
.video-frame {
    position: relative;
    width: 100%;
    border-radius: var(--radius);
    overflow: hidden;
    background: #000;
}
.video-frame video {
    width: 100%; display: block; max-height: 78vh; background: #000;
}
.video-caption {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 2.4rem 1.1rem 1rem;
    background: linear-gradient(to top, rgba(10,20,36,0.92), rgba(10,20,36,0));
    pointer-events: none;
}
.video-caption .status-dot { color: var(--cream-200); margin-bottom: 0.35rem; }
.video-caption h1 {
    font-size: clamp(1.25rem, 4vw, 1.7rem);
    color: var(--cream-100);
}

.detail-strip {
    width: 100%; max-width: 640px;
    padding: 1.6rem 1.2rem 0.4rem;
}
.detail-row {
    display: flex; align-items: baseline; justify-content: space-between;
    padding: 0.85em 0;
    border-bottom: 1px solid var(--navy-800);
    gap: 1rem;
}
.detail-row:last-child { border-bottom: none; }
.detail-row .label { color: var(--gold-400); font-size: 0.88rem; }
.detail-row .value { color: var(--cream-100); font-size: 0.98rem; text-align: right; }

.visit-cta { width: 100%; max-width: 640px; padding: 1.6rem 1.2rem 3rem; }

.visit-footer {
    color: var(--slate-500); font-size: 0.76rem;
    padding: 1.5rem 1.2rem 2.5rem; text-align: center;
}

/* ---------------- Gallery page ---------------- */

.gallery-shell { max-width: 1080px; margin: 0 auto; padding: 1.6rem 1.2rem 4rem; }
.gallery-head { padding: 1rem 0 2rem; }
.gallery-head p { color: var(--slate-400); margin: 0.4rem 0 0; }
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.4rem;
}
.gallery-card { text-decoration: none; display: block; }
.gallery-card .video-frame { aspect-ratio: 16 / 10; }
.gallery-card .video-frame video { height: 100%; object-fit: cover; }
.gallery-card .video-caption { padding: 1.6rem 0.9rem 0.8rem; }
.gallery-card .video-caption h1 { font-size: 1.05rem; }
.gallery-card .meta {
    display: flex; justify-content: space-between;
    padding: 0.6rem 0.1rem 0; font-size: 0.82rem; color: var(--slate-400);
}

/* ---------------- Utility ---------------- */

.no-select { user-select: none; -webkit-user-select: none; }

@media (max-width: 520px) {
    .form-grid { grid-template-columns: 1fr; }
    .admin-main { padding: 1.4rem 1rem 3rem; }
    .form-card { padding: 1.4rem; }
}
