/* ===========================
   MODERN VPN DASHBOARD DESIGN
   Premium & Clean UI/UX
   =========================== */

:root {
  /* Dark Theme (Default) */
  --bg-primary: #0f0f17;
  --bg-secondary: #18182a;
  --bg-card: rgba(24, 24, 42, 0.6);
  --bg-hover: #202038;
  --bg-glass: rgba(255, 255, 255, 0.03);
  
  --text-primary: #f5f5f7;
  --text-secondary: #b0b0c0;
  --text-muted: #7a7a8e;
  
  --accent: #00d9ff;
  --accent-hover: #00b8dd;
  --accent-glow: rgba(0, 217, 255, 0.35);
  --accent-soft: rgba(0, 217, 255, 0.1);
  
  --success: #00e67a;
  --success-glow: rgba(0, 230, 122, 0.25);
  --warning: #ffa726;
  --danger: #ff4757;
  --purple: #9370ff;
  
  --border-main: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(0, 217, 255, 0.3);
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 24px var(--accent-glow);
  
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --bg-primary: #f8f9fa;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-hover: #f0f1f3;
  --bg-glass: rgba(255, 255, 255, 0.6);
  
  --text-primary: #1a1a2e;
  --text-secondary: #4a4a5e;
  --text-muted: #8a8a9e;
  
  --border-main: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(0, 217, 255, 0.4);
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.08);
}

/* ===========================
   RESET & BASE
   =========================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Vazirmatn', 'Inter', -apple-system, system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  padding-bottom: 80px;
  padding-bottom: calc(80px + env(safe-area-inset-bottom));
}

html {
  height: -webkit-fill-available;
}

/* Gradient Background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: 
    radial-gradient(circle at 20% 20%, rgba(0, 217, 255, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(147, 112, 255, 0.08) 0%, transparent 40%);
  z-index: -1;
  pointer-events: none;
}

/* ===========================
   TOPBAR
   =========================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  padding: 0.875rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .topbar {
  background: rgba(18, 18, 32, 0.95);
  border-bottom: 1px solid var(--border-main);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.topbar__left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 0;
}

.page-title {
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
  transition: transform 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #4a4a5e;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 1.25rem;
}

[data-theme="dark"] .btn-icon {
  background: var(--bg-glass);
  border: 1px solid var(--border-main);
  color: var(--text-secondary);
}

.btn-icon:hover {
  background: rgba(0, 217, 255, 0.08);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 4px 12px var(--accent-glow);
}

[data-theme="dark"] .btn-icon:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
}

.btn-icon:active {
  transform: translateY(0) scale(0.98);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: #4a4a5e;
}

[data-theme="dark"] .status-indicator {
  background: var(--bg-glass);
  border: 1px solid var(--border-main);
  color: var(--text-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 12px var(--success-glow);
  animation: statusPulse 2s ease-in-out infinite;
  position: relative;
}

.status-dot::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: var(--success);
  opacity: 0.3;
  animation: statusRipple 2s ease-out infinite;
}

@keyframes statusPulse {
  0%, 100% {
    box-shadow: 0 0 12px var(--success-glow);
  }
  50% {
    box-shadow: 0 0 20px var(--success-glow), 0 0 8px var(--success);
  }
}

@keyframes statusRipple {
  0% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

.last-update {
  font-size: 0.75rem;
  color: #7a7a8e;
  font-family: 'JetBrains Mono', monospace;
  padding: 0.5rem 0.75rem;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-sm);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

[data-theme="dark"] .last-update {
  color: var(--text-muted);
  background: var(--bg-glass);
  border: 1px solid var(--border-main);
}

/* ===========================
   MAIN CONTENT
   =========================== */
.main-content {
  padding: 1.5rem 1.25rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.page {
  display: none;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.page.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===========================
   CARDS
   =========================== */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-sm);
}

.card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.glass-card {
  background: var(--bg-glass);
}

.card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  gap: 1rem;
}

.card__header-content {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  flex: 1;
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent), var(--purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 16px var(--accent-glow);
  flex-shrink: 0;
  transition: all var(--transition-normal);
  overflow: hidden;
  position: relative;
  animation: iconGlow 3s ease-in-out infinite;
}

.card-icon::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.card:hover .card-icon {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 6px 24px var(--accent-glow);
}

.card:hover .card-icon::before {
  opacity: 1;
}

.card-icon svg {
  width: 32px !important;
  height: 32px !important;
}

@keyframes iconGlow {
  0%, 100% {
    box-shadow: 0 4px 16px var(--accent-glow);
  }
  50% {
    box-shadow: 0 4px 24px var(--accent-glow), 0 0 16px var(--accent-glow);
  }
}

.lottie-icon,
#theme-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: all var(--transition-normal);
}

#theme-toggle:hover #theme-icon {
  transform: rotate(20deg) scale(1.1);
  filter: drop-shadow(0 2px 8px var(--accent-glow));
}

#theme-toggle:active #theme-icon {
  transform: rotate(180deg) scale(0.9);
}

.lottie-icon svg {
  width: 100% !important;
  height: 100% !important;
}

.card__header h2,
.card__header h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.card__header p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0.125rem 0 0 0;
}

.card__actions {
  display: flex;
  gap: 0.5rem;
}

.card__actions .btn-icon {
  font-size: 1.125rem;
  background: var(--bg-glass);
  transition: all var(--transition-fast);
}

.card__actions .btn-icon:hover {
  background: var(--accent-soft);
  transform: translateY(-2px) scale(1.1);
  filter: drop-shadow(0 4px 8px var(--accent-glow));
}

.card__actions .btn-icon:active {
  transform: translateY(0) scale(1);
}

/* ===========================
   STATS SECTION
   =========================== */
.stats-section {
  margin-top: 1.5rem;
}

.stats-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.stats-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.usage-progress-card {
  background: linear-gradient(135deg, rgba(0, 217, 255, 0.08), rgba(147, 112, 255, 0.08));
  border: 1px solid var(--border-main);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-md);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.progress-header span:first-child {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.progress-percent {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.progress-bar-container {
  position: relative;
  height: 16px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 1.25rem;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.15);
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--purple));
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  box-shadow: 0 0 16px var(--accent-glow);
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0%, 100% { transform: translateX(-100%); }
  50% { transform: translateX(100%); }
}

.progress-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.progress-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.progress-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.progress-value {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
}

.progress-value.remaining {
  color: var(--success);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.stat-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-md), 0 0 20px var(--accent-glow);
}

.stat-card:active {
  transform: translateY(-2px) scale(1);
}

.stat-card__icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
  transition: all var(--transition-fast);
}

.stat-card:hover .stat-card__icon {
  transform: scale(1.15) rotate(5deg);
  filter: drop-shadow(0 4px 8px var(--accent-glow));
}

.stat-card__label {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.5rem;
}

.stat-card__value {
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--text-primary);
  display: block;
  font-family: 'JetBrains Mono', monospace;
}

/* ===========================
   CONFIG DETAILS
   =========================== */
.config-info-message,
.info-message-content {
  margin-bottom: 1rem;
}

.info-text {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.config-details {
  display: grid;
  gap: 0.875rem;
}

.config-detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.875rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.config-detail-item:hover {
  border-color: var(--border-hover);
  background: var(--bg-hover);
}

.detail-label {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
}

.detail-icon {
  font-size: 1.125rem;
}

.protocol-badge {
  padding: 0.375rem 0.875rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.protocol-vless {
  background: linear-gradient(135deg, #00d9ff, #0099ff);
  color: white;
  box-shadow: 0 4px 12px rgba(0, 217, 255, 0.3);
}

.protocol-vmess {
  background: linear-gradient(135deg, #9370ff, #7a52ff);
  color: white;
  box-shadow: 0 4px 12px rgba(147, 112, 255, 0.3);
}

.protocol-trojan {
  background: linear-gradient(135deg, #ff6b6b, #ff4757);
  color: white;
  box-shadow: 0 4px 12px rgba(255, 71, 87, 0.3);
}

/* ===========================
   QR CODE
   =========================== */
.qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
}

.qr-wrapper {
  position: relative;
  padding: 1rem;
  background: white;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  max-width: 100%;
}

.qr-wrapper canvas,
.qr-wrapper img,
.qr-image {
  display: block;
  border-radius: var(--radius-sm);
  max-width: 100%;
  height: auto !important;
  width: auto !important;
}

.qr-hint {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
}

.qr-error {
  color: var(--danger);
  font-size: 0.875rem;
  text-align: center;
  padding: 1rem;
}

/* ===========================
   BUTTONS
   =========================== */
.btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  padding: 0.875rem 1.25rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: inherit;
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:active {
  transform: translateY(0);
}

.btn-danger {
  background: rgba(255, 71, 87, 0.1);
  border-color: rgba(255, 71, 87, 0.3);
  color: var(--danger);
}

.btn-danger:hover {
  background: rgba(255, 71, 87, 0.2);
  border-color: var(--danger);
}

/* ===========================
   BOTTOM NAVIGATION
   =========================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 99;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  padding: 0.625rem 0.75rem 0.5rem;
  padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
  box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .bottom-nav {
  background: rgba(18, 18, 32, 0.98);
  border-top: 1px solid var(--border-main);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
}

.bottom-nav__container {
  display: flex;
  justify-content: space-around;
  align-items: center;
  max-width: 600px;
  margin: 0 auto;
  gap: 0.5rem;
}

.bottom-nav__item {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.5rem 0.25rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  color: #8a8a9e;
  font-family: inherit;
}

[data-theme="dark"] .bottom-nav__item {
  color: var(--text-muted);
}

.bottom-nav__item:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.bottom-nav__item.active {
  color: var(--accent);
}

.bottom-nav__icon-wrapper {
  position: relative;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.bottom-nav__item.active .bottom-nav__icon-wrapper {
  background: var(--accent-soft);
  box-shadow: 0 0 16px var(--accent-glow);
}

.bottom-nav__icon {
  font-size: 1.25rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-normal);
  filter: grayscale(0.3);
}

.bottom-nav__icon svg {
  width: 100% !important;
  height: 100% !important;
}

.bottom-nav__item.active .bottom-nav__icon {
  transform: scale(1.15);
  animation: iconPop 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  filter: grayscale(0) drop-shadow(0 2px 4px var(--accent-glow));
}

.bottom-nav__item:hover .bottom-nav__icon {
  transform: scale(1.1);
  filter: grayscale(0);
}

@keyframes iconPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.3) rotate(5deg); }
  100% { transform: scale(1.15); }
}

.bottom-nav__label {
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.bottom-nav__indicator {
  position: absolute;
  bottom: -0.75rem;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 24px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--purple));
  border-radius: 999px;
  transition: transform var(--transition-normal);
}

.bottom-nav__item.active .bottom-nav__indicator {
  transform: translateX(-50%) scaleX(1);
}

/* ===========================
   EMPTY STATE
   =========================== */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}

.empty-icon-animated {
  font-size: 5rem;
  margin-bottom: 1.5rem;
  display: inline-block;
  animation: float 3s ease-in-out infinite;
  opacity: 0.7;
  filter: drop-shadow(0 8px 16px rgba(0, 217, 255, 0.3));
  transition: all var(--transition-normal);
}

.empty-icon-animated:hover {
  opacity: 1;
  transform: scale(1.1);
  filter: drop-shadow(0 12px 24px rgba(0, 217, 255, 0.5));
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

.empty-state h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.empty-state p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ===========================
   GUIDE PAGE
   =========================== */
.guide-content {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
}

.app-item {
  text-align: center;
  padding: 1.25rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.app-item:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.app-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
  transition: all var(--transition-fast);
  display: inline-block;
}

.app-item:hover .app-icon {
  transform: scale(1.2) rotate(-5deg);
  filter: drop-shadow(0 6px 12px var(--accent-glow));
}

.app-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.app-platform {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.steps-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.step-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.125rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px var(--accent-glow);
  transition: all var(--transition-fast);
  position: relative;
}

.step-number::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  opacity: 0;
  transition: opacity var(--transition-fast);
  z-index: -1;
  filter: blur(8px);
}

.step-item:hover .step-number {
  transform: scale(1.1);
  box-shadow: 0 6px 16px var(--accent-glow);
}

.step-item:hover .step-number::before {
  opacity: 0.6;
}

.step-content h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.375rem;
}

.step-content p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.platform-tabs {
  display: grid;
  gap: 1rem;
}

.platform-item {
  padding: 1.25rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.platform-item:hover {
  border-color: var(--border-hover);
  background: var(--bg-hover);
}

.platform-item h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.625rem;
}

.platform-item p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ===========================
   SETTINGS PAGE
   =========================== */
.settings-section {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.settings-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.setting-item:hover {
  border-color: var(--border-hover);
  background: var(--bg-hover);
}

.setting-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.setting-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.setting-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.toggle-switch {
  position: relative;
  width: 48px;
  height: 26px;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 999px;
  transition: all var(--transition-fast);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: all var(--transition-fast);
}

.toggle-switch input:checked + .toggle-slider {
  background: linear-gradient(135deg, var(--accent), var(--purple));
  box-shadow: 0 0 12px var(--accent-glow);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(22px);
}

.setting-select {
  padding: 0.5rem 0.875rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.setting-select:hover {
  border-color: var(--border-hover);
}

.settings-actions {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.about-info {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.about-item {
  display: flex;
  justify-content: space-between;
  padding: 0.875rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-sm);
}

.about-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.about-value {
  font-size: 0.875rem;
  color: var(--text-primary);
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}

/* ===========================
   TOAST NOTIFICATIONS
   =========================== */
.toast-container {
  position: fixed;
  top: 5rem;
  right: 1.5rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.875rem;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease;
  pointer-events: all;
  min-width: 280px;
  max-width: 400px;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast.success {
  border-left: 4px solid var(--success);
}

.toast.error {
  border-left: 4px solid var(--danger);
}

.toast.warning {
  border-left: 4px solid var(--warning);
}

.toast__icon {
  font-size: 1.5rem;
}

.toast__message {
  flex: 1;
  font-size: 0.875rem;
  color: var(--text-primary);
  font-weight: 500;
}

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 768px) {
  body {
    padding-bottom: 75px;
}

  .topbar {
    padding: 0.75rem 1rem;
  }
  
  .topbar__left {
    flex: 1;
    min-width: 0;
}

  .page-title {
    font-size: 1.1rem;
  }
  
  .topbar__right {
    gap: 0.5rem;
}

  .btn-icon {
    width: 36px;
    height: 36px;
    font-size: 1.125rem;
}

  .status-indicator {
    padding: 0.375rem 0.625rem;
    font-size: 0.75rem;
}

  .status-dot {
    width: 6px;
    height: 6px;
}

  .last-update {
    font-size: 0.7rem;
    padding: 0.375rem 0.625rem;
}

  .main-content {
    padding: 1rem;
  }

  .card {
    padding: 1.125rem;
    margin-bottom: 1rem;
  }

  .card__header {
    flex-wrap: wrap;
    margin-bottom: 1rem;
  }
  
  .card-icon {
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
  }
  
  .card-icon svg {
    width: 28px !important;
    height: 28px !important;
  }

  .empty-icon-animated {
    font-size: 4rem;
  }

  .stat-card__icon {
    font-size: 1.75rem;
  }
  
  .app-icon {
    font-size: 2.25rem;
  }

  .card__header h2,
  .card__header h3 {
    font-size: 1rem;
  }
  
  .card__header p {
    font-size: 0.75rem;
  }

  .card__actions {
    gap: 0.375rem;
  }

  .card__actions .btn-icon {
    width: 34px;
    height: 34px;
    font-size: 1.05rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.875rem;
  }
  
  .stat-card {
    padding: 1rem;
  }
  
  .stat-card__icon {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
  }
  
  .stat-card__value {
    font-size: 1.25rem;
  }
  
  .apps-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.875rem;
  }
  
  .app-item {
    padding: 1rem;
  }
  
  .usage-progress-card {
    padding: 1.25rem;
  }
  
  .progress-percent {
    font-size: 1.25rem;
  }
  
  .progress-bar-container {
    height: 14px;
    margin-bottom: 1rem;
  }
  
  .progress-details {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .progress-item {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  
  .progress-value {
    font-size: 1rem;
  }
  
  .qr-container {
    padding: 1rem;
    gap: 0.75rem;
  }
  
  .qr-wrapper {
    padding: 0.75rem;
    max-width: 240px;
  }
  
  .qr-wrapper canvas,
  .qr-wrapper img,
  .qr-image {
    max-width: 240px !important;
    width: 240px !important;
    height: 240px !important;
  }
  
  .qr-hint {
    font-size: 0.8rem;
  }
  
  .qr-download-btn,
  .btn-secondary {
    font-size: 0.8rem;
    padding: 0.75rem 1rem;
  }
  
  .info-text {
    font-size: 0.8rem;
  }

  .config-details {
    gap: 0.75rem;
  }

  .config-detail-item {
    padding: 0.75rem;
    font-size: 0.85rem;
  }

  .detail-label {
    font-size: 0.8rem;
  }
  
  .detail-icon {
    font-size: 1rem;
  }
  
  .protocol-badge {
    font-size: 0.7rem;
    padding: 0.3rem 0.75rem;
  }
  
  .step-number {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }
  
  .step-content h4 {
    font-size: 0.95rem;
  }
  
  .platform-item {
    padding: 1rem;
  }
  
  .bottom-nav {
    padding: 0.5rem 0.5rem 0.375rem;
  }
  
  .bottom-nav__container {
    gap: 0.25rem;
  }

  .bottom-nav__icon-wrapper {
    width: 32px;
    height: 32px;
  }

  .bottom-nav__label {
    font-size: 0.675rem;
  }
  
  .bottom-nav__icon {
    font-size: 1.15rem;
    width: 22px;
    height: 22px;
  }
}

@media (max-width: 480px) {
  body {
    padding-bottom: 70px;
  }

  .topbar {
    padding: 0.625rem 0.875rem;
  }

  .page-title {
    font-size: 1rem;
  }
  
  .topbar__right {
    gap: 0.375rem;
  }
  
  .btn-icon {
    width: 34px;
    height: 34px;
    font-size: 1rem;
  }
  
  .status-indicator {
    display: none;
  }

  .last-update {
    display: none;
  }
  
  .main-content {
    padding: 0.875rem;
  }
  
  .card {
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 0.875rem;
  }
  
  .card-icon {
    width: 36px;
    height: 36px;
    font-size: 1.125rem;
}

  .empty-icon-animated {
    font-size: 3.5rem;
}

  .stat-card__icon {
    font-size: 1.5rem;
}

  .app-icon {
    font-size: 2rem;
}

  .step-number {
    width: 36px;
    height: 36px;
    font-size: 1rem;
}

  .card__header h2,
  .card__header h3 {
    font-size: 0.95rem;
}

  .card__header p {
    font-size: 0.7rem;
}

  .card__actions .btn-icon {
    width: 32px;
    height: 32px;
    font-size: 1rem;
}

  .config-detail-item {
    padding: 0.625rem;
    font-size: 0.8rem;
  }
  
  .detail-label {
    font-size: 0.75rem;
}

  .protocol-badge {
    font-size: 0.65rem;
    padding: 0.25rem 0.625rem;
}

  .stats-grid {
    gap: 0.75rem;
  }
  
  .stat-card {
    padding: 0.875rem;
}

  .stat-card__icon {
    font-size: 1.5rem;
}

  .stat-card__value {
    font-size: 1.125rem;
}

  .usage-progress-card {
    padding: 1rem;
}

  .progress-percent {
    font-size: 1.125rem;
  }
  
  .progress-bar-container {
    height: 12px;
  }
  
  .progress-value {
    font-size: 0.95rem;
  }
  
  .apps-grid {
    gap: 0.75rem;
}

  .app-item {
    padding: 0.875rem;
  }
  
  .app-icon {
    font-size: 2rem;
  margin-bottom: 0.5rem;
}

  .qr-container {
    padding: 0.875rem;
    gap: 0.625rem;
}

  .qr-wrapper {
    padding: 0.625rem;
    max-width: 200px;
  }
  
  .qr-wrapper canvas,
  .qr-wrapper img,
  .qr-image {
    max-width: 200px !important;
    width: 200px !important;
    height: 200px !important;
}

  .qr-hint {
    font-size: 0.75rem;
}

  .qr-download-btn,
  .btn-secondary {
    font-size: 0.75rem;
    padding: 0.625rem 0.875rem;
  }
  
  .info-text {
    font-size: 0.75rem;
}

  .config-details {
    gap: 0.625rem;
  }
  
  .step-number {
    width: 32px;
    height: 32px;
    font-size: 0.95rem;
  }
  
  .step-content h4 {
    font-size: 0.9rem;
}

  .step-content p {
    font-size: 0.8rem;
  }
  
  .bottom-nav {
    padding: 0.375rem 0.375rem 0.25rem;
  }
  
  .bottom-nav__container {
    gap: 0.125rem;
}

  .bottom-nav__item {
    gap: 0.2rem;
    padding: 0.375rem 0.125rem;
}

  .bottom-nav__icon-wrapper {
    width: 30px;
    height: 30px;
}

  .bottom-nav__label {
    font-size: 0.625rem;
}

  .bottom-nav__icon {
    font-size: 1.05rem;
    width: 20px;
    height: 20px;
}

  .empty-state {
    padding: 2.5rem 1.25rem;
}

  .empty-state h3 {
    font-size: 1.125rem;
}

  .empty-state p {
    font-size: 0.85rem;
}

  .empty-icon-animated {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

  .toast-container {
    right: 1rem;
    left: 1rem;
}

  .toast {
    min-width: auto;
    max-width: 100%;
}
}

@media (max-width: 380px) {
  .page-title {
    font-size: 0.95rem;
}

  .btn-icon {
    width: 32px;
    height: 32px;
    font-size: 0.95rem;
}

  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .bottom-nav__label {
    font-size: 0.6rem;
  }
  
  .bottom-nav__icon {
    font-size: 1rem;
    width: 18px;
    height: 18px;
}
}

/* ===========================
   PAGE HEADER
   =========================== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

.page-header h2 {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.page-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.history-filters {
  display: flex;
  gap: 0.625rem;
}

.filter-btn {
  padding: 0.625rem 1rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: inherit;
}

.filter-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.filter-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--purple));
  border-color: transparent;
  color: white;
  box-shadow: 0 4px 12px var(--accent-glow);
}

@media (max-width: 768px) {
  .page-header {
  flex-direction: column;
    gap: 0.875rem;
    margin-bottom: 1.25rem;
  }
  
  .page-header h2 {
    font-size: 1.25rem;
  }
  
  .page-subtitle {
    font-size: 0.8rem;
}

  .history-filters {
    display: flex;
    gap: 0.5rem;
    width: 100%;
}

  .filter-btn {
    flex: 1;
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
}
}

@media (max-width: 480px) {
  .page-header h2 {
    font-size: 1.125rem;
}

  .filter-btn {
    font-size: 0.75rem;
    padding: 0.5rem 0.625rem;
}
}

/* ===========================
   LOADING OVERLAY
   =========================== */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 23, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

.loading-spinner {
  position: relative;
  width: 80px;
  height: 80px;
}

.spinner-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 4px solid transparent;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

.spinner-ring:nth-child(2) {
  border-top-color: var(--purple);
  animation-delay: -0.5s;
  width: 90%;
  height: 90%;
  top: 5%;
  left: 5%;
}

.spinner-ring:nth-child(3) {
  border-top-color: var(--success);
  animation-delay: -1s;
  width: 80%;
  height: 80%;
  top: 10%;
  left: 10%;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.loading-text {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 600;
  animation: pulse 1.5s ease-in-out infinite;
  }
  
@keyframes pulse {
  0%, 100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

/* ===========================
   UTILITIES
   =========================== */
.text-gradient {
  background: linear-gradient(135deg, var(--accent), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  }

