/* ============================================
   MR Tronik - Custom Styles
   Stack: Tailwind CDN + Custom CSS
   ============================================ */

/* ---------- CSS Variables ---------- */
:root {
  --color-primary: #3B82F6;
  --color-primary-dark: #2563EB;
  --color-accent: #F97316;
  --color-accent-dark: #EA6C0A;
  --box-width: 1100px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  transition: background-color 0.3s ease, color 0.3s ease;
  /* OUTER */
  background: #d3d6d9;
 
}
html.dark body {
  background: #0b1120;
}

html.dark .app-box {
  background: #111827;
}
/* INNER */
.app-box {
  width: 100%;
  max-width: var(--box-width);
  min-height: 100vh;
  margin: 0 auto;
  background: #ffffff;
}

/* ---------- Boxed Layout ---------- */
.boxed {
  max-width: var(--box-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
 
}

/* ---------- DARK MODE ---------- */
html.dark body {
  background-color: #0F172A;
  color: #E2E8F0;
}

html.dark .card {
  background-color: #1E293B;
  border-color: #334155;
}

html.dark .navbar {
  background-color: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid #1E293B;
}

html.dark .section-alt {
  background-color: #111827;
}

html.dark .input-field {
  background-color: #1E293B;
  border-color: #334155;
  color: #E2E8F0;
}

html.dark .input-field:focus {
  border-color: var(--color-primary);
  outline: none;
}

html.dark .sidebar {
  background-color: #1E293B;
  border-right: 1px solid #334155;
}

html.dark .table-row:hover {
  background-color: #1E293B;
}

html.dark .badge-active {
  background-color: rgba(16, 185, 129, 0.2);
  color: #10B981;
}

html.dark .badge-expired {
  background-color: rgba(239, 68, 68, 0.2);
  color: #EF4444;
}

html.dark .badge-pending {
  background-color: rgba(245, 158, 11, 0.2);
  color: #F59E0B;
}

/* ---------- LIGHT MODE ---------- */
html.light body {
  background-color: #d3d6d9 /* -#F8FAFC;--- */
  color: #0F172A;
}

html.light .card {
  background-color: #FFFFFF;
  border-color: #E2E8F0;
}

html.light .navbar {
  background-color: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid #E2E8F0;
}

html.light .section-alt {
  background-color: #EFF6FF;
}

html.light .input-field {
  background-color: #FFFFFF;
  border-color: #CBD5E1;
  color: #0F172A;
}

html.light .input-field:focus {
  border-color: var(--color-primary);
  outline: none;
}

html.light .sidebar {
  background-color: #FFFFFF;
  border-right: 1px solid #E2E8F0;
}

html.light .table-row:hover {
  background-color: #F1F5F9;
}

html.light .badge-active {
  background-color: #DCFCE7;
  color: #16A34A;
}

html.light .badge-expired {
  background-color: #FEE2E2;
  color: #DC2626;
}

html.light .badge-pending {
  background-color: #FEF3C7;
  color: #D97706;
}

/* ---------- Navbar ---------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.3s ease;
}

.navbar-inner {
  max-width: var(--box-width);
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.logo-mr {
  color: var(--color-primary);
}

.logo-tronik {
  color: var(--color-accent);
}

.nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
}

html.dark .nav-link {
  color: #94A3B8;
}
html.dark .nav-link:hover {
  color: #FFFFFF;
  background-color: rgba(255,255,255,0.05);
}
html.light .nav-link {
  color: #475569;
}
html.light .nav-link:hover {
  color: #0F172A;
  background-color: rgba(0,0,0,0.05);
}

/* ---------- Navbar Dropdown ---------- */
.nav-dropdown-wrap {
  position: relative;
}

.nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: none;
  border: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.nav-dropdown-chevron {
  transition: transform 0.2s ease;
}

.nav-dropdown-wrap.open .nav-dropdown-chevron,
.nav-mobile-group.open .nav-dropdown-chevron {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 270px;
  padding: 0.5rem;
  border-radius: 0.75rem;
  z-index: 120;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.nav-dropdown-wrap.open .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

html.dark .nav-dropdown-menu {
  background-color: #0F172A;
  border: 1px solid #334155;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}
html.light .nav-dropdown-menu {
  background-color: #FFFFFF;
  border: 1px solid #E2E8F0;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
}

.nav-dropdown-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.6rem 0.7rem;
  border-radius: 0.55rem;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.15s ease;
}

.nav-dropdown-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
}

html.dark .nav-dropdown-icon {
  background-color: rgba(59, 130, 246, 0.15);
  color: #93C5FD;
}
html.light .nav-dropdown-icon {
  background-color: rgba(59, 130, 246, 0.10);
  color: #2563EB;
}

.nav-dropdown-label {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
}

.nav-dropdown-desc {
  font-size: 0.75rem;
  margin-top: 0.1rem;
}

html.dark .nav-dropdown-label { color: #F1F5F9; }
html.dark .nav-dropdown-desc { color: #64748B; }
html.dark .nav-dropdown-item:hover { background-color: rgba(255, 255, 255, 0.06); }

html.light .nav-dropdown-label { color: #0F172A; }
html.light .nav-dropdown-desc { color: #64748B; }
html.light .nav-dropdown-item:hover { background-color: #F1F5F9; }

/* ---------- Mobile Group Accordion ---------- */
.nav-mobile-group-items {
  display: none;
  flex-direction: column;
}

.nav-mobile-group.open .nav-mobile-group-items {
  display: flex;
}

/* ---------- Buttons ---------- */
.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: #fff;
  font-weight: 600;
  padding: 0.625rem 1.5rem;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-size: 0.9rem;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.btn-accent {
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark));
  color: #fff;
  font-weight: 600;
  padding: 0.625rem 1.5rem;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-size: 0.9rem;
}

.btn-accent:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(249, 115, 22, 0.4);
}

.btn-outline {
  background: transparent;
  font-weight: 600;
  padding: 0.625rem 1.5rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-size: 0.9rem;
}

html.dark .btn-outline {
  color: #E2E8F0;
  border: 1.5px solid #334155;
}
html.dark .btn-outline:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}
html.light .btn-outline {
  color: #0F172A;
  border: 1.5px solid #CBD5E1;
}
html.light .btn-outline:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* ---------- Cards ---------- */
.card {
  border-radius: 1rem;
  border-width: 1px;
  border-style: solid;
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
}

html.dark .card:hover {
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  border-color: var(--color-primary);
}
html.light .card:hover {
  box-shadow: 0 20px 60px rgba(59, 130, 246, 0.12);
  border-color: var(--color-primary);
}

/* ---------- Hero ---------- */
.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 64px;
  position: relative;
  overflow: hidden;
}

.hero-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(59,130,246,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59,130,246,0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

html.dark .hero-gradient {
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(59,130,246,0.15) 0%, transparent 70%);
}
html.light .hero-gradient {
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(59,130,246,0.08) 0%, transparent 70%);
}

.gradient-text {
  background: linear-gradient(135deg, var(--color-primary) 0%, #8B5CF6 50%, var(--color-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---------- Badge / Tag ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

html.dark .tag-blue {
  background-color: rgba(59, 130, 246, 0.15);
  color: #93C5FD;
  border: 1px solid rgba(59, 130, 246, 0.3);
}
html.light .tag-blue {
  background-color: rgba(59, 130, 246, 0.1);
  color: #2563EB;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

html.dark .tag-orange {
  background-color: rgba(249, 115, 22, 0.15);
  color: #FDBA74;
  border: 1px solid rgba(249, 115, 22, 0.3);
}
html.light .tag-orange {
  background-color: rgba(249, 115, 22, 0.1);
  color: #EA580C;
  border: 1px solid rgba(249, 115, 22, 0.2);
}

/* ---------- Pricing Cards ---------- */
.pricing-card {
  border-radius: 1.25rem;
  border-width: 1.5px;
  border-style: solid;
  padding: 2rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

html.dark .pricing-card {
  background-color: #1E293B;
  border-color: #334155;
}
html.light .pricing-card {
  background-color: #FFFFFF;
  border-color: #E2E8F0;
}

.pricing-card.featured {
  border-color: var(--color-primary) !important;
  transform: scale(1.03);
}

html.dark .pricing-card.featured {
  background: linear-gradient(160deg, #1E293B 0%, #1a2744 100%);
  box-shadow: 0 0 50px rgba(59, 130, 246, 0.2);
}
html.light .pricing-card.featured {
  background: linear-gradient(160deg, #EFF6FF 0%, #DBEAFE 100%);
  box-shadow: 0 0 50px rgba(59, 130, 246, 0.15);
}

.pricing-card:hover:not(.featured) {
  transform: translateY(-6px);
}

/* ---------- Comparison Table ---------- */
.compare-table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 1rem;
  overflow: hidden;
}

html.dark .compare-table th {
  background-color: #1E293B;
  color: #94A3B8;
}
html.light .compare-table th {
  background-color: #F1F5F9;
  color: #475569;
}

html.dark .compare-table td {
  border-bottom: 1px solid #1E293B;
}
html.light .compare-table td {
  border-bottom: 1px solid #F1F5F9;
}

html.dark .compare-table tr:hover td {
  background-color: rgba(59, 130, 246, 0.04);
}
html.light .compare-table tr:hover td {
  background-color: rgba(59, 130, 246, 0.03);
}

/* ---------- Section Headings ---------- */
.section-title {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.5px;
}

.section-subtitle {
  font-size: 1rem;
  max-width: 100%;
  margin: 0 auto;
  line-height: 1.7;
}

html.dark .section-subtitle { color: #94A3B8; }
html.light .section-subtitle { color: #64748B; }

/* ---------- Theme Toggle ---------- */
.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-size: 1.1rem;
}

html.dark .theme-toggle {
  background-color: #1E293B;
  color: #FBBF24;
}
html.dark .theme-toggle:hover {
  background-color: #334155;
}
html.light .theme-toggle {
  background-color: #F1F5F9;
  color: #475569;
}
html.light .theme-toggle:hover {
  background-color: #E2E8F0;
}

/* ---------- Mobile Menu ---------- */
.mobile-menu {
  display: none;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  z-index: 99;
  padding: 1rem 1.25rem;
  flex-direction: column;
  gap: 0.25rem;
}

html.dark .mobile-menu {
  background-color: #0F172A;
  border-bottom: 1px solid #1E293B;
}
html.light .mobile-menu {
  background-color: #FFFFFF;
  border-bottom: 1px solid #E2E8F0;
}

.mobile-menu.open {
  display: flex;
}

/* ---------- FAQ Accordion ---------- */
.faq-item {
  border-radius: 0.75rem;
  border-width: 1px;
  border-style: solid;
  overflow: hidden;
  margin-bottom: 0.75rem;
  transition: all 0.2s ease;
}

html.dark .faq-item { border-color: #334155; background: #1E293B; }
html.light .faq-item { border-color: #E2E8F0; background: #FFFFFF; }

.faq-question {
  width: 100%;
  text-align: left;
  padding: 1.25rem 1.5rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
  border: none;
  font-size: 0.95rem;
}

html.dark .faq-question { color: #E2E8F0; }
html.light .faq-question { color: #0F172A; }

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 1.5rem;
  font-size: 0.9rem;
  line-height: 1.7;
}

html.dark .faq-answer { color: #94A3B8; }
html.light .faq-answer { color: #64748B; }

.faq-answer.open {
  max-height: 300px;
  padding: 0.25rem 1.5rem 1.25rem;
}

.faq-icon {
  transition: transform 0.3s ease;
  font-size: 1.2rem;
  color: var(--color-primary);
}
.faq-question.active .faq-icon {
  transform: rotate(45deg);
}

/* ---------- Client Area Sidebar ---------- */
.sidebar {
  width: 240px;
  height: calc(100vh - 64px);
  position: fixed;
  top: 64px;

  padding: 1.5rem 1rem;
  z-index: 50;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.4) transparent;
  transition: all 0.3s ease;
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background-color: rgba(148, 163, 184, 0.35);
  border-radius: 999px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background-color: rgba(148, 163, 184, 0.6);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  text-decoration: none;
  margin-bottom: 0.25rem;
}

html.dark .sidebar-link { color: #94A3B8; }
html.dark .sidebar-link:hover { color: #E2E8F0; background-color: rgba(255,255,255,0.05); }
html.dark .sidebar-link.active { color: var(--color-primary); background-color: rgba(59,130,246,0.1); }

html.light .sidebar-link { color: #64748B; }
html.light .sidebar-link:hover { color: #0F172A; background-color: rgba(0,0,0,0.04); }
html.light .sidebar-link.active { color: var(--color-primary); background-color: rgba(59,130,246,0.08); }

.main-content {
  margin-left: 240px;
  padding: 2rem 2.5rem;
  min-height: calc(100vh - 64px);
  transition: margin-left 0.3s ease;
}

/* ---------- Client Area Topbar ---------- */
.client-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
}

html.dark .client-topbar {
  background-color: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid #1E293B;
}
html.light .client-topbar {
  background-color: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid #E2E8F0;
}

/* ---------- Input Field ---------- */
.input-field {
  width: 100%;
  padding: 0.625rem 1rem;
  border-radius: 0.5rem;
  border-width: 1.5px;
  border-style: solid;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

/* ---------- Stats Card ---------- */
.stat-card {
  border-radius: 1rem;
  padding: 1.5rem;
  border-width: 1px;
  border-style: solid;
  transition: all 0.2s ease;
}

html.dark .stat-card {
  background-color: #1E293B;
  border-color: #334155;
}
html.light .stat-card {
  background-color: #FFFFFF;
  border-color: #E2E8F0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* ---------- Table ---------- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

html.dark .data-table th { color: #64748B; border-bottom: 1px solid #334155; }
html.light .data-table th { color: #94A3B8; border-bottom: 1px solid #E2E8F0; }

.data-table td {
  padding: 1rem 1rem;
  vertical-align: middle;
}

html.dark .data-table td { border-bottom: 1px solid #1E293B; color: #CBD5E1; }
html.light .data-table td { border-bottom: 1px solid #F8FAFC; color: #374151; }

.table-row { transition: background-color 0.15s ease; }

.data-table .empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: #64748B;
  font-size: 0.875rem;
}

/* ---------- Scrollbar ---------- */
html.dark ::-webkit-scrollbar { width: 6px; height: 6px; }
html.dark ::-webkit-scrollbar-track { background: #0F172A; }
html.dark ::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }

html.light ::-webkit-scrollbar { width: 6px; height: 6px; }
html.light ::-webkit-scrollbar-track { background: #F1F5F9; }
html.light ::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 3px; }

/* ---------- Animated Glow ---------- */
.glow-blue {
  box-shadow: 0 0 40px rgba(59, 130, 246, 0.3);
}

.glow-orange {
  box-shadow: 0 0 40px rgba(249, 115, 22, 0.3);
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: 240px;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
    padding: 1.25rem;
  }
}

/* ---------- Loading / Skeleton ---------- */
.skeleton {
  border-radius: 0.5rem;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

html.dark .skeleton { background-color: #1E293B; }
html.light .skeleton { background-color: #E2E8F0; }

@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ---------- WOW.js + animate.style compatibility ---------- */
/* animate.style v4 pakai prefix animate__ */
/* WOW.js akan inject class: animate__animated + animate__fadeInUp dll */
.wow { visibility: hidden; }
.wow.animate__animated { visibility: visible !important; }

/* Map nama animasi tanpa prefix → agar data-wow class tetap bisa dipakai */
/* Contoh: class="wow fadeInUp" → WOW inject "animate__animated fadeInUp" */
/* animate.style sudah handle nama tanpa prefix via compat layer-nya sendiri */
