/* ========================================
   Al Yahya Check-In App – Global Styles
   Color palette: deep purple + gold
   ======================================== */

:root {
  --purple-deepest: #1a0a2e;
  --purple-deep: #2d1057;
  --purple-mid: #3d1a73;
  --purple-light: #5a2d9c;
  --gold-deep: #8b6914;
  --gold-mid: #c9a227;
  --gold-bright: #e8c547;
  --gold-shimmer: #f5d97a;
  --white: #ffffff;
  --white-80: rgba(255, 255, 255, 0.8);
  --white-50: rgba(255, 255, 255, 0.5);
  --white-20: rgba(255, 255, 255, 0.2);
  --white-10: rgba(255, 255, 255, 0.1);
  --white-05: rgba(255, 255, 255, 0.05);
  --checked-bg: rgba(201, 162, 39, 0.12);
  --checked-border: rgba(201, 162, 39, 0.4);
  --shadow-glow: 0 0 40px rgba(201, 162, 39, 0.15);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: "Tajawal", sans-serif;
  background: var(--purple-deepest);
  color: var(--white);
  min-height: 100vh;
  overflow-x: hidden;
  direction: rtl;
}

/* ── Background gradient mesh ─────────────────── */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(
      ellipse 80% 60% at 20% 10%,
      rgba(93, 37, 153, 0.45) 0%,
      transparent 60%
    ),
    radial-gradient(
      ellipse 60% 50% at 80% 90%,
      rgba(201, 162, 39, 0.2) 0%,
      transparent 60%
    ),
    linear-gradient(160deg, #1a0a2e 0%, #2d1057 50%, #1a0a2e 100%);
  z-index: -2;
  pointer-events: none;
}

/* ── Particles ────────────────────────────────── */
.particles {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  animation: float linear infinite;
  opacity: 0;
}

@keyframes float {
  0% {
    transform: translateY(100vh) scale(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 0.6;
  }
  100% {
    transform: translateY(-20px) scale(1);
    opacity: 0;
  }
}

/* ── Wrapper ──────────────────────────────────── */
.app-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 820px;
  margin: 0 auto;
  padding: 0 16px 24px;
}

/* ── HEADER ───────────────────────────────────── */
.header {
  padding: 28px 0 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 24px;
}

/* Logo area */
.logo-area {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 50%;
  border: 2px solid var(--gold-mid);
  box-shadow:
    0 0 20px rgba(201, 162, 39, 0.35),
    0 0 60px rgba(201, 162, 39, 0.15);
  animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%,
  100% {
    box-shadow:
      0 0 20px rgba(201, 162, 39, 0.35),
      0 0 60px rgba(201, 162, 39, 0.1);
  }
  50% {
    box-shadow:
      0 0 30px rgba(201, 162, 39, 0.55),
      0 0 80px rgba(201, 162, 39, 0.25);
  }
}

.brand-name {
  font-size: 1.9rem;
  font-weight: 800;
  background: linear-gradient(
    135deg,
    var(--gold-shimmer) 0%,
    var(--gold-mid) 60%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}

.brand-tagline {
  font-size: 0.85rem;
  color: var(--white-50);
  margin-top: 4px;
  letter-spacing: 0.5px;
}

/* Stats */
.header-stats {
  display: flex;
  gap: 12px;
}

.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--white-05);
  border: 1px solid var(--white-10);
  border-radius: var(--radius-md);
  padding: 10px 18px;
  min-width: 64px;
  backdrop-filter: blur(8px);
  transition: var(--transition);
}

.stat-card.highlight {
  background: rgba(201, 162, 39, 0.15);
  border-color: rgba(201, 162, 39, 0.35);
}

.stat-number {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--gold-bright);
  line-height: 1;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--white-50);
  margin-top: 4px;
}

/* Progress bar */
.progress-container {
  position: relative;
  height: 8px;
  background: var(--white-10);
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 6px;
}

.progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 100px;
  background: linear-gradient(
    90deg,
    var(--gold-deep),
    var(--gold-bright),
    var(--gold-shimmer)
  );
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.progress-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 100%
  );
  animation: shimmer 2s linear infinite;
  background-size: 200% 100%;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.progress-label {
  display: block;
  text-align: center;
  font-size: 0.72rem;
  color: var(--white-50);
  margin-top: 6px;
  margin-bottom: 20px;
}

/* ── MAIN ─────────────────────────────────────── */
.main {
  flex: 1;
}

/* Search */
.search-section {
  margin-bottom: 20px;
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  right: 16px;
  font-size: 1.1rem;
  pointer-events: none;
  z-index: 1;
}

.search-input {
  width: 100%;
  padding: 16px 48px 16px 52px;
  font-family: "Tajawal", sans-serif;
  font-size: 1.05rem;
  font-weight: 500;
  background: var(--white-05);
  border: 1.5px solid var(--white-20);
  border-radius: var(--radius-xl);
  color: var(--white);
  outline: none;
  caret-color: var(--gold-bright);
  backdrop-filter: blur(12px);
  transition: var(--transition);
  direction: rtl;
}

.search-input::placeholder {
  color: var(--white-50);
}

.search-input:focus {
  border-color: var(--gold-mid);
  background: rgba(201, 162, 39, 0.08);
  box-shadow:
    0 0 0 3px rgba(201, 162, 39, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.clear-btn {
  position: absolute;
  left: 16px;
  width: 28px;
  height: 28px;
  border: none;
  background: var(--white-20);
  color: var(--white);
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: var(--transition);
}

.clear-btn:hover {
  background: var(--gold-mid);
}
.clear-btn.visible {
  display: flex;
}

.search-hint {
  font-size: 0.78rem;
  color: var(--white-50);
  text-align: center;
  margin-top: 8px;
}

/* Filter tabs */
.filter-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.tab {
  flex: 1;
  min-width: 90px;
  padding: 10px 18px;
  font-family: "Tajawal", sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--white-05);
  border: 1.5px solid var(--white-10);
  border-radius: var(--radius-sm);
  color: var(--white-80);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.tab:hover {
  background: var(--white-10);
  border-color: var(--white-20);
}

.tab.active {
  background: linear-gradient(
    135deg,
    rgba(201, 162, 39, 0.25),
    rgba(201, 162, 39, 0.1)
  );
  border-color: var(--gold-mid);
  color: var(--gold-bright);
}

/* ── GUEST LIST ───────────────────────────────── */
.guest-list-container {
  position: relative;
}

.guest-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Guest card */
.guest-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--white-05);
  border: 1.5px solid var(--white-10);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  backdrop-filter: blur(8px);
  user-select: none;
  animation: slide-in 0.3s ease both;
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.guest-card:hover {
  background: var(--white-10);
  border-color: var(--white-20);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.guest-card.checked {
  background: var(--checked-bg);
  border-color: var(--checked-border);
}

.guest-card.checked:hover {
  border-color: var(--gold-mid);
}

/* Custom checkbox */
.guest-checkbox {
  position: relative;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.guest-checkbox input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkmark {
  position: absolute;
  inset: 0;
  border: 2px solid var(--white-20);
  border-radius: 8px;
  background: var(--white-05);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.checkmark::after {
  content: "✓";
  font-size: 1rem;
  font-weight: 700;
  color: var(--purple-deepest);
  opacity: 0;
  transform: scale(0.5);
  transition: var(--transition);
}

.guest-card.checked .checkmark {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold-mid));
  border-color: var(--gold-bright);
  box-shadow: 0 0 12px rgba(201, 162, 39, 0.5);
}

.guest-card.checked .checkmark::after {
  opacity: 1;
  transform: scale(1);
}

/* Guest info */
.guest-info {
  flex: 1;
}

.guest-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.2;
  transition: var(--transition);
}

.guest-card.checked .guest-name {
  color: var(--gold-shimmer);
}

.guest-status {
  font-size: 0.75rem;
  color: var(--white-50);
  margin-top: 3px;
  transition: var(--transition);
}

.guest-card.checked .guest-status {
  color: rgba(201, 162, 39, 0.7);
}

/* Guest number badge */
.guest-badge {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--white-50);
  min-width: 28px;
  text-align: center;
}

/* ── HELPERS COUNTER ─────────────────────────────── */
.helpers-counter {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-right: auto;
  margin-left: 4px;
}

.helper-btn {
  width: 30px;
  height: 30px;
  border: 1.5px solid var(--white-20);
  border-radius: 8px;
  background: var(--white-05);
  color: var(--white-80);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  line-height: 1;
  padding: 0;
  font-family: "Tajawal", sans-serif;
}

.helper-btn:hover:not(:disabled) {
  background: var(--white-10);
  border-color: var(--gold-mid);
  color: var(--gold-bright);
}

.helper-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.helper-btn.plus {
  border-color: rgba(201, 162, 39, 0.3);
  color: var(--gold-bright);
}

.helper-btn.plus:hover {
  background: rgba(201, 162, 39, 0.15);
  border-color: var(--gold-mid);
}

.helper-count {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gold-bright);
  min-width: 20px;
  text-align: center;
}

/* ── ADD AND CHECK IN BUTTON ─────────────────────── */
.add-checkin-btn {
  display: inline-block;
  margin-top: 20px;
  padding: 14px 28px;
  font-family: "Tajawal", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  background: linear-gradient(135deg, rgba(201, 162, 39, 0.25), rgba(201, 162, 39, 0.1));
  border: 1.5px solid var(--gold-mid);
  border-radius: 100px;
  color: var(--gold-bright);
  cursor: pointer;
  transition: var(--transition);
}

.add-checkin-btn:hover {
  background: linear-gradient(135deg, rgba(201, 162, 39, 0.4), rgba(201, 162, 39, 0.2));
  box-shadow: 0 0 20px rgba(201, 162, 39, 0.25);
  transform: translateY(-1px);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--white-50);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 14px;
}

/* ── FOOTER ───────────────────────────────────── */
.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding-top: 32px;
}

.reset-btn {
  padding: 12px 28px;
  font-family: "Tajawal", sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  background: transparent;
  border: 1.5px solid rgba(255, 80, 80, 0.35);
  border-radius: 100px;
  color: rgba(255, 150, 150, 0.85);
  cursor: pointer;
  transition: var(--transition);
}

.reset-btn:hover {
  background: rgba(255, 80, 80, 0.12);
  border-color: rgba(255, 80, 80, 0.6);
  color: #ff9999;
}

.footer-note {
  font-size: 0.75rem;
  color: var(--white-50);
  background: linear-gradient(135deg, var(--gold-shimmer), var(--gold-mid));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── TOAST ────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: linear-gradient(135deg, var(--purple-mid), var(--purple-light));
  border: 1px solid var(--gold-mid);
  color: var(--gold-shimmer);
  font-family: "Tajawal", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 13px 28px;
  border-radius: 100px;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.5),
    var(--shadow-glow);
  opacity: 0;
  transition:
    transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
  z-index: 9999;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ── MODAL ────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 0, 25, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: linear-gradient(160deg, var(--purple-mid), var(--purple-deep));
  border: 1px solid rgba(201, 162, 39, 0.35);
  border-radius: var(--radius-xl);
  padding: 40px 32px;
  max-width: 360px;
  width: 90%;
  text-align: center;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.6),
    0 0 40px rgba(201, 162, 39, 0.15);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.open .modal {
  transform: scale(1);
}

.modal-icon {
  font-size: 2.5rem;
  margin-bottom: 14px;
}

.modal-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--gold-bright);
  margin-bottom: 12px;
}

.modal-body {
  font-size: 0.95rem;
  color: var(--white-80);
  line-height: 1.6;
  margin-bottom: 28px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.modal-btn {
  flex: 1;
  padding: 12px 20px;
  font-family: "Tajawal", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 100px;
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

.modal-btn.cancel {
  background: var(--white-10);
  color: var(--white-80);
  border: 1px solid var(--white-20);
}
.modal-btn.cancel:hover {
  background: var(--white-20);
}

.modal-btn.confirm {
  background: linear-gradient(135deg, #c0392b, #e74c3c);
  color: #fff;
}
.modal-btn.confirm:hover {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
}

/* ── Responsive ───────────────────────────────── */
@media (max-width: 500px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .header-stats {
    width: 100%;
    justify-content: space-between;
  }
  .stat-card {
    flex: 1;
  }
  .brand-name {
    font-size: 1.5rem;
  }
  .guest-name {
    font-size: 0.95rem;
  }
}
