/* ============================================
   Topper's Hope - Global Styles
   Purple & White Education Theme
   ============================================ */

:root {
  --th-purple: #6a1fb5;
  --th-purple-dark: #4e1786;
  --th-purple-light: #9b5de5;
  --th-purple-bg: #f6f1fc;
  --th-white: #ffffff;
  --th-text: #2c2a33;
  --th-muted: #6c6c7a;
  --th-success: #28a745;
  --th-radius: 14px;
  --th-shadow: 0 8px 24px rgba(106, 31, 181, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', 'Segoe UI', Arial, sans-serif;
  background-color: var(--th-purple-bg);
  color: var(--th-text);
}

/* ---------- Navbar ---------- */
.th-navbar {
  background: linear-gradient(90deg, var(--th-purple-dark), var(--th-purple));
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.th-navbar .navbar-brand img {
  height: 42px;
  margin-right: 8px;
}

.th-navbar .navbar-brand {
  display: flex;
  align-items: center;
  font-weight: 600;
  color: var(--th-white) !important;
  letter-spacing: 0.3px;
}

/* ---------- Hero Section ---------- */
.th-hero {
  background: linear-gradient(135deg, var(--th-purple-dark) 0%, var(--th-purple) 60%, var(--th-purple-light) 100%);
  color: var(--th-white);
  padding: 60px 0 50px;
  text-align: center;
  border-radius: 0 0 30px 30px;
  margin-bottom: -30px;
}

.th-hero img.logo-large {
  height: 90px;
  margin-bottom: 16px;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.25));
}

.th-hero h1 {
  font-weight: 700;
  font-size: 2.1rem;
  margin-bottom: 8px;
}

.th-hero p {
  font-size: 1.05rem;
  opacity: 0.92;
  max-width: 560px;
  margin: 0 auto;
}

/* ---------- Form Card ---------- */
.th-form-card {
  background: var(--th-white);
  border-radius: var(--th-radius);
  box-shadow: var(--th-shadow);
  padding: 36px;
  margin: 40px auto 60px;
  max-width: 820px;
  position: relative;
  animation: fadeUp 0.6s ease;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.th-form-card h3 {
  color: var(--th-purple-dark);
  font-weight: 700;
  margin-bottom: 6px;
}

.th-form-card .section-sub {
  color: var(--th-muted);
  margin-bottom: 24px;
  font-size: 0.95rem;
}

.form-label {
  font-weight: 600;
  color: var(--th-text);
  font-size: 0.92rem;
}

.form-control, .form-select {
  border-radius: 8px;
  border: 1.5px solid #e2d8f0;
  padding: 10px 14px;
  transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
  border-color: var(--th-purple);
  box-shadow: 0 0 0 0.2rem rgba(106, 31, 181, 0.15);
}

.required-star {
  color: #d9534f;
}

.btn-th-primary {
  background: linear-gradient(90deg, var(--th-purple-dark), var(--th-purple));
  color: var(--th-white);
  border: none;
  font-weight: 600;
  padding: 12px 0;
  border-radius: 10px;
  letter-spacing: 0.5px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-th-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(106, 31, 181, 0.3);
  color: var(--th-white);
}

.btn-th-primary:active {
  transform: translateY(0);
}

.btn-th-primary:disabled {
  opacity: 0.7;
  transform: none;
}

/* ---------- Footer ---------- */
.th-footer {
  background: var(--th-purple-dark);
  color: rgba(255,255,255,0.85);
  text-align: center;
  padding: 18px 0;
  font-size: 0.88rem;
}

/* ---------- Admin Login ---------- */
.th-login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--th-purple-dark), var(--th-purple-light));
  padding: 20px;
}

.th-login-card {
  background: var(--th-white);
  border-radius: var(--th-radius);
  box-shadow: 0 12px 36px rgba(0,0,0,0.25);
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  animation: fadeUp 0.5s ease;
}

.th-login-card img {
  height: 70px;
  display: block;
  margin: 0 auto 14px;
}

.th-login-card h4 {
  text-align: center;
  color: var(--th-purple-dark);
  font-weight: 700;
  margin-bottom: 4px;
}

.th-login-card p.sub {
  text-align: center;
  color: var(--th-muted);
  margin-bottom: 24px;
  font-size: 0.9rem;
}

/* ---------- Admin Dashboard ---------- */
.th-dash-navbar {
  background: linear-gradient(90deg, var(--th-purple-dark), var(--th-purple));
}

.th-dash-navbar .nav-link, .th-dash-navbar .navbar-text {
  color: rgba(255,255,255,0.9) !important;
}

.th-dash-container {
  padding: 28px 0 60px;
}

.th-stat-card {
  background: var(--th-white);
  border-radius: var(--th-radius);
  box-shadow: var(--th-shadow);
  padding: 20px 22px;
  border-left: 5px solid var(--th-purple);
  height: 100%;
}

.th-stat-card .stat-number {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--th-purple-dark);
}

.th-stat-card .stat-label {
  color: var(--th-muted);
  font-size: 0.88rem;
}

.th-toolbar {
  background: var(--th-white);
  border-radius: var(--th-radius);
  box-shadow: var(--th-shadow);
  padding: 18px 20px;
  margin-bottom: 20px;
}

.th-table-card {
  background: var(--th-white);
  border-radius: var(--th-radius);
  box-shadow: var(--th-shadow);
  padding: 8px;
  overflow-x: auto;
}

.table thead th {
  background-color: var(--th-purple-bg);
  color: var(--th-purple-dark);
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
  border-bottom: 2px solid #e2d8f0;
}

.table tbody td {
  vertical-align: middle;
  font-size: 0.88rem;
}

.badge-status {
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 600;
}

.badge-new { background: #e7f1ff; color: #0d6efd; }
.badge-contacted { background: #fff3cd; color: #997404; }
.badge-registered { background: #d4edda; color: #1e7e34; }
.badge-cancelled { background: #f8d7da; color: #c82333; }

.action-btn {
  border: none;
  background: transparent;
  font-size: 1rem;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.action-btn:hover {
  background: var(--th-purple-bg);
}

/* ---------- Loading Spinner ---------- */
.th-spinner {
  width: 3rem;
  height: 3rem;
  color: var(--th-purple);
}

.th-loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

/* ---------- Misc ---------- */
.required-note {
  font-size: 0.82rem;
  color: var(--th-muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .th-hero { padding: 44px 0 38px; border-radius: 0 0 22px 22px; margin-bottom: -22px; }
  .th-hero img.logo-large { height: 70px; }
  .th-hero h1 { font-size: 1.7rem; }
  .th-hero p { font-size: 0.95rem; padding: 0 12px; }
  .th-form-card { padding: 26px 20px; margin: 28px auto 40px; border-radius: 12px; }
}

@media (max-width: 576px) {
  .container { padding-left: 14px; padding-right: 14px; }
  .th-navbar .navbar-brand { font-size: 1rem; }
  .th-navbar .navbar-brand img { height: 34px; }
  .th-hero { padding: 36px 0 30px; }
  .th-hero img.logo-large { height: 60px; margin-bottom: 10px; }
  .th-hero h1 { font-size: 1.4rem; }
  .th-hero p { font-size: 0.88rem; }
  .th-form-card { padding: 20px 16px; margin: 20px auto 32px; }
  .th-form-card h3 { font-size: 1.2rem; }
  .th-form-card .section-sub { font-size: 0.85rem; margin-bottom: 18px; }
  .form-label { font-size: 0.88rem; }
  .form-control, .form-select { padding: 11px 14px; font-size: 0.95rem; }
  .btn-th-primary { padding: 13px 0; font-size: 0.95rem; }
  .row.g-3 { row-gap: 0.85rem !important; }
}

/* Prevent iOS auto-zoom on input focus */
@media (max-width: 576px) {
  .form-control, .form-select, textarea {
    font-size: 16px;
  }
}
