/* Import premium fonts */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Inter:wght@400;500;600&display=swap');
@import url('custom-dropdown.css');

:root {
  /* Colors - Deep Space Theme (Default Dark) */
  --bg-dark: #020617;
  /* Slate 950 */
  --bg-card: rgba(30, 41, 59, 0.7);
  /* Slate 800 with opacity */
  --bg-glass: rgba(15, 23, 42, 0.6);
  --bg-sidebar: rgba(2, 6, 23, 0.95);
  --bg-header: rgba(2, 6, 23, 0.8);

  --primary: #06b6d4;
  /* Cyan 500 */
  --primary-glow: rgba(6, 182, 212, 0.5);
  --secondary: #8b5cf6;
  /* Violet 500 */
  --secondary-glow: rgba(139, 92, 246, 0.5);
  --accent: #10b981;
  /* Emerald 500 */
  --primary-gradient: linear-gradient(135deg, var(--primary) 0%, #0891b2 100%);

  --text-main: #f8fafc;
  /* Slate 50 */
  --text-muted: #94a3b8;
  /* Slate 400 */
  --text-inverse: #020617;

  --border-glass: rgba(255, 255, 255, 0.1);
  --border-highlight: rgba(255, 255, 255, 0.2);

  --input-bg: rgba(0, 0, 0, 0.2);

  /* Spacing */
  --container-width: 1200px;
  --header-height: 80px;

  /* Animation */
  --transition-fast: 0.2s ease;
  --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

  /* API Section Variables (Dark Default) */
  --api-card-bg: linear-gradient(135deg, rgba(6, 182, 212, 0.05) 0%, rgba(139, 92, 246, 0.1) 100%);
  --api-card-border: rgba(139, 92, 246, 0.2);
  --api-card-shadow: 0 0 50px rgba(139, 92, 246, 0.05);
  /* Softer shadow */
  --api-text-gradient: linear-gradient(to right, #67e8f9, #c084fc);
  /* Bright Cyan to Soft Purple */
  --api-badge-bg: rgba(139, 92, 246, 0.1);
  --api-badge-border: rgba(139, 92, 246, 0.3);
  --api-badge-text: #e9d5ff;
  --api-glow-color: var(--secondary);
}

/* Scroll Animation Utilities */
.scroll-animate {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.scroll-animate.visible {
  opacity: 1;
  transform: translateY(0);
}


[data-theme="light"] {
  --bg-dark: #f8fafc;
  /* Slate 50 */
  --bg-card: rgba(255, 255, 255, 0.8);
  --bg-glass: rgba(255, 255, 255, 0.6);
  --bg-sidebar: #ffffff;
  --bg-header: rgba(255, 255, 255, 0.8);

  --text-main: #0f172a;
  /* Slate 900 */
  --text-muted: #64748b;
  /* Slate 500 */
  --text-inverse: #f8fafc;

  --border-glass: rgba(0, 0, 0, 0.1);
  --border-highlight: rgba(6, 182, 212, 0.5);

  --input-bg: rgba(255, 255, 255, 0.5);
  --primary-glow: rgba(6, 182, 212, 0.25);

  /* API Section Variables (Light) */
  --api-card-bg: linear-gradient(135deg, #f0f7ff 0%, #f5f3ff 100%);
  --api-card-border: rgba(124, 58, 237, 0.3);
  --api-card-shadow: 0 10px 30px rgba(124, 58, 237, 0.1);
  --api-text-gradient: linear-gradient(to right, #2563eb, #7c3aed);
  --api-badge-bg: rgba(124, 58, 237, 0.1);
  --api-badge-border: rgba(124, 58, 237, 0.3);
  --api-badge-text: #5b21b6;
  --api-glow-color: rgba(124, 58, 237, 0.2);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color var(--transition-smooth), color var(--transition-smooth);
}

/* Background Gradients */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -2;
  background-image:
    radial-gradient(circle at 15% 50%, var(--secondary-glow), transparent 25%),
    radial-gradient(circle at 85% 30%, var(--primary-glow), transparent 25%);
  transition: opacity var(--transition-smooth);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

/* Navigation Bar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 1.5rem 0;
  transition: all var(--transition-fast);
}

/* ... existing utilities ... */

/* Custom Dropdown Styling */
.custom-select-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
}

select.custom-select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  padding: 12px 16px;
  background-color: var(--input-bg);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  color: var(--text-main);
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition-fast);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}

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

select.custom-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Dashboard Title Responsive Typography */
.dashboard-title {
  font-size: 2.5rem;
  /* Original Large Size */
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

/* Dashboard Panels Typography */
.glass-panel h2,
.glass-panel h3 {
  font-size: 1.5rem;
  /* Standard Panel Header */
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-main);
}

@media (max-width: 768px) {
  .dashboard-title {
    font-size: 1.25rem !important;
    /* Compact on Mobile */
  }

  .glass-panel h2,
  .glass-panel h3 {
    font-size: 1.25rem;
    /* Compact Panel Header */
  }
}

/* Theme Toggle Button */
.theme-toggle-btn {
  background: transparent;
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.theme-toggle-btn:hover {
  background: var(--bg-card);
  border-color: var(--primary);
}

/* Logo Blend */
[data-theme="light"] .logo-img {
  mix-blend-mode: multiply;
  filter: invert(1) contrast(1.2);
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition-fast);
}

ul {
  list-style: none;
}

/* Utilities */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-center {
  justify-content: center;
}

.gap-4 {
  gap: 1rem;
}

.gap-8 {
  gap: 2rem;
}

#typewriter-text {
  display: inline-block;
  /* Fix for background clipping on empty inline spans */
  min-width: 10px;
  /* Prevent collapse */
  background-image: var(--primary-gradient);
  /* Ensure gradient is explicit */
  background-size: 100%;
}

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

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

/* Glassmorphism */
.glass-panel {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.glass-panel:hover {
  border-color: var(--primary);
  box-shadow: 0 0 20px var(--primary-glow);
  transform: translateY(-2px);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 99px;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  transition: var(--transition-smooth);
  font-size: 1rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #0891b2 100%);
  color: #fff;
  border: none;
  box-shadow: 0 0 15px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 25px var(--primary-glow);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
}

[data-theme="light"] .btn-secondary {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--primary);
}

[data-theme="light"] .btn-secondary:hover {
  background: rgba(0, 0, 0, 0.1);
  border-color: var(--primary);
}

/* Animations */
@keyframes float {
  0% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-10px);
  }

  100% {
    transform: translateY(0px);
  }
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}

@keyframes pulse-glow {

  0%,
  100% {
    opacity: 0.5;
    transform: scale(1);
  }

  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

/* ... Utilities ... */

/* Dashboard Layout */
body.dashboard-layout {
  display: flex;
  min-height: 100vh;
}

body.auth-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
}

.auth-card {
  width: 100%;
  max-width: 420px;
}

.sidebar {
  width: 300px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  position: fixed;
  height: 100vh;
  z-index: 100;
  transition: background-color var(--transition-smooth);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 12px 16px;
  color: var(--text-muted);
  border-radius: 12px;
  margin-bottom: 0.5rem;
  transition: var(--transition-fast);
  border-left: 2px solid transparent;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.05);
  /* Stays subtle in both modes */
  color: var(--text-main);
}

[data-theme="light"] .nav-item:hover,
[data-theme="light"] .nav-item.active {
  background: rgba(0, 0, 0, 0.05);
}

.nav-item.active {
  background: linear-gradient(90deg, var(--primary-glow) 0%, transparent 100%);
  border-left: 2px solid var(--primary);
}

.main-content {
  flex: 1;
  margin-left: 300px;
  padding: 2rem;
  width: calc(100% - 300px);
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-glass);
}

/* Dashboard Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.dashboard-card {
  padding: 1.5rem;
}

/* Tables */
.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 1rem;
  border-bottom: 1px solid var(--border-glass);
  color: var(--text-main);
}

th {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.9rem;
}

tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

[data-theme="light"] tr:hover {
  background: rgba(0, 0, 0, 0.02);
}

.status-badge {
  padding: 4px 8px;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-active {
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent);
}

.status-pending {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

.copy-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
}

.copy-btn:hover {
  color: var(--primary);
}

/* Configuration Styles */
.config-section {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.form-input,
.form-select {
  width: 100%;
  padding: 12px 16px;
  background-color: var(--input-bg);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  /* Consistency */
  color: var(--text-main);
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  transition: var(--transition-fast);
}


.form-select {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 16px !important;
  background-color: var(--input-bg) !important;
  cursor: pointer;
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border-glass);
  transition: .4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: var(--text-main);
  transition: .4s;
  border-radius: 50%;
}

input:checked+.slider {
  background-color: var(--primary);
}

input:checked+.slider:before {
  transform: translateX(26px);
  background-color: #fff;
}

/* Custom Amount Input (Billing) */
/* Custom Amount Input (Billing) */
.custom-amount-input {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 99px;
  /* Pill shape */
  padding: 6px;
  width: 280px;
  /* Fixed width for better look */
}

.amount-btn {
  width: 42px;
  height: 42px;
  border: none;
  background: rgba(255, 255, 255, 0.03);
  /* Subtle button bg */
  color: var(--text-main);
  font-size: 1.5rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 50%;
  /* Circle buttons */
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.amount-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--primary);
}

.amount-display {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

/* Currency Symbol */
.currency-symbol {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0;
}

.amount-field {
  width: 2ch;
  /* Initial small width */
  background: transparent;
  border: none;
  color: var(--text-main);
  text-align: left;
  /* Align next to currency */
  font-size: 1.3rem;
  font-weight: 600;
  padding: 0;
  -moz-appearance: textfield;
  appearance: textfield;
  /* Standard property */
}



.amount-field:focus {
  outline: none;
}

.amount-field::-webkit-outer-spin-button,
.amount-field::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Amount Presets */
.amount-presets {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.preset-btn {
  background: transparent;
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  padding: 0.5rem 1rem;
  border-radius: 99px;
  /* Pill shape */
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.preset-btn:hover {
  border-color: var(--primary);
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

/* Payment Methods (Billing) */
.payment-methods {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.payment-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.payment-card:hover {
  border-color: var(--primary);
}

/* Header Actions Alignment */
.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  /* 16px */
}

/* Language Toggle Button styling to match Theme Toggle */
.lang-toggle-btn {
  height: 40px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--border-glass);
  background: transparent;
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.lang-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--primary);
}

[data-theme="light"] .lang-toggle-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* Theme Toggle Button */
.theme-toggle-btn {
  width: 40px;
  height: 40px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--border-glass);
  background: transparent;
  color: var(--text-main);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--primary);
}

[data-theme="light"] .theme-toggle-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* Spacing Utilities */
.gap-2 {
  gap: 0.5rem;
}

.gap-4 {
  gap: 1rem;
}

.gap-6 {
  gap: 1.5rem;
}

.text-placeholder {
  color: var(--text-muted) !important;
}

.gap-12 {
  gap: 3rem;
}

/* Logout Button */
.btn-logout {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  color: var(--text-muted);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  transition: var(--transition-fast);
  font-size: 0.95rem;
  font-weight: 500;
  justify-content: flex-start;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

/* Proxy Constructor Styles */
.grid {
  display: grid;
  gap: 1rem;
}

.grid-cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
  .grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .grid-cols-4 {
    grid-template-columns: 1fr;
  }
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  transition: var(--transition-fast);
}

.tab-btn.active {
  color: var(--primary);
}

.info-icon {
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: help;
  margin-left: 4px;
  display: inline-block;
}

/* Global Tooltip (JS Controlled) */
.global-tooltip {
  position: fixed;
  z-index: 99999;
  background: #1e293b;
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  max-width: 250px;
  pointer-events: none;
  display: none;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-glass);
  text-align: center;
  line-height: 1.4;
  backdrop-filter: blur(5px);
}

.arrow-icon {
  display: inline-block;
  font-size: 0.8rem;
}

.arrow-icon.rotate-180 {
  transform: rotate(180deg);
}

.glass-input {
  background: var(--input-bg);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  color: var(--text-main);
  font-family: monospace;
}

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

/* Custom Searchable Dropdown (Input Style) */
.dropdown-container {
  position: relative;
  width: 100%;
}

.dropdown-selected-input {
  width: 100%;
  padding: 12px;
  padding-right: 30px;
  /* Space for arrow */
  background: var(--input-bg);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  color: var(--text-main);
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  transition: var(--transition-fast);
}

.dropdown-selected-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.dropdown-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
  color: var(--text-muted);
  pointer-events: none;
  /* Let clicks pass through to input usually, but we want click to toggle? */
  cursor: pointer;
  pointer-events: auto;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  margin-top: 4px;
  padding: 8px;
  z-index: 50;
  display: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  max-height: 250px;
  overflow-y: auto;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.dropdown-menu.show {
  display: block;
  animation: fadeIn 0.1s ease-out;
}

.dropdown-item {
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 6px;
  color: var(--text-muted);
  transition: background 0.2s;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.dropdown-item.selected {
  background: var(--primary-glow);
  color: var(--primary);
}

/* Custom Range Slider */
input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  background: transparent;
  padding: 0;
  margin: 1rem 0;
}

input[type=range]:focus {
  outline: none;
}

/* Track */
input[type=range]::-webkit-slider-runnable-track {
  width: 100%;
  height: 6px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  transition: all 0.2s;
}

input[type=range]:hover::-webkit-slider-runnable-track {
  background: rgba(255, 255, 255, 0.4);
}

/* Thumb */
input[type=range]::-webkit-slider-thumb {
  height: 20px;
  width: 20px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
  cursor: pointer;
  -webkit-appearance: none;
  margin-top: -7px;
  /* Align thumb center with track */
  transition: transform 0.2s, box-shadow 0.2s;
}

input[type=range]:hover::-webkit-slider-thumb {
  transform: scale(1.1);
  box-shadow: 0 0 15px var(--primary-glow);
}

/* Firefox Styles */
input[type=range]::-moz-range-track {
  width: 100%;
  height: 6px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

input[type=range]::-moz-range-thumb {
  height: 20px;
  width: 20px;
  border: none;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
  cursor: pointer;
}

/* Hide Spinners - Global Override */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none !important;
  margin: 0 !important;
}

input[type=number] {
  -moz-appearance: textfield !important;
  appearance: textfield !important;
  /* Standard property */
}

/* Custom Traffic Input Group */
.custom-number-input-group {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 2px 2px 2px 12px;
  /* Left padding for number */
  border: 1px solid var(--border-glass);
  position: relative;
  width: 100%;
}

.custom-number-input-group:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(var(--primary-rgb), 0.2);
}

.traffic-input-field {
  background: transparent;
  border: none;
  width: 60px;
  /* Adjust width */
  text-align: right;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  font-family: 'Outfit';
  outline: none;
  padding-right: 4px;
}

.traffic-unit-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-right: auto;
  /* Push buttons to right? Or sit next to input */
  padding-right: 8px;
  /* Space before buttons */
}

/* Traffic Controls Hover Effects */
.traffic-control-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.traffic-control-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--primary);
  box-shadow: 0 0 8px rgba(var(--primary-rgb), 0.3);
  transform: translateY(-1px);
}

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

/* Proxy Generator Layout */
.proxy-generator-row {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1rem;
}

/* Proxy Footer Controls */
.proxy-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}

.proxy-footer-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.proxy-footer-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.input-count {
  width: 60px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--border-glass);
  background: transparent;
  color: var(--text-main);
}

.format-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.format-select {
  min-width: 250px;
}

.action-btn {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
  /* padding: 8px 16px; inherited from btn */
}

/* ... existing code ... */


/* Proxy Generator Layout (Global) */
.proxy-generator-row {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1rem;
}

.dashboard-stats-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
  align-items: stretch;
}

.usage-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-glass);
}

/* =========================================
   Mobile Responsiveness
   ========================================= */

/* Burger Button (Hidden on Desktop) */
.burger-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.5rem;
  cursor: pointer;
  margin-right: 1rem;
  padding: 4px;
  line-height: 1;
}

/* Global Header Controls */
.mobile-header-controls {
  display: none;
  /* Hidden on desktop */
}

/* Global Header Controls */
.mobile-header-controls {
  display: none;
  /* Hidden on desktop */
}

/* Sidebar Overlay */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  backdrop-filter: blur(2px);
}

.sidebar-overlay.open {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 1024px) {
  .dashboard-stats-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  body.sidebar-open {
    overflow: hidden;
    /* Prevent body scroll when menu open */
  }

  /* Additional Overflow Protection for Mobile */
  html,
  body {
    overflow-x: hidden;
    max-width: 100%;
  }

  /* Layout Adjustments */
  /* Layout Adjustments */
  .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
    width: 280px;
    z-index: 2000;
    /* Sidebar Top Layer */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 20px 0 50px rgba(0, 0, 0, 0.5);
  }

  .main-content {
    margin-left: 0;
    width: 100%;
    padding: 1rem;
    /* Reduced padding for mobile */
  }

  .burger-btn {
    display: block;
  }

  /* Grid Resets for Mobile */
  .dashboard-stats-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .usage-stats-grid {
    grid-template-columns: 1fr;
  }

  /* Proxy Generator Mobile Stack */
  .proxy-generator-row {
    flex-direction: column;
    align-items: stretch;
  }

  .proxy-generator-row>div {
    width: 100%;
  }

  .proxy-generator-row button {
    width: 100% !important;
    margin-top: 0.5rem;
  }

  #advanced-settings {
    grid-template-columns: 1fr !important;
  }

  /* Fix Header Layout */
  .header {
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    /* Prevent wrapping so title stays next to burger */
    gap: 1rem;

    /* Floating Header Logic */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(23, 23, 23, 0.85);
    /* Dark semi-transparent bg matches theme */
    backdrop-filter: blur(12px);
    margin: 0;
    /* Remove negative margins used for sticky */
    padding: 12px 1.5rem;
    /* Adjusted padding */
    border-bottom: 1px solid var(--border-glass);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  }

  /* Add padding to Main Content to prevent overlap */
  .main-content {
    padding-top: 80px !important;
    /* Header height compensator */
  }

  /* Adjust theme based gradient bg if needed, or stick to dark glass */
  [data-theme="light"] .header {
    background: rgba(255, 255, 255, 0.85);
  }

  /* Hide Header when Sidebar is open */
  body.sidebar-open .header {
    display: none !important;
  }

  .header>div {
    display: flex;
    align-items: center;
    width: auto !important;
    flex: 1;
    min-width: 0;
    /* Enable flex truncation */
    justify-content: flex-start !important;
    position: relative;
    padding-right: 1rem;
  }



  /* Burger Button - Larger & In Flow */
  .burger-btn {
    position: relative !important;
    left: auto !important;
    font-size: 2.2rem;
    /* Much larger */
    width: 48px;
    height: 48px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    margin-right: 0.5rem;
    padding: 0;
    z-index: 1002;
    background: transparent;
    border: none;
    color: var(--text-main);
    flex-shrink: 0;
    /* Prevent shrinking */
  }

  .header h1 {
    font-size: 1.3rem !important;
    /* Readable size */
    margin-bottom: 0 !important;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left !important;
    width: 100%;
    /* Take available space */
    padding: 0 !important;
    /* Remove spacer */
  }

  /* Hide welcome text on mobile to save space */
  .header p {
    display: none;
  }

  /* Landing Page Mobile Navbar */
  .navbar .container {
    padding: 0 1rem;
    justify-content: space-between;
  }

  .desktop-nav {
    display: none !important;
  }

  /* End of Mobile Styles */
}

/* =========================================
   Global Use Case & Marquee Styles (Fixed)
   ========================================= */

/* Use Cases Grid */
.use-case-card {
  position: relative;
  padding: 3rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
}

.use-case-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 0;
}

.use-case-card:hover {
  transform: translateY(-10px);
  border-color: transparent;
}

.use-case-card:hover::before {
  opacity: 0.1;
}

.use-case-icon {
  font-size: 3rem;
  margin-bottom: 2rem;
  position: relative;
  z-index: 1;
  transition: transform 0.4s ease;
}

.use-case-card:hover .use-case-icon {
  transform: scale(1.1) rotate(5deg);
}

.use-case-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}

.use-case-desc {
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1.6;
  position: relative;
  z-index: 1;
}

.marquee-row {
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  padding: 10px 0;
  /* Add padding to prevent clipping of scaled images */
}

.marquee-track {
  display: flex;
  gap: 5rem;
  /* Spacious gap */
  width: max-content;
}

.scroll-left .marquee-track {
  animation: scrollLeft 40s linear infinite;
}

.scroll-right .marquee-track {
  animation: scrollRight 40s linear infinite;
}

.marquee-item {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text-muted);
  opacity: 0.8;
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Base Logo Style */
.marquee-item img {
  height: 60px;
  /* Giants base size */
  width: auto;
  object-fit: contain;
  transition: transform 0.3s ease;
}

/* Small Logo Boost (for the bottom row) */
.marquee-item img.logo-boost {
  height: 65px;
  /* Slightly larger to match readability */
  transform: scale(1.1);
}

.marquee-item:hover img {
  transform: scale(1.15);
}

@keyframes scrollLeft {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-33.33%);
  }

  /* Assuming 3 duplicates, move 1 set width */
}

@keyframes scrollRight {
  0% {
    transform: translateX(-33.33%);
  }

  100% {
    transform: translateX(0);
  }
}

@media (max-width: 768px) {
  .mobile-header-controls {
    display: flex !important;
    align-items: center;
    gap: 12px;
  }

  .mobile-control-btn {
    background: transparent;
    border: 1px solid var(--border-glass);
    padding: 6px 10px;
    border-radius: 8px;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    min-width: 36px;
  }

  .mobile-user-btn {
    background: var(--primary);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    /* Circle */
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px var(--primary-glow);
    text-decoration: none;
  }

  .landing-burger-btn {
    display: none !important;
  }

  /* Mobile Typography Fixes */
  .hero-section h1 {
    font-size: 2.5rem !important;
    /* Scale down from desktop size */
    line-height: 1.1;
    word-wrap: break-word;
    overflow-wrap: break-word;
    padding: 0 10px;
    /* Prevent edge touching */
  }

  /* Smaller Mobile Buttons */
  .hero-section .btn {
    padding: 10px 20px !important;
    font-size: 0.95rem !important;
    min-width: 140px;
    /* Ensure 2 buttons fit side by side */
  }

  .hero-section .flex.gap-6 {
    gap: 1rem !important;
    /* Reduce gap between buttons */
  }
}

.traffic-input-container {
  position: relative;
  flex: 1;
  background: rgba(6, 182, 212, 0.05);
  /* Subtle Primary Tint */
  border-radius: 12px;
  /* Softer rounded corners */
  border: 1px solid var(--border-glass);
  height: 42px;
  /* Slightly taller for modern look */
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}

.traffic-input-container:hover {
  border-color: var(--primary);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.15);
  background: rgba(6, 182, 212, 0.1);
}

.traffic-input-container:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.25);
  background: rgba(6, 182, 212, 0.15);
  transform: translateY(-1px);
}

/* =========================================
   Landing Page Mobile Fixes (Re-added)
   ========================================= */

/* Navbar Scroll Effect */
.navbar.scrolled {
  background: rgba(2, 6, 23, 0.85);
  backdrop-filter: blur(12px);
  padding: 16px 0;
  border-bottom: 1px solid var(--border-glass);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .navbar.scrolled {
  background: rgba(255, 255, 255, 0.85);
}

/* Footer Container */
.landing-footer-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0;
}



@media (max-width: 768px) {

  /* Navbar Mobile Styles */
  .navbar {
    padding: 16px 0;
    background: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-glass);
  }

  [data-theme="light"] .navbar {
    background: rgba(255, 255, 255, 0.9);
  }

  /* Hide Desktop Nav */
  .desktop-nav {
    display: none !important;
  }

  /* Show Burger */
  .landing-burger-btn {
    display: block;
  }

  /* Footer Stack */
  .landing-footer-container {
    flex-direction: column-reverse;
    /* Copyright bottom */
    gap: 2rem;
    text-align: center;
  }

  .landing-footer-container>div:first-child {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }

  .landing-footer-container>div:last-child {
    width: 100%;
    justify-content: center;
    gap: 2rem;
    display: flex;
  }
}

/* Pricing Grid Layout */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 40px;
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 1024px) {
  .pricing-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .pricing-grid {
    grid-template-columns: 1fr;
  }
}

.text-center {
  text-align: center;
}

/* Trial Banner Styles */
.trial-banner {
  margin-bottom: 2rem;
  /* Default Dark Mode: Glass/Dark Gradient Style */
  border: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  flex-wrap: wrap;
  gap: 1rem;
  border-radius: 16px;
  background: linear-gradient(90deg, rgba(82, 107, 255, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
  color: #fff;
  /* Force white text in dark mode */
}

.trial-banner p {
  color: rgba(255, 255, 255, 0.9);
}

[data-theme="light"] .trial-banner {
  /* Light Mode: Transparent Glass */
  background: var(--bg-glass);
  border: 1px solid var(--border-highlight);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  color: var(--text-main);
  /* Black/Dark text */
}

[data-theme="light"] .trial-banner h3 {
  color: var(--text-main);
}

[data-theme="light"] .trial-banner p {
  color: var(--text-muted);
}

/* Trial Button */
.trial-btn {
  background: #fff;
  color: #4f46e5;
  font-weight: 700;
  border: none;
  padding: 0.8rem 2rem;
  border-radius: 12px;
  transition: all 0.2s;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.trial-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .trial-btn {
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

/* Footer Payment Logos */
.footer-payment-logo {
  width: auto;
  opacity: 0.8;
  transition: all 0.3s;
  /* Default Dark Mode: White logos */
  filter: brightness(0) invert(1);
}

.footer-payment-logo:hover {
  opacity: 1;
  filter: none;
}

/* Light Mode: Dark/Grayscale logos */
[data-theme="light"] .footer-payment-logo {
  filter: grayscale(100%) brightness(0.2);
}

[data-theme="light"] .footer-payment-logo:hover {
  filter: none;
  opacity: 1;
}

/* Spin Animation */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}


/* Typewriter Cursor */
.typewriter-cursor {
  display: inline-block;
  width: 4px;
  background-color: var(--primary);
  animation: blink 1s step-end infinite;
  margin-left: 5px;
  vertical-align: text-bottom;
  height: 1em;
}

@keyframes blink {

  from,
  to {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

.spin-anim {
  animation: spin 1s linear infinite;
  pointer-events: none;
  /* Prevent clicks while loading */
  opacity: 0.7;
}

#refresh-stats-btn:hover {
  color: var(--primary) !important;
}

/* API Section specific styles */
.api-card {
  text-align: center;
  padding: 4rem 2rem;
  border: 1px solid var(--api-card-border);
  background: var(--api-card-bg);
  position: relative;
  overflow: hidden;
  box-shadow: var(--api-card-shadow);
  border-radius: 16px;
  transition: all 0.3s ease;
}

.api-card-glow {
  position: absolute;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 200px;
  background: var(--api-glow-color);
  filter: blur(100px);
  opacity: 0.2;
  border-radius: 50%;
  pointer-events: none;
}

.api-title {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 2.5rem;
  color: #8b5cf6;
  /* Fallback color */
  background-image: var(--api-text-gradient);
  background-size: 100%;
  background-repeat: no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  position: relative;
  z-index: 2;
}

.api-badge {
  display: inline-block;
  padding: 0.5rem 1.5rem;
  background: var(--api-badge-bg);
  border-radius: 50px;
  border: 1px solid var(--api-badge-border);
  font-size: 0.9rem;
  color: var(--api-badge-text);
  position: relative;
  z-index: 1;
  font-weight: 500;
}

/* Light Mode: Restore original logos */
/* Light Mode: Restore original logos */
[data-theme="light"] .marquee-item img,
[data-theme="light"] .marquee-item img.logo-boost {
  filter: none;
  opacity: 1;
}

/* Custom Light Background for Marquee Section in Dark Mode */
.marquee-section {
  background: rgba(255, 255, 255, 0.4) !important;
  /* Even Darker Light Glass */
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.marquee-section h2 {
  color: #ffffff !important;
  /* White text for contrast on dark glass */
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.marquee-section p {
  color: rgba(255, 255, 255, 0.9) !important;
  /* High opacity white for subtitle */
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Light Mode: Reset Marquee to Default Light Style */
[data-theme="light"] .marquee-section {
  background: var(--bg-card) !important;
  border-top: 1px solid var(--border-glass);
}

[data-theme="light"] .marquee-section h2 {
  color: var(--text-main) !important;
  text-shadow: none;
}

[data-theme="light"] .marquee-section p {
  color: var(--text-muted) !important;
  text-shadow: none;
}