:root {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --border: #334155;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --radius: 16px;
  --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}
.light {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --border: #e2e8f0;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  transition:
    background-color 0.3s,
    border-color 0.3s,
    color 0.3s,
    box-shadow 0.3s;
}
body {
  font-family:
    "Inter",
    "Segoe UI",
    system-ui,
    -apple-system,
    sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 1.5rem 1rem 3rem;
  background-image: radial-gradient(
    ellipse at top,
    rgba(59, 130, 246, 0.08) 0%,
    transparent 60%
  );
}
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(12px);
  transition: all 0.3s;
}
.glass-card:hover {
  border-color: rgba(59, 130, 246, 0.35);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 0.7rem 1.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  user-select: none;
  outline: none;
  border: 1px solid transparent;
}
.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.35);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn-success {
  background: var(--success);
  color: #fff;
}
.btn-success:hover {
  background: #16a34a;
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.35);
}
.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover {
  background: #dc2626;
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.35);
}
.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.7rem 1.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  user-select: none;
  outline: none;
}
.btn-outline:hover {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.08);
}
.btn-outline:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.input-field {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.7rem 1rem;
  color: var(--text-primary);
  font-size: 0.95rem;
  width: 100%;
  outline: none;
  transition: all 0.2s;
}
.input-field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}
.tab-btn {
  padding: 0.6rem 1.2rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
  color: var(--text-secondary);
  background: transparent;
  white-space: nowrap;
  user-select: none;
}
.tab-btn.active {
  background: rgba(59, 130, 246, 0.12);
  color: var(--accent);
  border-color: rgba(59, 130, 246, 0.3);
}
.tab-btn:hover:not(.active) {
  background: rgba(59, 130, 246, 0.06);
  color: var(--text-primary);
}
.circular-progress {
  transform: rotate(-90deg);
  transition: stroke-dashoffset 0.5s ease;
}
.circular-progress-bg {
  transform: rotate(-90deg);
}
.log-entry {
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  margin-bottom: 0.25rem;
  font-size: 0.85rem;
  line-height: 1.5;
  animation: fadeIn 0.3s ease;
  border-left: 3px solid var(--border);
  word-break: break-word;
}
.log-entry.log-info {
  border-left-color: #3b82f6;
  background: rgba(59, 130, 246, 0.05);
}
.log-entry.log-success {
  border-left-color: #22c55e;
  background: rgba(34, 197, 94, 0.05);
}
.log-entry.log-warning {
  border-left-color: #f59e0b;
  background: rgba(245, 158, 11, 0.05);
}
.log-entry.log-error {
  border-left-color: #ef4444;
  background: rgba(239, 68, 68, 0.05);
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes pulse-glow {
  0%,
  100% {
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.4);
  }
  50% {
    box-shadow: 0 0 40px rgba(34, 197, 94, 0.7);
  }
}
.running-glow {
  animation: pulse-glow 1.5s ease-in-out infinite;
}
.region-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 1rem;
  border-radius: 40px;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  user-select: none;
}
.region-chip.active {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent);
}
.region-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.stat-card {
  padding: 1rem 1.2rem;
  border-radius: 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  text-align: center;
}
.stat-card .stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
}
.stat-card .stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}
.toast {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  z-index: 1000;
  animation:
    slideIn 0.3s ease,
    fadeOut 0.3s ease 2.5s forwards;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  max-width: 380px;
  word-break: break-word;
}
.toast-success {
  background: #22c55e;
  color: #fff;
}
.toast-error {
  background: #ef4444;
  color: #fff;
}
.toast-info {
  background: #3b82f6;
  color: #fff;
}
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateX(20%);
  }
}
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
  padding: 1rem;
}
.modal-content {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 2rem;
  max-width: 520px;
  width: 100%;
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  max-height: 85vh;
  overflow-y: auto;
}
@media (max-width: 640px) {
  .stat-card .stat-value {
    font-size: 1.4rem;
  }
  .tab-btn {
    padding: 0.5rem 0.8rem;
    font-size: 0.75rem;
  }
  body {
    padding: 0.75rem 0.5rem 2rem;
  }
  .modal-content {
    padding: 1.25rem;
  }
}
.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s;
  text-decoration: none;
  user-select: none;
}
.social-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}
.perm-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.2rem;
  border-radius: 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  transition: all 0.25s;
}
.perm-card:hover {
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}
.perm-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.1);
}
.perm-badge {
  font-size: 0.7rem;
  padding: 0.25rem 0.7rem;
  border-radius: 20px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  white-space: nowrap;
}
.perm-badge.granted {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}
.perm-badge.denied {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}
.perm-badge.pending {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}
.perm-badge.auto {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}
.social-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem 1.5rem;
  border-radius: 16px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.25s;
  border: 1px solid var(--border);
  color: inherit;
  user-select: none;
}
.social-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  border-color: rgba(59, 130, 246, 0.4);
}
.social-card .social-icon {
  font-size: 2rem;
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  color: #fff;
}
.social-card .social-title {
  font-weight: 700;
  font-size: 1.05rem;
}
.social-card .social-sub {
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.social-card .social-arrow {
  margin-left: auto;
  color: var(--text-secondary);
  font-size: 1.2rem;
  transition: transform 0.2s;
}
.social-card:hover .social-arrow {
  transform: translateX(4px);
  color: var(--accent);
}
.divider-custom {
  height: 1px;
  background: var(--border);
  margin: 1.5rem 0;
  position: relative;
}
.divider-custom::after {
  content: "✦";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--text-secondary);
  font-size: 0.8rem;
  background: var(--bg-primary);
  padding: 0 0.8rem;
}
.badge-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: blink 1s ease-in-out infinite;
}
@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}
.tooltip-trigger {
  position: relative;
  cursor: help;
}
.tooltip-trigger .tooltip-text {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-primary);
  color: var(--bg-primary);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  z-index: 100;
  transition: all 0.2s;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.tooltip-trigger:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}
.badge-dot.green {
  background: #22c55e;
}
.badge-dot.yellow {
  background: #f59e0b;
}
.badge-dot.red {
  background: #ef4444;
}
