/**
 * ============================================================
 * DDPAI Booking System — Common Styles (shared)
 * ============================================================
 */

/* ---- Reset & Variables ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Brand */
  --orange-50: #fff7ed;
  --orange-100: #ffedd5;
  --orange-200: #fed7aa;
  --orange-400: #fb923c;
  --orange-500: #f97316;
  --orange-600: #ea580c;
  --orange-700: #c2410c;

  /* Slate (neutral) */
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  /* Semantic */
  --green-50: #f0fdf4;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --green-700: #15803d;
  --blue-50: #eff6ff;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --purple-50: #f5f3ff;
  --purple-500: #8b5cf6;
  --yellow-50: #fefce8;
  --yellow-500: #eab308;
  --red-50: #fef2f2;
  --red-500: #ef4444;
  --red-700: #b91c1c;

  /* Layout */
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.1);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Noto Sans Thai", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--slate-800);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* App-like scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--slate-200);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--slate-300); background-clip: padding-box; }

/* ---- Navbar (DDPAI brand — white) ---- */
.navbar {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.06);
  border-bottom: 1px solid rgba(15, 23, 42, 0.04);
}

.navbar-inner {
  width: 100%;
  max-width: 1280px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.navbar-logo-img {
  height: 26px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.navbar-site-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  color: var(--slate-600);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  border-radius: 999px;
  transition: color 0.15s, background 0.15s;
}

.navbar-site-link:hover {
  color: #c2010f;
  background: rgba(230, 0, 18, 0.06);
}

.navbar-check-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 999px;
  background: #fff;
  color: #c2010f;
  border: 1.5px solid #c2010f;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  transition: background 0.15s, color 0.15s, transform 0.12s;
  -webkit-tap-highlight-color: transparent;
}

.navbar-check-btn:hover {
  background: #c2010f;
  color: #fff;
}

.navbar-check-btn:active { transform: scale(0.97); }

@media (max-width: 640px) {
  .navbar { height: 56px; }
  .navbar-inner { padding: 0 12px; gap: 8px; }
  .navbar-logo-img { height: 20px; }
  .navbar-actions { gap: 8px; }

  /* ddpai.com keeps text label */
  .navbar-site-link {
    padding: 7px 12px;
    background: var(--slate-100);
    border-radius: 999px;
    font-size: 12.5px;
    gap: 5px;
  }

  .navbar-site-link svg {
    width: 13px;
    height: 13px;
  }

  .navbar-site-link:hover {
    background: rgba(230, 0, 18, 0.12);
  }

  /* Check booking → icon-only circle (text is hidden) */
  .navbar-check-btn .navbar-link-label { display: none; }

  .navbar-check-btn {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
}

@media (max-width: 380px) {
  .navbar-site-link { padding: 6px 10px; font-size: 11.5px; }
}

.navbar-divider {
  width: 1px;
  height: 28px;
  background: rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

.navbar-text .title {
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.3px;
}

.navbar-text .subtitle {
  color: var(--slate-400);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.2px;
}

.navbar-link {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.08);
  color: var(--slate-300);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.2s;
}

.navbar-link:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

/* ---- Badges ---- */
.badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-pending {
  background: var(--yellow-50);
  color: #854d0e;
  border: 1px solid #fde68a;
}

.badge-confirmed {
  background: var(--green-50);
  color: var(--green-700);
  border: 1px solid #bbf7d0;
}

.badge-completed {
  background: var(--blue-50);
  color: var(--blue-600);
  border: 1px solid #bfdbfe;
}

.badge-cancelled {
  background: var(--red-50);
  color: var(--red-700);
  border: 1px solid #fecaca;
}

/* ---- Form Elements ---- */
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-600);
  margin-bottom: 6px;
}

.form-group label .req {
  color: var(--orange-500);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--slate-200);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  background: #fff;
  transition: all 0.2s;
  color: var(--slate-800);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--orange-400);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-grid {
  display: grid;
  gap: 18px;
}

.form-grid-2 {
  grid-template-columns: 1fr 1fr;
}

/* ---- Buttons ---- */
.btn {
  padding: 9px 18px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  transition: transform 0.12s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.1px;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid rgba(249, 115, 22, 0.35); outline-offset: 2px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-sm {
  padding: 6px 12px;
  font-size: 11.5px;
  border-radius: 8px;
}

.btn-orange {
  background: linear-gradient(135deg, var(--orange-500), var(--orange-600));
  color: #fff;
  box-shadow: 0 6px 16px -6px rgba(249, 115, 22, 0.55);
}
.btn-orange:hover {
  box-shadow: 0 10px 22px -8px rgba(249, 115, 22, 0.7);
  transform: translateY(-1px);
}

.btn-green {
  background: linear-gradient(135deg, #22c55e, var(--green-600));
  color: #fff;
  box-shadow: 0 6px 16px -6px rgba(34, 197, 94, 0.55);
}
.btn-green:hover {
  box-shadow: 0 10px 22px -8px rgba(34, 197, 94, 0.7);
  transform: translateY(-1px);
}

.btn-blue {
  background: linear-gradient(135deg, var(--blue-500), var(--blue-600));
  color: #fff;
  box-shadow: 0 6px 16px -6px rgba(59, 130, 246, 0.55);
}
.btn-blue:hover {
  box-shadow: 0 10px 22px -8px rgba(59, 130, 246, 0.7);
  transform: translateY(-1px);
}

.btn-red {
  background: var(--red-50);
  color: var(--red-700);
  border: 1px solid #fecaca;
}
.btn-red:hover {
  background: #fecaca;
  border-color: #fca5a5;
}

.btn-ghost {
  background: #fff;
  color: var(--slate-600);
  border: 1.5px solid var(--slate-200);
}
.btn-ghost:hover {
  background: var(--slate-50);
  border-color: var(--slate-300);
  color: var(--slate-800);
}

/* ---- Card ---- */
.card {
  background: #fff;
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 16px -8px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(15, 23, 42, 0.06);
  margin-bottom: 16px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}

.card-header h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--slate-800);
  margin: 0;
}

.card-header p {
  font-size: 13px;
  color: var(--slate-500);
  margin: 2px 0 0;
}

/* ---- Animations ---- */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.35s ease-out;
}

/* ---- Responsive Helpers ---- */
@media (max-width: 640px) {
  .navbar {
    padding: 0 14px;
    height: 56px;
  }

  .navbar-logo-img {
    height: 26px;
  }

  .navbar-divider {
    height: 22px;
  }

  .navbar-brand {
    gap: 10px;
  }

  .form-grid-2 {
    grid-template-columns: 1fr;
  }
}
