/* =========================
   ADMIN PAGE — admin.css
   Matches site glassmorphism
   + gold twist
   ========================= */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600&display=swap');

body.admin-page {
  font-family: 'DM Sans', system-ui, sans-serif;
}

/* Warm glow */
body.admin-page::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 15% 10%, rgba(255,210,100,0.11) 0%, transparent 65%),
    radial-gradient(ellipse 50% 40% at 85% 85%, rgba(255,160,50,0.08) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ── Centered wrapper ── */
.admin-wrap {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 100px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px 60px;
  gap: 1.2rem;
}

/* ── Glass card ── */
.admin-card {
  width: min(520px, 94vw);
  padding: 36px 32px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow:
    0 8px 32px rgba(0,0,0,0.12),
    inset 0 1px 0 rgba(255,255,255,0.50);
  animation: fadeSlideUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.admin-list-card {
  width: min(700px, 94vw);
  animation-delay: 0.1s;
}

/* ── Lock icon ── */
.admin-lock-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(245,200,66,0.2), rgba(232,137,58,0.2));
  border: 1px solid rgba(245,200,66,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.2rem;
  color: #b8720a;
}

/* ── Typography ── */
.admin-card h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: #0b0b0b;
}

.admin-card > p {
  color: rgba(11,11,11,0.55);
  font-size: 0.95rem;
  margin-bottom: 1.4rem;
}

.admin-card h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 1.2rem;
  color: #0b0b0b;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── Header row (title + logout) ── */
.admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.4rem;
  gap: 12px;
}

.admin-header h1 {
  margin-bottom: 0;
}

.admin-logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.10);
  background: rgba(0,0,0,0.05);
  color: rgba(11,11,11,0.55);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 4px;
}

.admin-logout-btn:hover {
  background: rgba(200,30,30,0.08);
  color: #b91c1c;
  border-color: rgba(200,30,30,0.15);
}

/* ── Form elements ── */
.admin-form-group {
  margin-bottom: 1rem;
  text-align: left;
}

.admin-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(11,11,11,0.6);
  margin-bottom: 6px;
}

.admin-input,
.admin-textarea {
  width: 100%;
  padding: 13px 15px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  color: #0b0b0b;
  font-size: 1rem;
  font-family: 'DM Sans', sans-serif;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.06);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  resize: vertical;
}

.admin-input:focus,
.admin-textarea:focus {
  outline: none;
  background: rgba(255,255,255,0.12);
  border-color: rgba(245,200,66,0.6);
  box-shadow:
    inset 0 2px 4px rgba(0,0,0,0.06),
    0 0 0 2.5px rgba(245,200,66,0.22);
}

/* ── Primary button ── */
.admin-btn-primary {
  width: 100%;
  margin-top: 6px;
  padding: 14px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #f5c842, #e8893a);
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  box-shadow: 0 8px 22px rgba(232,137,58,0.30);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s;
}

.admin-btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(232,137,58,0.40);
}

.admin-btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.admin-btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ── Feedback messages ── */
.admin-error {
  font-size: 0.85rem;
  color: #c0392b;
  min-height: 18px;
  margin: 4px 0;
  text-align: center;
}

.admin-success {
  font-size: 0.85rem;
  color: #1a7a3a;
  min-height: 18px;
  margin: 4px 0;
  text-align: center;
  animation: fadeSlideUp 0.3s ease both;
}

/* ── Back link ── */
.admin-back-link {
  display: block;
  text-align: center;
  margin-top: 1.1rem;
  font-size: 0.85rem;
  color: rgba(11,11,11,0.42);
  text-decoration: none;
  transition: color 0.2s;
}

.admin-back-link:hover {
  color: rgba(11,11,11,0.7);
}

/* ── Quote count badge ── */
.quote-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(245,200,66,0.18);
  color: #b8720a;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
}

/* ── Admin quotes list ── */
.admin-quotes-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.admin-list-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(11,11,11,0.42);
  font-style: italic;
  padding: 1rem 0;
}

/* Individual list item */
.admin-quote-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.18);
  animation: fadeSlideUp 0.4s cubic-bezier(0.22,1,0.36,1) both;
  transition: background 0.2s;
}

.admin-quote-item:hover {
  background: rgba(255,255,255,0.16);
}

.admin-quote-item-text {
  flex: 1;
  min-width: 0;
}

.admin-quote-item-text em {
  display: block;
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 0.93rem;
  color: #1a1a1a;
  line-height: 1.5;
  margin-bottom: 3px;
  /* truncate long quotes */
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.admin-quote-item-text span {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(11,11,11,0.45);
}

/* Delete button */
.admin-delete-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: rgba(200,30,30,0.07);
  color: rgba(200,30,30,0.6);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s, transform 0.18s;
}

.admin-delete-btn:hover {
  background: rgba(200,30,30,0.14);
  color: #b91c1c;
  transform: scale(1.08);
}

/* ── Spinner ── */
.spinner {
  width: 26px;
  height: 26px;
  border: 2.5px solid rgba(245,200,66,0.2);
  border-top-color: #e8893a;
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
  flex-shrink: 0;
}

/* ── Animations ── */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

/* ── Mobile ── */
@media (max-width: 480px) {
  .admin-card {
    padding: 28px 22px;
  }
  .admin-card h1 {
    font-size: 1.55rem;
  }
  .admin-header {
    flex-direction: column;
    gap: 8px;
  }
  .admin-logout-btn {
    align-self: flex-end;
  }
}