@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700;800&family=Playfair+Display:ital,wght@0,600;0,700;1,600&family=Space+Grotesk:wght@600;700&display=swap');

:root {
  --bg: #FAFAF9;
  --ink: #1C1917;
  --muted: #57534E;
  --brand: #F59E0B; /* Amber 500 */
  --brand-light: #FEF3C7; /* Amber 100 */
  --brand-dark: #D97706; /* Amber 600 */
  --brand-grad: linear-gradient(135deg, #F59E0B, #FBBF24);
  --line: rgba(229, 231, 235, 0.6);
  --card: rgba(255, 255, 255, 0.7);
  --card-hover: rgba(255, 255, 255, 0.95);
  --ok: #10B981;
  --radius: 24px;
  --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 20px 40px -10px rgba(245, 158, 11, 0.15);
  --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --glass-border: 1px solid rgba(255, 255, 255, 0.5);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Be Vietnam Pro', system-ui, sans-serif;
  color: var(--ink);
  line-height: 1.7;
  background-color: var(--bg);
  background-image: 
    radial-gradient(circle at 10% 10%, hsla(38, 100%, 89%, 0.8) 0px, transparent 400px),
    radial-gradient(circle at 90% 20%, hsla(28, 98%, 91%, 0.6) 0px, transparent 400px),
    radial-gradient(circle at 50% 80%, hsla(43, 100%, 86%, 0.7) 0px, transparent 600px),
    radial-gradient(circle at 80% 90%, hsla(28, 98%, 91%, 0.6) 0px, transparent 400px);
  background-attachment: fixed;
  overflow-x: hidden;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #E5E7EB; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #D1D5DB; }

/* Progress Bar */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 4px;
  z-index: 1200;
  background: var(--brand-grad);
  transition: width 0.1s ease-out;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.wrap { width: min(1200px, calc(100% - 32px)); margin: 0 auto; }

/* Header/Nav */
.topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(250, 250, 249, 0.8);
  border-bottom: var(--glass-border);
  transition: var(--transition);
}
.topbar.scrolled {
  box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}

.nav {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
}

.logo { text-decoration: none; color: var(--ink); display: grid; gap: 2px; }
.logo strong { font-family: 'Space Grotesk', sans-serif; font-size: 1.25rem; text-transform: uppercase; letter-spacing: -0.5px; }
.logo span { color: var(--muted); font-size: 0.85rem; font-weight: 500; }

.menu-btn {
  display: none;
  border: 0;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  padding: 10px 16px;
  cursor: pointer;
  transition: var(--transition);
}
.menu-btn:hover { background: #333; }

.nav-links {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-links a {
  text-decoration: none;
  color: #4B5563;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 8px 16px;
  border-radius: 12px;
  transition: var(--transition);
}
.nav-links a:hover, .nav-links a.active { 
  background: var(--card); 
  color: var(--brand-dark);
  box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

/* Typography */
h1, h2, h3 { 
  margin: 0; 
  line-height: 1.2; 
  font-family: 'Space Grotesk', sans-serif; 
  letter-spacing: -1px;
}
h1 { font-size: clamp(2rem, 5vw, 3.5rem); margin-bottom: 20px; color: var(--ink); }
.section-title { font-size: clamp(1.75rem, 4vw, 2.75rem); margin-bottom: 16px; font-family: 'Space Grotesk', sans-serif; }
.sub { margin: 0; color: var(--muted); font-size: 1.1rem; max-width: 600px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 14px;
  padding: 14px 28px;
  border: 1px solid transparent;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -150%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  transform: skewX(-20deg);
  transition: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn:hover::after { left: 150%; }
.btn-main { 
  background: var(--brand-grad); 
  color: #fff; 
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}
.btn-main:hover { 
  transform: translateY(-3px); 
  box-shadow: 0 8px 25px rgba(245, 158, 11, 0.4);
}
.btn-ghost { 
  background: rgba(255, 255, 255, 0.8); 
  color: var(--ink); 
  backdrop-filter: blur(10px);
  border: 1px solid rgba(245, 158, 11, 0.2); 
}
.btn-ghost:hover { 
  background: #fff; 
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.05);
}

/* Hero Section */
.hero { padding: 60px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 40px; align-items: center; }
.hero-content {
  position: relative;
  z-index: 2;
}
.hero-card {
  position: relative;
  overflow: hidden;
  border: var(--glass-border);
  border-radius: 32px;
  padding: 40px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}
.hero-card::before {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  right: -100px;
  top: -100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.3), transparent 70%);
  animation: glow 6s ease-in-out infinite alternate;
  z-index: -1;
}
@keyframes glow {
  0% { transform: scale(1) translate(0, 0); }
  100% { transform: scale(1.2) translate(-20px, 20px); }
}

.hero p.lead { margin: 0; color: var(--muted); font-size: 1.15rem; }
.cta-row { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 16px; }

.hero-facts { margin-top: 40px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.fact { 
  border: var(--glass-border);
  border-radius: 20px; 
  background: rgba(255, 255, 255, 0.6); 
  backdrop-filter: blur(10px);
  padding: 20px; 
  text-align: center; 
  transition: var(--transition);
}
.fact:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}
.fact strong { 
  display: block; 
  font-family: 'Space Grotesk', sans-serif; 
  font-size: 2rem; 
  color: var(--brand-dark);
  line-height: 1;
  margin-bottom: 5px;
}
.fact span { font-size: 0.9rem; font-weight: 500; color: var(--muted); }

.hero-media { display: grid; grid-template-rows: 1.5fr 1fr; gap: 16px; position: relative; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.hero-media img, .gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 24px;
  box-shadow: var(--shadow);
  transition: var(--transition);
}
.hero-media img:hover, .gallery img:hover { 
  transform: scale(1.03) rotate(-1deg); 
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
  z-index: 10;
  position: relative;
}

/* Sections & Cards */
section.block { margin: 80px 0; }

.service-grid, .value-grid, .gallery, .faq-grid, .schedule-grid { display: grid; gap: 24px; }
.service-grid { grid-template-columns: repeat(4, 1fr); }
.value-grid { grid-template-columns: repeat(3, 1fr); }
.gallery { grid-template-columns: repeat(5, 1fr); }
.faq-grid { grid-template-columns: repeat(2, 1fr); }
.schedule-grid { grid-template-columns: 1.1fr 0.9fr; gap: 40px; }

.card {
  border: var(--glass-border);
  border-radius: var(--radius);
  background: var(--card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 28px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 4px;
  background: var(--brand-grad);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.card:hover { 
  transform: translateY(-8px); 
  box-shadow: var(--shadow-hover);
  background: var(--card-hover);
}
.card:hover::before { opacity: 1; }
.card h3 { font-size: 1.25rem; margin-bottom: 12px; color: var(--ink); }
.card p { margin: 0; color: var(--muted); font-size: 1rem; }

.check-list { margin: 16px 0 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.check-list li { display: flex; align-items: flex-start; }
.check-list li::before { 
  content: '✓'; 
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #D1FAE5;
  color: var(--ok); 
  font-weight: 800; 
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 0.8rem;
  margin-right: 12px; 
  flex-shrink: 0;
  margin-top: 2px;
}

/* API Tra Cứu Lịch Cúp Điện Panel */
.power-tracker-panel {
  background: #fff;
  border-radius: 24px;
  padding: 30px;
  box-shadow: 0 10px 40px -5px rgba(0,0,0,0.08);
  border: 1px solid var(--line);
}
.power-tracker-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 25px;
}
.power-tracker-header .icon {
  width: 45px; height: 45px;
  background: #FEF3C7;
  color: #D97706;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
}
.power-select-wrap {
  position: relative;
  margin-bottom: 20px;
}
.power-select {
  width: 100%;
  appearance: none;
  background: #F9FAFB;
  border: 2px solid #E5E7EB;
  border-radius: 14px;
  padding: 16px 20px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.3s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236B7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 20px;
}
.power-select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(245,158,11,0.1); background-color: #fff; }
.power-results {
  min-height: 200px;
  display: flex; flex-direction: column; gap: 15px;
}
.power-item {
  background: #F8FAFC;
  border-left: 5px solid var(--brand);
  padding: 16px;
  border-radius: 12px;
  animation: fadeUp 0.4s ease forwards;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.power-item strong { display: block; color: var(--ink); font-size: 1.05rem; margin-bottom: 5px; }
.power-item span { display: block; color: #EF4444; font-weight: 600; margin-bottom: 5px; font-size: 0.95rem; }
.power-item p { margin: 0; font-size: 0.9rem; color: var(--muted); font-style: italic; }
.power-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  border: 2px dashed #E5E7EB;
  border-radius: 14px;
  display: flex;flex-direction: column;align-items: center;gap: 10px;
}
.loading-spinner {
  width: 40px; height: 40px;
  border: 4px solid #FEF3C7;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Table */
.table-wrap { overflow-x: auto; border-radius: 16px; box-shadow: 0 4px 15px rgba(0,0,0,0.03); }
.table { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; min-width: 600px; }
.table th, .table td { text-align: left; padding: 16px 20px; font-size: 0.95rem; }
.table th { background: #F3F4F6; font-family: 'Space Grotesk', sans-serif; text-transform: uppercase; font-size: 0.85rem; color: var(--muted); letter-spacing: 1px; }
.table td { border-bottom: 1px solid var(--line); }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #F9FAFB; }
.pill { display: inline-flex; align-items: center; background: #ECFDF5; border: 1px solid #A7F3D0; color: #065F46; border-radius: 999px; font-size: 0.8rem; font-weight: 700; padding: 6px 14px; }

/* Article & SEO Modules */
.article-wrap {
  border: var(--glass-border);
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  padding: 40px;
  box-shadow: var(--shadow);
}
.article-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; border-bottom: 1px solid var(--line); padding-bottom: 20px; margin-bottom: 24px; }
.article-count { font-size: 0.9rem; font-weight: 700; background: var(--brand-light); color: var(--brand-dark); border-radius: 999px; padding: 8px 16px; display: inline-flex; align-items: center; gap: 8px;}
.knowledge-grid { display: grid; gap: 20px; }
.knowledge-block { 
  border: 1px solid transparent; 
  border-radius: 20px; 
  background: #fff; 
  padding: 24px; 
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}
.knowledge-block:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 30px rgba(0,0,0,0.06);
  border-color: rgba(245, 158, 11, 0.2);
}
.knowledge-block h3 { font-size: 1.15rem; margin-bottom: 12px; color: var(--brand-dark); }
.knowledge-block p { margin: 0; color: #4B5563; }

/* FAQ */
details.faq { 
  border: 1px solid rgba(229, 231, 235, 0.8); 
  border-radius: 20px; 
  background: rgba(255, 255, 255, 0.6); 
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 24px; 
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); 
  position: relative;
  overflow: hidden;
}
details.faq::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px;
  height: 100%;
  background: var(--brand-grad);
  opacity: 0;
  transition: 0.4s ease;
}
details.faq:hover {
  background: rgba(255, 255, 255, 0.95);
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(245, 158, 11, 0.2);
}
details.faq[open] { 
  border-color: var(--brand); 
  box-shadow: 0 15px 35px rgba(245, 158, 11, 0.12); 
  background: #fff;
}
details.faq[open]::before {
  opacity: 1;
}
details.faq summary { 
  cursor: pointer; 
  font-family: 'Space Grotesk', sans-serif; 
  font-size: 1.1rem; 
  font-weight: 700; 
  list-style: none; 
  color: var(--ink); 
  padding-right: 45px; 
  position: relative;
  outline: none;
  transition: color 0.3s ease;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary:hover { color: var(--brand-dark); }
details.faq summary::after {
  content: '';
  position: absolute; right: 0; top: 50%; 
  transform: translateY(-50%);
  width: 36px; height: 36px;
  background: #FEF3C7;
  border-radius: 50%;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid #FDE68A;
}
details.faq summary::before {
  content: '+';
  position: absolute; right: 0; top: 50%; 
  transform: translateY(-50%);
  width: 36px; height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--brand-dark);
  font-weight: 400;
  z-index: 2;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
details.faq[open] summary::after {
  background: var(--brand-grad);
  border-color: transparent;
  transform: translateY(-50%) rotate(90deg);
}
details.faq[open] summary::before { 
  content: '−';
  color: #fff;
  transform: translateY(-50%) rotate(180deg);
}
details.faq p { 
  margin: 18px 0 0; 
  color: var(--muted); 
  line-height: 1.8; 
  font-size: 1.05rem;
  padding-left: 20px;
  border-left: 3px solid #FEF3C7;
  animation: faqReveal 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes faqReveal {
  from { opacity: 0; transform: translateY(-15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Contact Section */
.contact {
  border-radius: 32px;
  background: #111827;
  color: #fff;
  box-shadow: 0 30px 60px -15px rgba(17, 24, 39, 0.4);
  padding: 50px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  position: relative;
  overflow: hidden;
}
.contact::after {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 100%; height: 100%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.15), transparent 60%);
  border-radius: 50%;
}
.contact-info { position: relative; z-index: 2; }
.contact-info h2 { color: #fff; font-size: clamp(2rem, 4vw, 2.75rem); margin-bottom: 20px; }
.contact-info p { color: #9CA3AF; font-size: 1.1rem; max-width: 400px; }
.contact form { display: grid; gap: 16px; align-content: start; position: relative; z-index: 2; }
.contact input, .contact textarea {
  width: 100%;
  border: 1px solid #374151;
  border-radius: 16px;
  background: #1F2937;
  color: #fff;
  font: inherit;
  padding: 16px 20px;
  transition: all 0.3s ease;
}
.contact textarea { resize: vertical; min-height: 140px; }
.contact input:focus, .contact textarea:focus {
  outline: none;
  border-color: var(--brand);
  background: #111827;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.15);
}
.contact button {
  border: 0;
  border-radius: 16px;
  background: var(--brand-grad);
  color: #fff;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 18px;
  cursor: pointer;
  transition: var(--transition);
}
.contact button:hover { transform: translateY(-3px); box-shadow: 0 10px 25px rgba(245, 158, 11, 0.3); }

footer { margin: 60px 0 30px; text-align: center; color: #6B7280; font-size: 0.95rem; }

/* Reveal Animations */
.reveal { opacity: 0; transform: translateY(30px) scale(0.98); transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1); transition-delay: var(--delay, 0s); }
.reveal.visible { opacity: 1; transform: translateY(0) scale(1); }

/* Responsive */
@media (max-width:1040px) {
  .hero-grid, .schedule-grid, .contact { grid-template-columns: 1fr; }
  .service-grid { grid-template-columns: repeat(2, 1fr); }
  .value-grid, .faq-grid { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(3, 1fr); }
  .hero-facts { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width:760px) {
  .nav { min-height: 70px; }
  .menu-btn { display: inline-flex; }
  .nav-links {
    position: absolute;
    top: 80px;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 16px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
  }
  .nav-links.open { display: flex; animation: slideDown 0.3s ease; }
  @keyframes slideDown { from{opacity:0;transform:translateY(-10px)} to{opacity:1;transform:translateY(0)} }
  .hero-facts { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .contact { padding: 30px 20px; border-radius: 24px; }
  .hero-card { padding: 30px 20px; }
}
