@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400&family=Inter:wght@400;500;600&display=swap');

:root {
  --bg: #FAF7F0;
  --bg-card: #FFFFFF;
  --gold: #C9A961;
  --gold-dark: #B8924A;
  --gold-soft: #E8DCC4;
  --text: #2C2416;
  --text-2: #6B5D4F;
  --success: #7A8B5C;
  --danger: #A8635C;
  --border: #E8DCC4;
  --shadow: 0 2px 12px rgba(44, 36, 22, 0.08);
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  padding-bottom: 24px;
}

.serif {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 500;
}

button, input {
  font-family: inherit;
  font-size: 16px;
}

button {
  cursor: pointer;
  border: none;
  border-radius: var(--radius);
  padding: 14px 20px;
  background: var(--gold);
  color: white;
  font-weight: 500;
  transition: background 0.15s;
}
button:hover { background: var(--gold-dark); }
button:disabled { background: var(--text-2); cursor: not-allowed; opacity: 0.5; }

button.secondary {
  background: transparent;
  color: var(--gold-dark);
  border: 1px solid var(--gold);
}
button.secondary:hover { background: var(--gold-soft); }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  padding: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  width: 40px; height: 40px;
}
.btn-ghost:hover { background: var(--gold-soft); color: var(--text); }

.icon {
  width: 20px;
  height: 20px;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}
.btn-content {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

input[type="text"], input[type="password"] {
  width: 100%;
  padding: 14px 16px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}
input:focus { border-color: var(--gold); }

/* ---- Login ---- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--bg-card);
  padding: 48px 32px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-top: 3px solid var(--gold);
  text-align: center;
}
.login-ornament {
  color: var(--gold);
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}
.login-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 36px;
  letter-spacing: 6px;
  margin: 0 0 4px;
  font-weight: 500;
}
.login-subtitle {
  font-style: italic;
  color: var(--text-2);
  font-family: 'Cormorant Garamond', serif;
  font-size: 17px;
  margin: 0 0 32px;
}
.login-card button { width: 100%; margin-top: 16px; }
.login-error {
  margin-top: 16px;
  padding: 10px;
  background: #F8E8E5;
  color: var(--danger);
  border-radius: 8px;
  font-size: 14px;
}
.shake { animation: shake 0.3s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

/* ---- Header ---- */
.app-header {
  position: sticky;
  top: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 16px 16px 12px;
  z-index: 10;
}
.app-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.app-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  letter-spacing: 4px;
  margin: 0;
}
.app-actions { display: flex; gap: 4px; }

.search-input {
  font-size: 18px;
  padding: 14px 16px 14px 44px;
  background: white url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236B5D4F' stroke-width='2'><circle cx='11' cy='11' r='8'/><line x1='21' y1='21' x2='16.65' y2='16.65'/></svg>") no-repeat 14px center;
}

/* ---- Result card (single match) ---- */
.app-main {
  max-width: 600px;
  margin: 0 auto;
  padding: 16px;
}
.result-summary {
  color: var(--text-2);
  font-size: 14px;
  margin-bottom: 12px;
  padding-left: 4px;
}
.guest-card-big {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  border-left: 3px solid var(--gold);
  text-align: center;
}
.guest-name {
  font-size: 22px;
  font-weight: 500;
  margin-bottom: 8px;
}
.masa-block {
  margin: 16px 0 24px;
}
.masa-label {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  color: var(--text-2);
  font-size: 16px;
  letter-spacing: 4px;
}
.masa-number {
  font-family: 'Cormorant Garamond', serif;
  font-size: 80px;
  line-height: 1;
  font-weight: 500;
  color: var(--text);
}
.guest-card-big.attended {
  background: #F0F2EA;
  border-left-color: var(--success);
}

/* ---- Empty state ---- */
.empty-state {
  text-align: center;
  padding: 48px 16px;
  color: var(--text-2);
}
.empty-state p { font-style: italic; font-family: 'Cormorant Garamond', serif; font-size: 18px; }
.empty-state button { margin-top: 16px; }

/* ---- Full list ---- */
.section-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 2px;
  color: var(--text-2);
  text-align: center;
  margin: 24px 0 8px;
  position: relative;
}
.section-title::before, .section-title::after {
  content: "";
  display: inline-block;
  width: 40px;
  height: 1px;
  background: var(--border);
  vertical-align: middle;
  margin: 0 12px;
}
.guest-list { list-style: none; padding: 0; margin: 0; }
.guest-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}
.guest-row:first-child { border-top-left-radius: var(--radius); border-top-right-radius: var(--radius); }
.guest-row:last-child { border-bottom-left-radius: var(--radius); border-bottom-right-radius: var(--radius); border-bottom: none; }
.guest-row.attended { background: #F0F2EA; }
.guest-row .name { font-weight: 500; }
.guest-row .meta { color: var(--text-2); font-size: 14px; margin-left: 8px; }
.guest-row .actions button {
  padding: 8px;
  width: 36px; height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.guest-row .actions .icon { width: 16px; height: 16px; }

/* ---- Status dot (SSE) ---- */
.status-dot {
  position: fixed;
  bottom: 12px; right: 12px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--text-2);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
  transition: background 0.2s;
}
.status-dot.live { background: var(--success); }
.status-dot.offline { background: var(--danger); }

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  z-index: 100;
  box-shadow: var(--shadow);
}

/* ---- Modal (özet) ---- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(44, 36, 22, 0.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
  padding: 16px;
}
.modal {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 32px 24px;
  max-width: 320px; width: 100%;
  box-shadow: 0 8px 32px rgba(44, 36, 22, 0.2);
  border-top: 3px solid var(--gold);
  text-align: center;
}
.modal-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px;
  letter-spacing: 6px;
  margin: 0 0 24px;
  font-weight: 500;
}
.summary-row {
  display: flex; justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.summary-row:last-child { border-bottom: none; }
.summary-row .label { color: var(--text-2); }
.summary-row .value { font-weight: 600; }

/* ---- Banner (offline) ---- */
.offline-banner {
  background: var(--danger);
  color: white;
  text-align: center;
  padding: 8px 12px;
  font-size: 14px;
}

/* ---- Loading ---- */
.loading {
  text-align: center;
  padding: 64px 16px;
  color: var(--text-2);
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 18px;
}
