@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --gold:         #C9982A;
  --gold-bright:  #F0C040;
  --gold-dark:    #8B6914;
  --gold-grad:    linear-gradient(135deg, #8B6914 0%, #C9982A 40%, #F0C040 65%, #C9982A 100%);
  --nav-bg:       #0D0B08;
  --bg:           #F7F4EF;
  --card:         #FFFDF8;
  --text:         #1A1208;
  --muted:        #7A6D5A;
  --border:       #E8DFC8;
  --success:      #2D7A4F;
  --danger:       #B91C1C;
  --radius:       14px;
  --shadow:       0 1px 4px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:    0 4px 16px rgba(139,105,20,.12), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg:    0 12px 36px rgba(139,105,20,.2), 0 4px 10px rgba(0,0,0,.1);

  /* keep --primary pointing to gold so old inline styles still work */
  --primary:      var(--gold);
  --primary-dark: var(--gold-dark);
  --primary-light: #FFF8E7;
  --accent:       var(--gold-bright);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  font-size: 16px;
  line-height: 1.5;
}

/* Faded Nashville on all inner pages */
body:not(.auth-page) {
  background-image:
    linear-gradient(rgba(247,244,239,.90), rgba(247,244,239,.90)),
    url('/images/nashville-hero.jpg');
  background-size: 100% 100%, cover;
  background-position: center, center 35%;
  background-attachment: scroll, fixed;
  background-repeat: no-repeat;
}

/* ── Nav ─────────────────────────────────────────── */
nav {
  background: var(--nav-bg);
  color: #fff;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(201,152,42,.25);
  box-shadow: 0 2px 20px rgba(0,0,0,.5);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
}
.brand img {
  height: 38px;
  width: 38px;
  object-fit: contain;
}
.brand span {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: .06em;
  background: var(--gold-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
nav .nav-links { display: flex; gap: 2px; }
nav a {
  color: rgba(255,255,255,.65);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: .875rem;
  font-weight: 500;
  transition: background .15s, color .15s;
}
nav a:hover { color: var(--gold-bright); background: rgba(201,152,42,.12); }
nav a.active { color: var(--gold-bright); }

/* ── Page wrapper ────────────────────────────────── */
.page { max-width: 620px; margin: 0 auto; padding: 24px 16px 80px; }

/* ── Cards ───────────────────────────────────────── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-top: 2px solid var(--gold);
  transition: box-shadow .2s ease, transform .2s ease;
}
.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.card-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--gold-dark);
  margin-bottom: 14px;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-family: 'Cinzel', serif;
}

/* ── Forms ───────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
label {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
input, textarea, select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .95rem;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,152,42,.15);
}
textarea { resize: vertical; min-height: 90px; }

/* ── Buttons ─────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  border: none;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity .15s, transform .15s, box-shadow .15s;
  text-decoration: none;
  letter-spacing: .02em;
}
.btn:hover { transform: translateY(-1px); opacity: .92; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--gold-grad);
  color: #0D0B08;
  box-shadow: 0 2px 10px rgba(201,152,42,.4);
}
.btn-primary:hover { box-shadow: 0 4px 18px rgba(201,152,42,.55); opacity: 1; }

.btn-outline {
  background: transparent;
  color: var(--gold);
  border: 1.5px solid var(--gold);
}
.btn-outline:hover { background: rgba(201,152,42,.08); opacity: 1; }

.btn-accent  { background: var(--gold-bright); color: #0D0B08; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger  { background: var(--danger);  color: #fff; }
.btn-sm   { padding: 6px 14px; font-size: .82rem; }
.btn-block { width: 100%; }

/* ── Alerts ──────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: .875rem;
  margin-bottom: 14px;
  font-weight: 500;
}
.alert-error   { background: #FFF1F2; color: var(--danger);  border: 1px solid #FECDD3; }
.alert-success { background: #ECFDF5; color: var(--success); border: 1px solid #A7F3D0; }
.alert-info    { background: #FFF8E7; color: var(--gold-dark); border: 1px solid #E8DFC8; }

/* ── Badges ──────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.badge-used     { background: #F3F4F6; color: var(--muted); }
.badge-pending  { background: #FFF8E7; color: var(--gold-dark); border: 1px solid var(--gold); }
.badge-posted   { background: #D1FAE5; color: #065F46; }
.badge-declined { background: #FEE2E2; color: #991B1B; }
.badge-draft    { background: #FFF8E7; color: var(--gold-dark); border: 1px solid var(--gold); }

/* ── Media Stories list ──────────────────────────── */
.note-item {
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
  background: var(--card);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.note-item:hover { box-shadow: var(--shadow-md); transform: translateX(2px); }
.note-item.used { opacity: .5; }
.note-title { font-weight: 700; margin-bottom: 5px; font-size: .95rem; }
.note-desc  { font-size: .875rem; color: var(--muted); margin-bottom: 8px; line-height: 1.55; }
.note-meta  { font-size: .76rem; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; }
.note-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* ── Draft post ──────────────────────────────────── */
.draft-content {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: 8px;
  padding: 18px;
  font-size: .95rem;
  line-height: 1.7;
  white-space: pre-wrap;
  margin-bottom: 18px;
  min-height: 120px;
}
.draft-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── Post history ────────────────────────────────── */
.history-item {
  border-left: 3px solid var(--border);
  padding: 10px 16px;
  margin-bottom: 10px;
  font-size: .875rem;
  border-radius: 0 8px 8px 0;
  background: var(--bg);
  transition: border-color .15s;
}
.history-item.posted   { border-color: var(--success); }
.history-item.declined { border-color: var(--danger); }
.history-content { color: var(--muted); margin-top: 4px; line-height: 1.5; }

/* ── Auth / Login page ───────────────────────────── */
.auth-page { background: #0D0B08; }
.auth-wrap {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  position: relative;
  background-image: url('/images/nashville-hero.jpg');
  background-size: cover;
  background-position: center 40%;
}
.auth-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(10,7,2,.82) 0%, rgba(25,15,5,.76) 100%);
}
.auth-card {
  background: #141009;
  border: 1px solid rgba(201,152,42,.35);
  border-top: 2px solid var(--gold);
  border-radius: 18px;
  padding: 36px 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 0 60px rgba(201,152,42,.15), var(--shadow-lg);
  position: relative;
  z-index: 1;
  animation: cardIn .45s cubic-bezier(.22,.61,.36,1) both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-badge {
  width: 110px;
  height: 110px;
  object-fit: contain;
  margin-bottom: 14px;
}
.auth-logo h1 {
  font-family: 'Cinzel', serif;
  color: #fff;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: .08em;
  background: var(--gold-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.auth-logo p { color: rgba(255,255,255,.55); font-size: .875rem; margin-top: 6px; }

.auth-tabs {
  display: flex;
  margin-bottom: 22px;
  border-bottom: 1px solid rgba(201,152,42,.25);
}
.auth-tab {
  flex: 1;
  text-align: center;
  padding: 9px;
  cursor: pointer;
  font-weight: 600;
  font-size: .875rem;
  color: rgba(255,255,255,.4);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .15s, border-color .15s;
}
.auth-tab.active { color: var(--gold-bright); border-color: var(--gold); }

/* Override form inputs for dark auth card */
.auth-card input {
  background: rgba(255,255,255,.07);
  border-color: rgba(201,152,42,.3);
  color: #fff;
}
.auth-card input::placeholder { color: rgba(255,255,255,.3); }
.auth-card input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,152,42,.15); }
.auth-card label { color: rgba(255,255,255,.5); }
.auth-card .alert-error { background: rgba(185,28,28,.15); border-color: rgba(185,28,28,.4); color: #FCA5A5; }

/* ── Settings toggles ────────────────────────────── */
.days-grid { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.day-btn {
  padding: 7px 13px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: #fff;
  cursor: pointer;
  font-size: .82rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--muted);
  transition: all .15s;
}
.day-btn.active {
  background: var(--gold-grad);
  color: #0D0B08;
  border-color: var(--gold);
  box-shadow: 0 2px 8px rgba(201,152,42,.35);
}

/* ── Facebook connect ────────────────────────────── */
.fb-btn {
  background: #1877f2;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: .9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: opacity .15s, transform .15s;
}
.fb-btn:hover { opacity: .92; transform: translateY(-1px); }
.fb-connected {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: #F0FDF4;
  border-radius: 8px;
  border: 1px solid #A7F3D0;
}

/* ── Empty state ─────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
}
.empty-state .icon { font-size: 2.8rem; margin-bottom: 14px; }
.empty-state p { margin-bottom: 18px; font-size: .95rem; line-height: 1.6; }

/* ── Loading spinner ─────────────────────────────── */
.spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Status dot ──────────────────────────────────── */
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.dot-green  { background: var(--success); }
.dot-yellow { background: var(--gold); }
.dot-red    { background: var(--danger); }

/* ── Utilities ───────────────────────────────────── */
.text-muted      { color: var(--muted); font-size: .875rem; }
.text-center     { text-align: center; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.flex  { display: flex; }
.items-center    { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.hidden { display: none !important; }

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 480px) {
  .auth-card { padding: 28px 20px; }
  .draft-actions { flex-direction: column; }
  .draft-actions .btn { width: 100%; }
  nav { padding: 0 12px; }
  nav a { padding: 6px 8px; font-size: .82rem; }
}
