@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Poppins:wght@400;500;600;700;800;900&display=swap');

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: rgba(240, 243, 248, 1);
  --fg: rgba(22, 28, 38, 1);
  --card: rgba(255, 255, 255, 1);
  --card-fg: rgba(22, 28, 38, 1);
  --primary: rgba(30, 115, 228, 1);
  --primary-fg: rgba(255, 255, 255, 1);
  --secondary: rgba(230, 234, 240, 1);
  --secondary-fg: rgba(22, 28, 38, 1);
  --muted: rgba(232, 236, 241, 1);
  --muted-fg: rgba(105, 117, 134, 1);
  --accent: rgba(232, 120, 22, 1);
  --accent-fg: rgba(255, 255, 255, 1);
  --success: rgba(22, 163, 74, 1);
  --warning: rgba(234, 157, 10, 1);
  --destructive: rgba(220, 50, 50, 1);
  --border: rgba(220, 225, 234, 1);
  --radius: 12px;
  --shadow-sm: 0 1px 3px rgba(22, 28, 38, 0.06);
  --shadow-md: 0 4px 12px rgba(22, 28, 38, 0.08);
  --shadow-lg: 0 8px 30px rgba(22, 28, 38, 0.1);
  --shadow-primary: 0 4px 20px rgba(30, 115, 228, 0.25);
  --gradient-primary: linear-gradient(135deg, rgba(30, 115, 228, 1), rgba(60, 140, 240, 1));
  --gradient-hero: linear-gradient(135deg, rgba(30, 115, 228, 1), rgba(70, 80, 180, 1));
  --gradient-accent: linear-gradient(135deg, rgba(232, 120, 22, 1), rgba(220, 80, 30, 1));
  --font-heading: 'Poppins', sans-serif;
  --font-body: 'Inter', sans-serif;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ===== LAYOUT ===== */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed; top: 0; left: 0; width: 280px; height: 100vh;
  background: var(--card); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; z-index: 40;
  transition: transform 0.3s ease;
}

.sidebar-logo {
  padding: 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}

.sidebar-logo-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--gradient-primary); display: flex;
  align-items: center; justify-content: center; color: var(--primary-fg);
  font-size: 18px; font-weight: 800;
}

.sidebar-logo-text { font-family: var(--font-heading); font-weight: 700; font-size: 1.1rem; }
.sidebar-logo-sub { font-size: 0.75rem; color: var(--muted-fg); }

.sidebar-search { padding: 16px; }
.sidebar-search input {
  width: 100%; padding: 10px 12px 10px 36px; border-radius: 8px;
  background: var(--secondary); border: none; font-size: 0.875rem;
  outline: none; color: var(--fg);
}
.sidebar-search input:focus { box-shadow: 0 0 0 2px rgba(30, 115, 228, 0.3); }
.sidebar-search { position: relative; }
.sidebar-search::before {
  content: '🔍'; position: absolute; left: 28px; top: 50%;
  transform: translateY(-50%); font-size: 14px; pointer-events: none;
}

.sidebar-nav { flex: 1; overflow-y: auto; padding: 0 12px 16px; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 8px; font-size: 0.875rem;
  font-weight: 500; color: var(--muted-fg); transition: all 0.2s;
  margin-bottom: 2px;
}
.sidebar-nav a:hover { background: var(--secondary); color: var(--fg); }
.sidebar-nav a.active {
  background: var(--primary); color: var(--primary-fg);
  box-shadow: var(--shadow-primary);
}

.sidebar-footer {
  padding: 16px; border-top: 1px solid var(--border);
}
.sidebar-footer-box {
  background: var(--secondary); border-radius: 8px; padding: 12px;
  text-align: center; font-size: 0.75rem; color: var(--muted-fg);
}
.sidebar-footer-box b { display: block; margin-top: 4px; color: var(--fg); }

.main-content {
  margin-left: 280px; flex: 1; min-height: 100vh;
}

.content-area { padding: 24px 32px; max-width: 1152px; }

/* ===== MOBILE ===== */
.mobile-toggle {
  display: none; position: fixed; top: 16px; left: 16px; z-index: 50;
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--card); box-shadow: var(--shadow-md);
  align-items: center; justify-content: center; font-size: 20px;
}
.mobile-overlay {
  display: none; position: fixed; inset: 0; z-index: 39;
  background: rgba(22, 28, 38, 0.2); backdrop-filter: blur(4px);
}

@media (max-width: 1023px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .mobile-toggle { display: flex; }
  .mobile-overlay.open { display: block; }
  .main-content { margin-left: 0; }
  .content-area { padding: 16px; padding-top: 64px; }
}

@media (max-width: 639px) {
  h1 { font-size: 1.75rem; }
  .hero-section { padding: 24px !important; }
  .hero-section h1 { font-size: 1.75rem !important; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr !important; }
}

/* ===== COMPONENTS ===== */
.section-card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow-md); padding: 24px;
  transition: all 0.3s ease;
}
.section-card:hover { box-shadow: var(--shadow-lg); }

.page-header { margin-bottom: 24px; }
.page-header h1 { margin-bottom: 4px; }
.page-header p { color: var(--muted-fg); font-size: 0.95rem; }

.badge {
  display: inline-flex; padding: 4px 12px; border-radius: 20px;
  font-size: 0.75rem; font-weight: 600; background: var(--secondary); color: var(--fg);
}
.badge-primary { background: rgba(30, 115, 228, 0.1); color: var(--primary); }
.badge-success { background: rgba(22, 163, 74, 0.1); color: var(--success); }

.stat-card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow-md); padding: 20px; text-align: center;
}
.stat-card .stat-icon {
  width: 48px; height: 48px; margin: 0 auto 12px; border-radius: 12px;
  background: rgba(30, 115, 228, 0.1); display: flex;
  align-items: center; justify-content: center; color: var(--primary);
  font-size: 1.25rem;
}
.stat-card .stat-value { font-size: 1.75rem; font-weight: 800; font-family: var(--font-heading); }
.stat-card .stat-label { font-size: 0.8rem; color: var(--muted-fg); margin-top: 4px; }

.progress-bar {
  width: 100%; height: 6px; background: var(--secondary);
  border-radius: 3px; overflow: hidden;
}
.progress-bar-fill {
  height: 100%; border-radius: 3px; background: var(--primary);
  transition: width 0.3s ease;
}
.progress-bar-fill.success { background: var(--success); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: var(--radius); font-weight: 600;
  font-size: 0.875rem; transition: all 0.2s; border: none;
}
.btn-primary {
  background: var(--gradient-primary); color: var(--primary-fg);
}
.btn-primary:hover { box-shadow: var(--shadow-primary); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-accent {
  background: var(--gradient-accent); color: var(--accent-fg);
}
.btn-secondary {
  background: var(--secondary); color: var(--fg);
}
.btn-secondary:hover { background: var(--muted); }
.btn-full { width: 100%; }

/* ===== INPUTS ===== */
.input {
  width: 100%; padding: 12px 16px; border-radius: var(--radius);
  background: var(--secondary); border: none; font-size: 0.875rem;
  outline: none; color: var(--fg);
}
.input:focus { box-shadow: 0 0 0 2px rgba(30, 115, 228, 0.3); }
.input-mono { font-family: monospace; }

.select {
  width: 100%; padding: 12px 16px; border-radius: var(--radius);
  background: var(--secondary); border: 1px solid var(--border);
  font-size: 0.875rem; outline: none; color: var(--fg);
  cursor: pointer;
}
.select:focus { box-shadow: 0 0 0 2px rgba(30, 115, 228, 0.3); }

/* ===== GRIDS ===== */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-1-2 { display: grid; grid-template-columns: 1fr 2fr; gap: 24px; }
.grid-2-col { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }

@media (max-width: 1023px) {
  .grid-1-2, .grid-2-col { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 639px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ===== HERO ===== */
.hero-section {
  background: var(--gradient-hero); border-radius: 16px;
  padding: 48px; margin-bottom: 32px; color: var(--primary-fg);
}
.hero-section h1 { font-size: 2.75rem; margin: 16px 0; }
.hero-section p { font-size: 1.1rem; opacity: 0.9; margin-bottom: 24px; max-width: 640px; }
.hero-buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-btn-light {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; background: var(--card); color: var(--fg);
  border-radius: var(--radius); font-weight: 600; font-size: 0.875rem;
  transition: all 0.2s; border: none;
}
.hero-btn-light:hover { box-shadow: var(--shadow-lg); }
.hero-btn-outline {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; background: rgba(255,255,255,0.2);
  color: var(--primary-fg); border-radius: var(--radius);
  font-weight: 600; font-size: 0.875rem; border: 1px solid rgba(255,255,255,0.3);
  transition: all 0.2s;
}
.hero-btn-outline:hover { background: rgba(255,255,255,0.3); }

/* ===== FEATURE CARD ===== */
.feature-card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow-md); padding: 24px;
  transition: all 0.3s; display: block;
}
.feature-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.feature-card-icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: rgba(30, 115, 228, 0.1); display: flex;
  align-items: center; justify-content: center;
  color: var(--primary); font-size: 1.5rem; margin-bottom: 16px;
  transition: all 0.3s;
}
.feature-card:hover .feature-card-icon {
  background: var(--primary); color: var(--primary-fg);
}
.feature-card h3 { margin-bottom: 4px; }
.feature-card p { font-size: 0.875rem; color: var(--muted-fg); }

/* ===== FILTER CHIPS ===== */
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.chip {
  padding: 8px 16px; border-radius: var(--radius); font-size: 0.875rem;
  font-weight: 500; background: var(--card); box-shadow: var(--shadow-sm);
  color: var(--fg); transition: all 0.2s; border: none;
}
.chip:hover { box-shadow: var(--shadow-md); }
.chip.active {
  background: var(--primary); color: var(--primary-fg);
  box-shadow: var(--shadow-primary);
}

/* ===== TARIFF CARD ===== */
.tariff-card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow-md); padding: 20px; position: relative;
  transition: all 0.3s;
}
.tariff-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.tariff-card.popular { box-shadow: 0 0 0 2px var(--primary), var(--shadow-md); }
.tariff-card .tariff-badge {
  position: absolute; top: -12px; left: 16px;
}
.tariff-price { font-size: 1.75rem; font-weight: 800; margin: 12px 0 16px; }
.tariff-price span { font-size: 0.875rem; font-weight: 400; color: var(--muted-fg); }
.tariff-features { list-style: none; margin-bottom: 16px; }
.tariff-features li {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.875rem; padding: 4px 0;
}
.tariff-features li::before { content: '✓'; color: var(--success); font-weight: 700; }

/* ===== OPERATOR CARD ===== */
.operator-card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow-md); padding: 20px; transition: all 0.3s;
}
.operator-card:hover { box-shadow: var(--shadow-lg); }
.operator-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.operator-rating {
  display: flex; align-items: center; gap: 4px;
  background: rgba(234, 157, 10, 0.1); padding: 4px 8px;
  border-radius: 8px; font-size: 0.875rem; font-weight: 700;
}
.operator-techs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 16px; }
.operator-prices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.operator-prices > div {
  background: var(--secondary); border-radius: 8px; padding: 8px;
  text-align: center; font-size: 0.75rem;
}
.operator-prices > div b { display: block; font-size: 0.875rem; }

/* ===== TABLE ===== */
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th { text-align: left; padding: 12px; font-weight: 600; border-bottom: 2px solid var(--border); }
td { padding: 10px 12px; border-bottom: 1px solid rgba(220, 225, 234, 0.5); }
tr:hover td { background: rgba(230, 234, 240, 0.5); }

/* ===== FAQ ACCORDION ===== */
.faq-item {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow-md); margin-bottom: 12px; overflow: hidden;
}
.faq-question {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 20px; text-align: left; background: none; border: none;
  font-weight: 700; font-size: 1rem; color: var(--fg); cursor: pointer;
  font-family: var(--font-heading); transition: background 0.2s;
}
.faq-question:hover { background: rgba(230, 234, 240, 0.5); }
.faq-arrow {
  font-size: 1.25rem; transition: transform 0.3s; flex-shrink: 0;
  color: var(--muted-fg);
}
.faq-item.open .faq-arrow { transform: rotate(180deg); }
.faq-answer {
  max-height: 0; overflow: hidden; transition: max-height 0.3s ease, padding 0.3s;
  padding: 0 20px; color: var(--muted-fg); line-height: 1.7;
}
.faq-item.open .faq-answer { max-height: 500px; padding: 0 20px 20px; }
.faq-answer b { color: var(--fg); }

/* ===== BLOG ===== */
.blog-card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow-md); padding: 24px; margin-bottom: 16px;
  transition: all 0.3s; cursor: pointer; display: block;
}
.blog-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.blog-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.blog-content { color: var(--muted-fg); line-height: 1.8; }
.blog-content h3 { color: var(--fg); margin: 24px 0 12px; }
.blog-content b { color: var(--fg); }

/* ===== RANGE SLIDER ===== */
input[type="range"] { width: 100%; accent-color: var(--primary); }

/* ===== RESULT TOTAL ===== */
.result-total {
  background: var(--gradient-primary); border-radius: var(--radius);
  padding: 20px; color: var(--primary-fg);
}
.result-total .label { font-size: 0.875rem; opacity: 0.8; }
.result-total .value { font-size: 2.25rem; font-weight: 800; }

/* ===== SPEED GAUGE ===== */
.speed-gauge {
  width: 192px; height: 192px; border-radius: 50%;
  border: 8px solid var(--secondary); display: flex;
  align-items: center; justify-content: center; position: relative;
  margin: 0 auto 24px;
}
.speed-gauge .spinner {
  position: absolute; inset: 0; border-radius: 50%;
  border: 8px solid var(--primary);
  border-top-color: transparent; border-right-color: transparent;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.speed-value { font-size: 1.875rem; font-weight: 800; font-family: monospace; }
.speed-unit { font-size: 0.875rem; color: var(--muted-fg); }

/* ===== MISC ===== */
.text-muted { color: var(--muted-fg); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-destructive { color: var(--destructive); }
.font-mono { font-family: monospace; }
.font-bold { font-weight: 700; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }
.mt-4 { margin-top: 16px; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.text-center { text-align: center; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.break-all { word-break: break-all; }
.space-y-3 > * + * { margin-top: 12px; }
.space-y-4 > * + * { margin-top: 16px; }
.list-disc { list-style: disc; padding-left: 24px; }
.list-disc li { margin-bottom: 8px; }

.info-block {
  background: rgba(30, 115, 228, 0.05);
  border: 1px solid rgba(30, 115, 228, 0.2);
  border-radius: var(--radius); padding: 16px;
}
.info-block .info-title {
  display: flex; align-items: center; gap: 8px;
  color: var(--primary); font-weight: 600; margin-bottom: 4px;
}
.info-block p { font-size: 0.875rem; color: var(--muted-fg); }

.warning-block {
  background: rgba(234, 157, 10, 0.1);
  border: 1px solid rgba(234, 157, 10, 0.3);
  border-radius: 8px; padding: 12px; font-size: 0.75rem;
  color: var(--muted-fg); margin-bottom: 16px;
}
.warning-block b { color: var(--fg); }

.data-box {
  background: var(--secondary); border-radius: var(--radius); padding: 16px;
}
.data-box .data-label { font-size: 0.75rem; color: var(--muted-fg); margin-bottom: 4px; }
.data-box .data-value { font-weight: 700; font-family: monospace; }

.country-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-radius: 8px; font-size: 0.875rem;
  transition: all 0.2s; background: none; border: none; color: var(--fg);
  text-align: left;
}
.country-btn:hover { background: var(--secondary); }
.country-btn.active { background: var(--primary); color: var(--primary-fg); }

.result-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid rgba(220, 225, 234, 0.5);
  font-size: 0.875rem;
}

.tech-card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow-md); padding: 24px; margin-bottom: 24px;
  display: flex; gap: 24px;
}
.tech-icon {
  width: 64px; height: 64px; border-radius: 16px; flex-shrink: 0;
  background: rgba(30, 115, 228, 0.1); display: flex;
  align-items: center; justify-content: center;
  color: var(--primary); font-size: 2rem;
}
@media (max-width: 639px) {
  .tech-card { flex-direction: column; }
}

.value-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(105, 117, 134, 0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(105, 117, 134, 0.5); }

/* Animations */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.animate-fade-in { animation: fadeIn 0.5s ease-out; }
.animate-slide-up { animation: slideUp 0.5s ease-out; }

/* Smooth transitions */
a, button, input, select { transition: all 0.2s ease; }

/* Canvas */
canvas { display: block; width: 100%; border-radius: var(--radius); border: 1px solid var(--border); }

/* Hidden class */
.hidden { display: none !important; }
