/* DEK LAO - Global Stylesheet & Lao Typography */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Noto+Sans+Lao:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --primary-blue: #087BCB;
  --primary-blue-dark: #0662A3;
  --primary-blue-light: #EBF8FF;
  --accent-orange: #F26A21;
  --accent-orange-hover: #D95612;
  --accent-orange-light: #FFF5EE;
  --accent-green: #21B77A;
  --accent-green-light: #E8F8F2;
  --accent-yellow: #FFC928;
  --accent-yellow-light: #FFFBEB;
  --bg-light: #F7FAFC;
  --text-main: #1A202C;
  --text-muted: #718096;
  --card-border: #EDF2F7;
  --font-family-base: 'Noto Sans Lao', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-family-base);
  color: var(--text-main);
  background-color: var(--bg-light);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  font-family: var(--font-family-base);
  line-height: 1.65;
}

/* Lao typography enhancements */
:lang(lo) {
  font-family: 'Noto Sans Lao', -apple-system, sans-serif;
  line-height: 1.75;
  letter-spacing: 0.01em;
}

/* Navigation link single-line guarantee */
.nav-link {
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
}
.nav-link span {
  white-space: nowrap !important;
  display: inline-block !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #F1F5F9;
}
::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

/* Brand Utility Classes */
.bg-brand-blue { background-color: var(--primary-blue); }
.text-brand-blue { color: var(--primary-blue); }
.border-brand-blue { border-color: var(--primary-blue); }

.bg-brand-orange { background-color: var(--accent-orange); }
.text-brand-orange { color: var(--accent-orange); }
.border-brand-orange { border-color: var(--accent-orange); }

.bg-brand-green { background-color: var(--accent-green); }
.text-brand-green { color: var(--accent-green); }

.bg-brand-yellow { background-color: var(--accent-yellow); }
.text-brand-yellow { color: #B7791F; }

/* Custom Buttons */
.btn-primary {
  background-color: var(--primary-blue);
  color: #FFFFFF;
  font-weight: 600;
  border-radius: 0.75rem;
  padding: 0.625rem 1.25rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid transparent;
}
.btn-primary:hover {
  background-color: var(--primary-blue-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(8, 123, 203, 0.25);
}

.btn-cta {
  background-color: var(--accent-orange);
  color: #FFFFFF;
  font-weight: 700;
  border-radius: 0.75rem;
  padding: 0.625rem 1.25rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 14px rgba(242, 106, 33, 0.28);
}
.btn-cta:hover {
  background-color: var(--accent-orange-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(242, 106, 33, 0.35);
}

.btn-secondary {
  background-color: #FFFFFF;
  color: #4A5568;
  font-weight: 600;
  border-radius: 0.75rem;
  padding: 0.625rem 1.25rem;
  border: 1px solid #E2E8F0;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.btn-secondary:hover {
  background-color: #F8FAFC;
  border-color: #CBD5E1;
  color: #1E293B;
}

/* Card hover animation */
.hover-lift {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.08), 0 4px 8px -4px rgba(0, 0, 0, 0.04);
}

/* Ranking badge for trending items (DEK-D style) */
.rank-badge {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.875rem;
  border-radius: 8px;
}
.rank-1 { background-color: #FFC928; color: #7B341E; }
.rank-2 { background-color: #E2E8F0; color: #4A5568; }
.rank-3 { background-color: #FED7AA; color: #9A3412; }
.rank-n { background-color: #F1F5F9; color: #64748B; }

/* Tag pills */
.badge-category {
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* Floating animation */
@keyframes floatSlow {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}
.animate-float {
  animation: floatSlow 4s ease-in-out infinite;
}

/* Glassmorphism */
.glass-header {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Forum Vote Button */
.vote-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  transition: all 0.15s ease;
}
.vote-btn:hover {
  background-color: #F1F5F9;
}
.vote-btn.active {
  background-color: #FFF0EB;
  color: #F26A21;
}

/* Quiz Option Card */
.quiz-option {
  border: 2px solid #E2E8F0;
  border-radius: 1rem;
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
  background-color: #FFFFFF;
}
.quiz-option:hover {
  border-color: #087BCB;
  background-color: #F0F9FF;
  transform: translateY(-2px);
}
.quiz-option.selected {
  border-color: #087BCB;
  background-color: #EBF8FF;
  box-shadow: 0 0 0 3px rgba(8, 123, 203, 0.2);
}
.quiz-option.correct {
  border-color: #21B77A;
  background-color: #ECFDF5;
  box-shadow: 0 0 0 3px rgba(33, 183, 122, 0.2);
}
.quiz-option.incorrect {
  border-color: #EF4444;
  background-color: #FEF2F2;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

/* Toast animation */
@keyframes slideDownFade {
  from {
    opacity: 0;
    transform: translate(-50%, -20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}
.toast-enter {
  animation: slideDownFade 0.25s ease-out forwards;
}

/* Line clamp helpers */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
