@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

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

:root {
  --bg-main: #E8F0FE;
  --bg-surface: #FFFFFF;
  --bg-surface-2: #EDF4FF;
  --bg-header: rgba(255, 255, 255, 0.92);
  --accent: #1976D2;
  --accent-hover: #1565C0;
  --accent-light: #2196F3;
  --accent-soft: rgba(25, 118, 210, 0.12);
  --accent-glow: rgba(25, 118, 210, 0.3);
  --text-primary: #0F172A;
  --text-secondary: #334155;
  --text-muted: #64748B;
  --border: rgba(15, 23, 42, 0.12);
  --border-strong: rgba(25, 118, 210, 0.35);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.1);
  --gradient-sky: linear-gradient(135deg, #1E88E5 0%, #1565C0 100%);
  --gradient-surface: linear-gradient(180deg, #FFFFFF 0%, #EDF4FF 100%);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
}

[data-theme="dark"] {
  --bg-main: #0F172A;
  --bg-surface: #1E293B;
  --bg-surface-2: #162036;
  --bg-header: rgba(15, 23, 42, 0.9);
  --text-primary: #F1F5F9;
  --text-secondary: #CBD5E1;
  --text-muted: #64748B;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(33, 150, 243, 0.3);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.25);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.3);
  --gradient-surface: linear-gradient(180deg, #1E293B 0%, #162036 100%);
}

html, body {
  width: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

body {
  font-family: 'Plus Jakarta Sans', 'Noto Sans Khmer', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-main);
  min-height: 100vh;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  transition: background 0.35s ease, color 0.35s ease;
}

.page-container {
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg-header);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background 0.35s ease;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  text-decoration: none;
}

.icon-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: contain;
}

.brand-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  transition: color 0.35s;
}

.brand-name span {
  color: var(--accent);
}

.cambodia-flag {
  overflow: hidden;
  padding: 0;
}

.cambodia-flag img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.terms-hero {
  background: var(--gradient-sky);
  padding: 48px 20px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.terms-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 50%, rgba(255,255,255,0.08) 0%, transparent 50%),
              radial-gradient(circle at 70% 30%, rgba(255,255,255,0.05) 0%, transparent 40%);
  animation: heroShimmer 15s ease-in-out infinite;
}

@keyframes heroShimmer {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(3deg); }
}

.terms-hero-icon {
  width: 72px;
  height: 72px;
  background: rgba(255,255,255,0.15);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  font-size: 32px;
  color: white;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2);
  position: relative;
}

.terms-hero h1 {
  font-size: 28px;
  font-weight: 800;
  color: white;
  margin-bottom: 8px;
  position: relative;
}

.terms-hero-subtitle {
  font-size: 14px;
  color: rgba(255,255,255,0.8);
  position: relative;
}

.terms-body {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.terms-nav {
  display: flex;
  gap: 8px;
  padding: 16px 0 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.terms-nav::-webkit-scrollbar {
  display: none;
}

.terms-nav-item {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}

.terms-nav-item:hover,
.terms-nav-item.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.terms-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: var(--shadow-md);
  transition: all 0.35s ease;
}

.terms-card:hover {
  box-shadow: var(--shadow-lg);
}

.terms-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.2s ease;
}

.terms-card-header:hover {
  background: var(--accent-soft);
}

.terms-card-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.2s ease;
}

.terms-card:hover .terms-card-icon {
  background: var(--accent);
  color: white;
}

.terms-card-title {
  flex: 1;
}

.terms-card-title h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
  transition: color 0.35s;
}

.terms-card-title span {
  font-size: 12px;
  color: var(--text-muted);
  transition: color 0.35s;
}

.terms-card-arrow {
  color: var(--text-muted);
  font-size: 13px;
  transition: transform 0.3s ease, color 0.35s;
}

.terms-card.open .terms-card-arrow {
  transform: rotate(180deg);
}

.terms-card-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.terms-card.open .terms-card-body {
  max-height: 2000px;
}

.terms-card-content {
  padding: 20px 22px 24px;
}

.terms-card-content p {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-secondary);
  margin-bottom: 14px;
  transition: color 0.35s;
}

.terms-card-content p:last-child {
  margin-bottom: 0;
}

.terms-card-content ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.terms-card-content li {
  position: relative;
  padding: 10px 0 10px 20px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  transition: color 0.35s, border-color 0.35s;
}

.terms-card-content li:last-child {
  border-bottom: none;
}

.terms-card-content li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 18px;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
}

.terms-card-content li strong {
  color: var(--text-primary);
  font-weight: 600;
  transition: color 0.35s;
}

.support-buttons {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.support-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.25s ease;
}

.support-link:hover {
  transform: translateY(-2px);
}

.support-link.telegram {
  background: linear-gradient(135deg, #0088cc, #00aaff);
  box-shadow: 0 4px 14px rgba(0,136,204,0.3);
}

.support-link.facebook {
  background: linear-gradient(135deg, #1877F2, #42a5f5);
  box-shadow: 0 4px 14px rgba(24,119,242,0.3);
}

.terms-accept-section {
  background: var(--gradient-sky);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-align: center;
  margin-top: 12px;
}

.terms-accept-section p {
  color: rgba(255,255,255,0.9);
  font-size: 15px;
  margin-bottom: 18px;
  line-height: 1.6;
}

.back-home-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-sm);
  color: white;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.25s ease;
}

.back-home-btn:hover {
  background: rgba(255,255,255,0.3);
  transform: translateY(-2px);
}

.footer {
  background: #0f1225;
  padding: 0;
  position: relative;
  z-index: 10;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.footer-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 48px 24px 0;
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  gap: 48px;
  padding-bottom: 36px;
}

.footer-brand-col { flex: 1.2; min-width: 220px; }
.footer-mid-col { flex: 1; min-width: 180px; }
.footer-payment-col { flex: 1.1; min-width: 200px; }

.footer-logo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  margin-bottom: 14px;
}

.footer-brand-name {
  display: block;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 12px;
}

.footer-brand-name span { color: #64B5F6; }

.footer-description {
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  line-height: 1.8;
}

.footer-social {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
}

.footer-social-btn {
  width: 38px;
  height: 38px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.8);
  font-size: 16px;
  text-decoration: none;
  transition: all 0.25s;
}

.footer-social-btn:hover {
  background: rgba(255,255,255,0.18);
  color: #fff;
  transform: translateY(-2px);
}

.footer-section-title {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  margin-bottom: 14px;
}

.footer-section-title--mt { margin-top: 20px; }

.footer-contact-btns {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.footer-contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  color: rgba(255,255,255,0.8);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.25s;
}

.footer-contact-btn i { font-size: 14px; color: #64B5F6; }

.footer-contact-btn:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

.footer-payment-carousel {
  position: relative;
  height: 44px;
  overflow: hidden;
}

.payment-carousel-track {
  display: flex;
  gap: 12px;
  transition: opacity 0.5s ease;
}

.footer-payment-img {
  width: 40px;
  height: 28px;
  object-fit: contain;
  border-radius: 4px;
  transition: opacity 0.4s ease;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1000px;
  margin: 0 auto;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-copyright {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
}

.footer-links-bottom {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-links-bottom a {
  color: rgba(255,255,255,0.5);
  font-size: 12px;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links-bottom a:hover { color: #fff; }
.footer-links-bottom .dot { color: rgba(255,255,255,0.25); font-size: 10px; }

.water-waves,
.particles-container,
.walking-mascot,
.footer-support-btn {
  display: none !important;
}

@media (max-width: 600px) {
  .terms-hero { padding: 36px 16px 32px; }
  .terms-hero h1 { font-size: 22px; }
  .terms-hero-icon { width: 60px; height: 60px; font-size: 26px; }
  .terms-body { padding: 16px 12px 32px; }
  .terms-card-header { padding: 16px 16px; }
  .terms-card-content { padding: 16px 16px 20px; }
  .footer-top { flex-direction: column; gap: 28px; }
  .footer-brand-col, .footer-mid-col, .footer-payment-col { min-width: 100%; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .support-buttons { flex-direction: column; }
}

@media (min-width: 768px) {
  .header { padding: 12px 32px; }
  .terms-hero { padding: 56px 32px 48px; }
  .terms-hero h1 { font-size: 32px; }
  .terms-body { padding: 32px 24px 48px; }
  .footer-inner { padding: 48px 32px 0; }
}

@media (min-width: 1024px) {
  .footer-inner { padding: 52px 48px 0; }
}

.live-support-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2196F3, #1976D2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 4px 16px rgba(33,150,243,0.4);
  text-decoration: none;
  transition: all 0.3s ease;
}

.live-support-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(33,150,243,0.5);
}
