/* CNG Technology Use Guide - Redesigned Styles
   Modern design with glass-morphism and animations */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: #FAFBFD;
  color: #0F172A;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #C9A227, #0F4C81); border-radius: 10px; }

/* ============ ANIMATIONS ============ */
@keyframes fadeUp { from { opacity:0; transform:translateY(40px) } to { opacity:1; transform:translateY(0) } }
@keyframes float { 0%,100% { transform:translateY(0) rotate(0deg) } 50% { transform:translateY(-12px) rotate(2deg) } }
@keyframes spin { from { transform:rotate(0deg) } to { transform:rotate(360deg) } }
@keyframes shimmer { 0% { background-position: -300% center } 100% { background-position: 300% center } }
@keyframes morphBlob { 0%,100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40% } 50% { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60% } }
@keyframes chatPop { from { opacity:0; transform:translateY(20px) scale(.95) } to { opacity:1; transform:translateY(0) scale(1) } }
@keyframes ripple { 0% { transform:scale(1); opacity:1 } 100% { transform:scale(2.5); opacity:0 } }
@keyframes glowPulse { 0%,100% { box-shadow: 0 0 20px rgba(201,162,39,0.3) } 50% { box-shadow: 0 0 40px rgba(201,162,39,0.6) } }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-6px); } }
@keyframes pulse { 0%,100% { opacity:.4 } 50% { opacity:.8 } }
@keyframes loadingPulse { 0%, 100% { transform: scale(1); opacity: 0.8; } 50% { transform: scale(1.05); opacity: 1; } }

/* ============ GLASS ============ */
.glass {
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid rgba(255,255,255,0.4);
}

/* ============ LOADING ============ */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: #FAFBFD;
}
.loading-logo {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  margin-bottom: 20px;
  animation: loadingPulse 2s ease-in-out infinite;
}
.loading-text {
  font-family: 'Sora', sans-serif;
  font-size: 18px;
  color: #0F4C81;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ============ NAV LINK ============ */
.nav-link {
  font-size: 13px;
  font-weight: 600;
  color: #64748B;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 8px;
  transition: all 0.25s;
  letter-spacing: -0.01em;
  text-decoration: none;
  display: inline-block;
}
.nav-link:hover { color: #0F4C81; background: rgba(15,76,129,0.06); }

/* ============ BENTO CARDS ============ */
.bento-card {
  position: relative;
  border-radius: 20px;
  padding: 24px;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.16,1,0.3,1);
  background: white;
  border: 1px solid #E2E8F0;
}
.bento-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 32px 64px -16px rgba(0,0,0,0.15);
  border-color: transparent;
}

/* ============ PILLAR CARDS ============ */
.pillar {
  position: relative;
  padding: 32px;
  border-radius: 24px;
  background: white;
  border: 1px solid #E2E8F0;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.16,1,0.3,1);
}
.pillar:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 48px -12px rgba(0,0,0,0.12);
}

/* ============ CONTROL CARDS ============ */
.control-card {
  padding: 28px;
  border-radius: 20px;
  background: white;
  border: 1px solid #E2E8F0;
  transition: all 0.35s;
  position: relative;
  overflow: hidden;
}
.control-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -10px rgba(0,0,0,0.1);
  border-color: transparent;
}

/* ============ DEVICE BUTTONS ============ */
.device-btn {
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  border: 2px solid #E2E8F0;
  background: white;
  color: #475569;
  letter-spacing: -0.01em;
}
.device-btn.active {
  color: white;
  border-color: transparent;
  transform: scale(1.05);
}

/* ============ TOOL CHIPS ============ */
.tool-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  background: #F1F5F9;
  color: #334155;
  transition: all 0.25s;
  cursor: default;
}
.tool-chip:hover {
  background: #E2E8F0;
  transform: translateY(-2px);
}

/* ============ LEGAL PILL ============ */
.legal-pill {
  display: inline-flex;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  font-family: 'Space Mono', monospace;
  background: rgba(15,76,129,0.08);
  color: #0F4C81;
}

/* ============ AGE CARD ============ */
.age-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
  border-radius: 16px;
  transition: all 0.3s;
  border: 1px solid transparent;
}
.age-card:hover {
  border-color: #E2E8F0;
  box-shadow: 0 8px 24px -8px rgba(0,0,0,0.08);
}

/* ============ CHAT FAB ============ */
.chat-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  width: 64px;
  height: 64px;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  background: linear-gradient(135deg, #0F4C81, #1A6FB5);
  box-shadow: 0 8px 32px rgba(15,76,129,0.4);
}
.chat-fab:hover {
  transform: scale(1.08) rotate(-5deg);
  box-shadow: 0 12px 40px rgba(15,76,129,0.5);
}

/* ============ CHAT WINDOW ============ */
.chat-win {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 420px;
  max-height: 560px;
  border-radius: 24px;
  z-index: 998;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: chatPop 0.35s cubic-bezier(0.16,1,0.3,1);
  background: white;
  box-shadow: 0 32px 80px rgba(0,0,0,0.2), 0 0 0 1px rgba(0,0,0,0.05);
}
.msg-bubble {
  max-width: 82%;
  padding: 12px 16px;
  font-size: 13.5px;
  line-height: 1.6;
}

/* ============ TYPING INDICATOR ============ */
.typing {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  background: white;
  border-radius: 16px;
  width: fit-content;
  border: 1px solid #E2E8F0;
}
.typing span {
  width: 8px;
  height: 8px;
  background: #C9A227;
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out;
}
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }

/* ============ MODAL ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%) scale(0.95);
  width: 90%;
  max-width: 900px;
  max-height: 85vh;
  background: white;
  border-radius: 24px;
  overflow: hidden;
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}
.modal-overlay.open .modal { opacity: 1; visibility: visible; transform: translate(-50%,-50%) scale(1); }
.modal-header {
  padding: 24px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #0A2E5C, #0F4C81, #1A6FB5);
  color: white;
}
.modal-title {
  font-family: 'Sora', sans-serif;
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
}
.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.15);
  color: white;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover { background: rgba(255,255,255,0.25); }
.modal-content { padding: 24px 28px; max-height: calc(85vh - 80px); overflow-y: auto; }

/* ============ DATA TABLE ============ */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left;
  padding: 12px 16px;
  background: #F8FAFC;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #0F4C81;
  border-bottom: 2px solid #C9A227;
}
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #F1F5F9;
  font-size: 14px;
  color: #475569;
}
.data-table tr:hover td { background: #FAFBFD; }
.status-allow {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 9999px;
  background: #dcfce7; color: #15803d; font-size: 12px; font-weight: 600;
}
.status-block {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 9999px;
  background: #fee2e2; color: #dc2626; font-size: 12px; font-weight: 600;
}

/* ============ ACCORDION ============ */
.accordion-item {
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  margin-bottom: 12px;
  overflow: hidden;
}
.accordion-header {
  padding: 16px 20px;
  background: #F8FAFC;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s;
}
.accordion-header:hover { background: #EFF6FF; }
.accordion-title { font-weight: 600; color: #0F172A; }
.accordion-icon { color: #C9A227; transition: transform 0.3s; }
.accordion-item.open .accordion-icon { transform: rotate(180deg); }
.accordion-body { max-height: 0; overflow: hidden; transition: max-height 0.3s ease-out; }
.accordion-item.open .accordion-body { max-height: 500px; }
.accordion-content { padding: 16px 20px; font-size: 14px; color: #64748B; line-height: 1.7; }

/* ============ DATA LINK BUTTON ============ */
.data-link-btn {
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  background: white;
  border: 1px solid #E2E8F0;
  cursor: pointer;
  color: #475569;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s;
}
.data-link-btn:hover {
  border-color: #0F4C81;
  color: #0F4C81;
}

/* ============ TAB BAR ============ */
.tab-bar { display: flex; gap: 4px; background: #F1F5F9; border-radius: 12px; padding: 3px; }

/* ============ SUB NAVIGATION ROW ============ */
.sub-nav-row { border-top: 1px solid #F1F5F9; background: rgba(255,255,255,0.6); }

/* ============ RESPONSIVE ============ */
@media (max-width:768px) {
  .desktop-nav { display: none !important; }
  .mob-toggle { display: flex !important; }
  .bento-grid { grid-template-columns: 1fr 1fr !important; }
  .hero-flex { flex-direction: column !important; text-align: center !important; }
  .hero-visual { display: none !important; }
  .pillar-grid { grid-template-columns: 1fr !important; }
  .ctrl-grid { grid-template-columns: 1fr !important; }
  .tools-grid { grid-template-columns: 1fr !important; }
  .parental-grid { grid-template-columns: 1fr !important; }
  .stat-row { justify-content: center !important; }
  .chat-win { width: calc(100% - 32px) !important; right: 16px !important; bottom: 96px !important; }
  .shared-flow { flex-direction: column !important; }
  .hero-h1 { font-size: 42px !important; }
  .philosophy-grid { grid-template-columns: 1fr !important; }
  .tips-grid { grid-template-columns: 1fr !important; }
  .screentype-grid { grid-template-columns: 1fr !important; }
  .tab-bar { gap: 2px !important; }
  .tab-bar button { font-size: 11px !important; padding: 6px 10px !important; }
  .sub-nav-row { display: none !important; }
}

@media (max-width:480px) {
  .bento-grid { grid-template-columns: 1fr !important; }
  .stat-row { flex-direction: column !important; gap: 24px !important; align-items: center !important; }
}
