/* ================================================================
   SmartQ Global Stylesheet
   ออกแบบสไตล์โมเดิร์น Gradient + Glassmorphism
================================================================ */

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #0ea5e9;
  --accent: #f59e0b;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --dark: #0f172a;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-500: #64748b;
  --gray-700: #334155;
  --gray-900: #0f172a;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 20px 40px rgba(0,0,0,0.12);
  --shadow-xl: 0 30px 60px rgba(0,0,0,0.18);

  --radius: 16px;
  --radius-lg: 24px;
  --radius-sm: 10px;

  --font: 'IBM Plex Sans Thai', 'Sarabun', 'Noto Sans Thai', system-ui, sans-serif;
}

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

html, body {
  font-family: var(--font);
  background: linear-gradient(135deg, #e0e7ff 0%, #f0fdfa 50%, #fef3c7 100%);
  color: var(--gray-900);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 100vw;
}
img { max-width: 100%; height: auto; }

a { color: var(--primary); text-decoration: none; }

/* ===== Card ===== */
.card {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.card-lg { padding: 32px; border-radius: var(--radius-lg); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px;
  border-radius: 12px;
  border: 0;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all .18s ease;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37,99,235,0.25);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(37,99,235,0.32); }
.btn:active { transform: translateY(0); }
.btn-secondary { background: #fff; color: var(--gray-900); border: 1px solid var(--gray-200); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: var(--gray-50); }
.btn-success { background: var(--success); box-shadow: 0 4px 12px rgba(16,185,129,0.3); }
.btn-danger { background: var(--danger); box-shadow: 0 4px 12px rgba(239,68,68,0.3); }
.btn-warning { background: var(--warning); box-shadow: 0 4px 12px rgba(245,158,11,0.3); }
.btn-ghost { background: transparent; color: var(--gray-700); box-shadow: none; }
.btn-ghost:hover { background: var(--gray-100); }
.btn-sm { padding: 8px 14px; font-size: 14px; }
.btn-lg { padding: 16px 28px; font-size: 18px; }
.btn-xl { padding: 20px 32px; font-size: 22px; border-radius: 16px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

/* ===== Forms ===== */
.input, .select, .textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--gray-200);
  background: #fff;
  font-family: inherit;
  font-size: 15px;
  transition: border .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: 0;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37,99,235,0.12);
}
.label { display: block; font-size: 14px; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; }

/* ===== Layout ===== */
.container { max-width: 1280px; margin: 0 auto; padding: 24px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.flex { display: flex; gap: 12px; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: 8px; } .gap-md { gap: 16px; } .gap-lg { gap: 24px; }

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .container { padding: 12px; }

  /* Navbar Mobile: Brand แถวบน, Nav-links scroll แนวนอนแถวล่าง */
  nav.navbar {
    display: block !important;
    padding: 10px 12px !important;
  }
  nav.navbar .brand {
    display: flex !important;
    font-size: 16px;
    gap: 10px;
    justify-content: flex-start;
    margin-bottom: 10px;
  }
  nav.navbar .brand-logo { width: 32px; height: 32px; }
  nav.navbar .nav-links {
    display: flex !important;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
    gap: 4px;
    white-space: nowrap;
  }
  nav.navbar .nav-links::-webkit-scrollbar { display: none; }
  nav.navbar .nav-link {
    padding: 6px 12px !important;
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
    display: inline-block;
  }

  /* Card padding เล็กลง */
  .card { padding: 16px; }
  .card-lg { padding: 20px; border-radius: 18px; }

  /* Form ขนาดเล็กลง */
  .btn-xl { padding: 16px 24px; font-size: 18px; }
}

@media (max-width: 480px) {
  .container { padding: 8px; }
  .card { padding: 14px; }
  .nav-link { padding: 5px 10px; font-size: 12px; }
}

/* ===== Navbar ===== */
.navbar {
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.5);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow-sm);
}
.brand {
  display: flex; align-items: center; gap: 12px;
  font-weight: 800; font-size: 20px;
}
.brand-logo {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 22px;
  box-shadow: 0 6px 16px rgba(37,99,235,0.18);
  overflow: hidden;
  border: 1px solid var(--gray-200);
}
.brand-logo img {
  width: 100%; height: 100%;
  object-fit: contain;
}
.nav-links { display: flex; gap: 6px; flex-wrap: wrap; }
.nav-link {
  padding: 8px 14px; border-radius: 10px;
  color: var(--gray-700); font-weight: 600; font-size: 14px;
}
.nav-link:hover { background: var(--gray-100); }
.nav-link.active { background: var(--primary); color: #fff; }

/* ===== Tags / Badges ===== */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700;
}
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-green { background: #d1fae5; color: #047857; }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-gray { background: var(--gray-200); color: var(--gray-700); }

/* ===== Service Card (เลือกบริการ) ===== */
.service-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 28px;
  cursor: pointer;
  transition: all .25s ease;
  border: 2px solid transparent;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.service-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary);
}
.service-card .icon {
  font-size: 64px;
  margin-bottom: 12px;
  display: block;
}
.service-card .name { font-size: 20px; font-weight: 700; color: var(--gray-900); margin-bottom: 6px; }
.service-card .desc { font-size: 13px; color: var(--gray-500); }
.service-card .next-num {
  position: absolute; top: 12px; right: 12px;
  background: var(--gray-100); color: var(--gray-700);
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
}

/* ===== Big Display ===== */
.display-page {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #0c4a6e 100%);
  color: #fff;
  min-height: 100vh;
}

/* ===== Animations ===== */
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-pulse { animation: pulse 2s ease-in-out infinite; }
.animate-blink { animation: blink 1.5s ease-in-out infinite; }
.animate-slide { animation: slideIn .4s ease-out; }

/* ===== Utility ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.mb-sm { margin-bottom: 8px; } .mb-md { margin-bottom: 16px; } .mb-lg { margin-bottom: 24px; }
.mt-sm { margin-top: 8px; } .mt-md { margin-top: 16px; } .mt-lg { margin-top: 24px; }
.hidden { display: none !important; }
.text-muted { color: var(--gray-500); }
.text-primary { color: var(--primary); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }

/* ===== Print ===== */
@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}

/* ===== Footer ===== */
.footer-mini {
  text-align: center; padding: 24px;
  color: var(--gray-500); font-size: 13px;
}
