:root {
  --bg-deep: #060814;
  --bg-card: rgba(16, 21, 38, 0.75);
  --bg-card-hover: rgba(26, 33, 58, 0.85);
  --bg-input: rgba(10, 14, 28, 0.85);
  --border-glass: rgba(80, 120, 200, 0.2);
  --border-focus: rgba(100, 200, 255, 0.6);
  --cyan-glow: #00f0ff;
  --blue-bright: #3a86ff;
  --purple-glow: #a855f7;
  --gold-glow: #ffb703;
  --danger: #ef4444;
  --success: #10b981;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --font-mono: 'Space Mono', monospace;
  --font-heading: 'Orbitron', 'Space Grotesk', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --glass-blur: blur(16px);
  --header-height: 60px;
  --sidebar-width: 320px;
  --inspector-width: 340px;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-body);
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(10, 14, 28, 0.5);
}
::-webkit-scrollbar-thumb {
  background: rgba(80, 120, 200, 0.35);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 240, 255, 0.5);
}

/* App Container */
#app-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* View Sections */
.view-section {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  opacity: 0;
  transition: opacity 0.35s ease;
  z-index: 5;
}
.view-section.active {
  display: block;
  opacity: 1;
}

/* ==========================================================
   NAVIGATION BAR
   ========================================================== */
.main-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(6, 8, 20, 0.7);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 1000;
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.brand-logo-icon {
  width: 32px;
  height: 32px;
  background: radial-gradient(circle at 35% 35%, #00f0ff, #3a86ff 60%, #1e1b4b);
  border-radius: 50%;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.4), inset 0 0 8px rgba(255, 255, 255, 0.8);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-logo-icon::after {
  content: '';
  position: absolute;
  width: 44px;
  height: 14px;
  border: 2px solid rgba(0, 240, 255, 0.7);
  border-radius: 50%;
  transform: rotate(-25deg);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.4);
}

.brand-text {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  background: linear-gradient(135deg, #ffffff 40%, #00f0ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text span {
  color: var(--cyan-glow);
  -webkit-text-fill-color: var(--cyan-glow);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

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

.nav-btn.active {
  color: var(--cyan-glow);
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.25);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* User Profile Badge */
.nav-mobile-toggle {
  display: none;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  padding: 3px 10px 3px 3px;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  height: 38px;
  max-height: 38px;
  box-sizing: border-box;
}

.user-profile-badge:hover {
  border-color: var(--cyan-glow);
  background: rgba(0, 240, 255, 0.08);
}

.user-avatar-small,
.user-avatar-img {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  max-width: 32px;
  max-height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--cyan-glow);
  display: block;
  flex-shrink: 0;
}

.user-display-name {
  font-size: 0.85rem;
  font-weight: 600;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* User dropdown menu */
.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: rgba(14, 18, 34, 0.95);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 8px;
  min-width: 190px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6);
  display: none;
  flex-direction: column;
  gap: 4px;
  z-index: 1001;
}

.user-dropdown-menu.show {
  display: flex;
}

.dropdown-item {
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.15s;
}

.dropdown-item:hover {
  background: rgba(0, 240, 255, 0.12);
  color: var(--text-primary);
}

.dropdown-item.danger:hover {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

/* UI Buttons */
.btn-primary {
  background: linear-gradient(135deg, #00f0ff, #3a86ff);
  color: #050814;
  border: none;
  font-weight: 700;
  font-family: var(--font-heading);
  letter-spacing: 0.5px;
  padding: 9px 18px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 18px rgba(0, 240, 255, 0.35);
  transition: all 0.25s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(0, 240, 255, 0.5);
  filter: brightness(1.1);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid var(--border-glass);
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-outline-cyan {
  background: transparent;
  color: var(--cyan-glow);
  border: 1px solid var(--cyan-glow);
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-outline-cyan:hover {
  background: rgba(0, 240, 255, 0.15);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
}

/* ==========================================================
   LANDING HERO VIEW
   ========================================================== */
#view-landing {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  background: radial-gradient(ellipse at 50% 15%, #0e142e 0%, #060814 65%, #020308 100%);
  z-index: 5;
}

#landing-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.landing-content {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  padding: calc(var(--header-height) + 60px) 24px 60px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.landing-content::before {
  content: '';
  position: absolute;
  top: 180px;
  left: 50%;
  transform: translateX(-50%);
  width: 650px;
  height: 380px;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.08) 0%, rgba(112, 0, 255, 0.05) 50%, transparent 75%);
  filter: blur(80px);
  pointer-events: none;
  z-index: -1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 30px;
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: var(--cyan-glow);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 24px;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 5.5vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 20px;
  letter-spacing: -0.5px;
}

.hero-title .glow-gradient {
  background: linear-gradient(135deg, #00f0ff 0%, #7000ff 60%, #ff007a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 40px rgba(0, 240, 255, 0.3);
}

.hero-subtitle {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  color: var(--text-secondary);
  max-width: 720px;
  line-height: 1.6;
  margin-bottom: 40px;
}

.hero-cta-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 50px;
}

.btn-hero-primary {
  padding: 16px 36px;
  font-size: 1.1rem;
  border-radius: 12px;
  background: linear-gradient(135deg, #00f0ff 0%, #3a86ff 100%);
  color: #050814;
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: 0.5px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 32px rgba(0, 240, 255, 0.45);
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.btn-hero-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 40px rgba(0, 240, 255, 0.65);
}

.btn-hero-secondary {
  padding: 16px 32px;
  font-size: 1.05rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  backdrop-filter: var(--glass-blur);
  transition: all 0.25s ease;
}

.btn-hero-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--cyan-glow);
  transform: translateY(-2px);
}

/* Feature grid on Landing */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  width: 100%;
  margin-top: 40px;
}

.feature-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 28px 24px;
  text-align: left;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan-glow), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 240, 255, 0.4);
  background: var(--bg-card-hover);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

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

.feature-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cyan-glow);
  font-size: 1.4rem;
  margin-bottom: 18px;
}

.feature-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  margin-bottom: 10px;
}

.feature-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ==========================================================
   MODAL WINDOWS & DIALOGS
   ========================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(3, 5, 12, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-card {
  background: rgba(14, 19, 36, 0.95);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 32px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(0, 240, 255, 0.1);
  position: relative;
  transform: translateY(20px);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

.modal-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

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

.modal-header {
  margin-bottom: 24px;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  margin-bottom: 8px;
}

.modal-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Auth Modal specifics */
.auth-provider-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.btn-google-sign-in {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  background: #ffffff;
  color: #1f2937;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-google-sign-in:hover {
  background: #f1f5f9;
  transform: translateY(-1px);
}

.google-icon-svg {
  width: 20px;
  height: 20px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-glass);
}

.demo-account-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.demo-account-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.demo-account-card:hover {
  border-color: var(--cyan-glow);
  background: rgba(0, 240, 255, 0.08);
  transform: translateX(4px);
}

.demo-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--border-glass);
}

.demo-info h4 {
  font-size: 0.9rem;
  color: var(--text-primary);
}

.demo-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 3000;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 400px;
  padding: 14px 18px;
  background: rgba(16, 22, 40, 0.95);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-glass);
  border-left: 4px solid var(--cyan-glow);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  transform: translateX(120%);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.toast.show {
  transform: translateX(0);
}

.toast.toast-success {
  border-left-color: var(--success);
}

.toast.toast-error {
  border-left-color: var(--danger);
}

.toast.toast-warning {
  border-left-color: var(--gold-glow);
}

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

/* ==========================================================
   MOBILE & TABLET RESPONSIVE RULES (main.css)
   ========================================================== */
@media (max-width: 768px) {
  :root {
    --header-height: 56px;
  }

  .main-nav {
    padding: 0 14px;
  }

  .brand-text {
    font-size: 1.1rem;
    letter-spacing: 1px;
  }

  .nav-mobile-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
  }

  .nav-mobile-toggle:hover,
  .nav-mobile-toggle.active {
    background: rgba(0, 240, 255, 0.15);
    border-color: var(--cyan-glow);
    color: var(--cyan-glow);
  }

  .nav-links {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: rgba(8, 11, 24, 0.98);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-glass);
    flex-direction: column;
    align-items: stretch;
    padding: 14px 16px;
    gap: 8px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85);
    z-index: 1001;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-btn {
    width: 100%;
    justify-content: flex-start;
    padding: 11px 16px;
    font-size: 0.95rem;
    border-radius: 8px;
  }

  .user-display-name {
    display: none;
  }

  .user-profile-badge {
    padding: 2px;
    gap: 0;
  }

  .user-profile-badge .fa-chevron-down {
    display: none;
  }

  /* Landing Page Mobile */
  .landing-content {
    padding: calc(var(--header-height) + 24px) 16px 40px 16px;
  }

  .hero-title {
    font-size: 2.2rem;
  }

  .hero-subtitle {
    font-size: 0.95rem;
    margin-bottom: 28px;
  }

  .hero-cta-group {
    flex-direction: column;
    width: 100%;
    gap: 12px;
  }

  .btn-hero-primary,
  .btn-hero-secondary {
    width: 100%;
    justify-content: center;
    padding: 14px 20px;
    font-size: 0.95rem;
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 30px;
  }

  /* Modals Mobile */
  .modal-overlay {
    padding: 12px;
  }

  .modal-card {
    padding: 22px 18px;
    max-width: 100%;
    border-radius: 16px;
    max-height: 90vh;
    overflow-y: auto;
  }

  .modal-title {
    font-size: 1.25rem;
  }

  #toast-container {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }

  .toast {
    min-width: unset;
    width: 100%;
  }
}

