@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;600;700&family=Outfit:wght@300;400;600;700&display=swap");

:root {
  --bg-deep: #050507;
  --bg-glass: rgba(255, 255, 255, 0.03);
  --border-glass: rgba(255, 255, 255, 0.05);
  --border-glow: rgba(0, 240, 255, 0.3);

  --text-main: #f8fafc;
  --text-dim: #94a3b8;

  --accent-cyan: #00f0ff;
  --accent-pink: #ff003c;
  --accent-green: #10b981;
  --accent-orange: #f59e0b;
  --accent-purple: #8b5cf6;

  --shadow-neon: 0 0 15px rgba(0, 240, 255, 0.15);
  --shadow-deep: 0 10px 30px -10px rgba(0, 0, 0, 0.8);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 50px;

  --font-heading: "Space Grotesk", sans-serif;
  --font-body: "Outfit", sans-serif;

  --transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
html,
body {
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
}
body::before {
  content: "";
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(0, 240, 255, 0.04) 0%,
    transparent 50%
  );
  z-index: -1;
  pointer-events: none;
}

h1,
h2,
h3,
h4,
.section-title,
.header-title {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.5px;
}

/* Typography Enhancements */
.section-title {
  font-size: 1.1rem;
  margin-bottom: 15px;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* Layout Classes */
.page {
  display: none;
  padding: 20px 15px 120px 15px;
  animation: fadeIn 0.4s ease;
}
.page.active {
  display: block;
}

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

/* Cards & Sections (Glassmorphism) */
.section,
.card,
.profile-section,
.settings-box,
.stat-card,
.list-item {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-deep);
  padding: 16px;
  margin-bottom: 16px;
  transition: var(--transition);
}
.section:hover,
.card:hover,
.stat-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-2px);
  box-shadow: var(--shadow-neon);
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(5, 5, 7, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-glass);
  padding: max(15px, env(safe-area-inset-top)) 20px 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.header-logo svg {
  color: var(--accent-cyan);
  filter: drop-shadow(0 0 5px var(--accent-cyan));
  width: 24px;
  height: 24px;
}
.header-title {
  font-size: 1.2rem;
  background: linear-gradient(90deg, #fff, var(--text-dim));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.header-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-orange);
  box-shadow: 0 0 8px var(--accent-orange);
}
.header-dot.connected {
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
}
.header-status {
  font-size: 0.75rem;
  color: var(--text-dim);
}
.theme-switch {
  display: none;
} /* Force Dark Mode FWA Style */

/* Stat Grid */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.stat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
}
.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
}
.stat-icon svg {
  width: 20px;
  height: 20px;
}
.stat-icon.cyan {
  color: var(--accent-cyan);
  box-shadow: inset 0 0 10px rgba(0, 240, 255, 0.2);
}
.stat-icon.green {
  color: var(--accent-green);
  box-shadow: inset 0 0 10px rgba(16, 185, 129, 0.2);
}
.stat-icon.purple {
  color: var(--accent-purple);
  box-shadow: inset 0 0 10px rgba(139, 92, 246, 0.2);
}
.stat-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
}
.stat-value {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
}

/* Buttons */
button,
.btn {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  font-family: var(--font-heading);
  font-weight: 600;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: var(--transition);
  outline: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}
button:hover,
.btn:hover {
  background: rgba(0, 240, 255, 0.1);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
  transform: scale(1.02);
}
#btn-action {
  width: 100%;
  background: linear-gradient(135deg, var(--accent-cyan), #0088ff);
  color: #000;
  border: none;
  font-size: 1.1rem;
  padding: 16px;
  box-shadow: 0 5px 15px rgba(0, 240, 255, 0.4);
  margin-top: 15px;
}
#btn-action:hover {
  box-shadow: 0 8px 25px rgba(0, 240, 255, 0.6);
}

/* Form Elements */
input,
select,
textarea {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  font-family: var(--font-body);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  width: 100%;
  transition: var(--transition);
  outline: none;
  margin-bottom: 10px;
}
input:focus,
select:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px rgba(0, 240, 255, 0.2);
}

/* Checkbox/Toggle Styles */
.toggle {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
  vertical-align: middle;
}
.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-track {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 34px;
  transition: var(--transition);
  border: 1px solid var(--border-glass);
}
.toggle-thumb {
  position: absolute;
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 3px;
  background-color: var(--text-dim);
  border-radius: 50%;
  transition: var(--transition);
}
input:checked + .toggle-track {
  background-color: rgba(0, 240, 255, 0.2);
  border-color: var(--accent-cyan);
}
input:checked + .toggle-track + .toggle-thumb {
  transform: translateX(24px);
  background-color: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
}
.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-glass);
}
.setting-item:last-child {
  border-bottom: none;
}
.setting-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.setting-title {
  font-weight: 600;
}
.setting-desc {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Floating Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-pill);
  display: flex;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.9);
  z-index: 1000;
  width: 90%;
  max-width: 400px;
  padding: 5px;
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.65rem;
  border-radius: var(--radius-pill);
  transition: var(--transition);
  cursor: pointer;
  border: none;
  background: transparent;
}
.nav-item svg {
  margin-bottom: 4px;
  width: 20px;
  height: 20px;
  transition: var(--transition);
}
.nav-item.active {
  background: rgba(0, 240, 255, 0.1);
  color: var(--accent-cyan);
}
.nav-item.active svg {
  transform: translateY(-2px);
  filter: drop-shadow(0 0 5px var(--accent-cyan));
}

/* Terminal Area */
.terminal-wrapper {
  background: rgba(5, 5, 8, 0.95);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  height: 250px;
  display: flex;
  flex-direction: column;
  margin-top: 20px;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}
.terminal-header {
  padding: 10px 15px;
  border-bottom: 1px solid var(--border-glass);
  font-family: var(--font-heading);
  font-size: 0.8rem;
  color: var(--text-dim);
  display: flex;
  justify-content: space-between;
}
.console-output {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
  font-family: "Courier New", monospace;
  font-size: 0.75rem;
  color: var(--accent-green);
}

/* Table Replacements (Grid Lists) */
.profile-grid-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.list-item {
  display: flex;
  flex-direction: column;
  padding: 12px;
}
.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  border-bottom: 1px dashed var(--border-glass);
  padding-bottom: 8px;
}
.list-title {
  font-weight: 600;
  color: var(--accent-cyan);
  font-size: 0.9rem;
}
.badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.1);
}
.badge.done {
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-green);
}
.badge.pending {
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent-orange);
}
.badge.error {
  background: rgba(255, 0, 60, 0.2);
  color: var(--accent-pink);
}
.list-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.modal-content {
  background: rgba(15, 15, 20, 0.95);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 25px;
  width: 90%;
  max-width: 350px;
  transform: translateY(20px);
  transition: var(--transition);
  text-align: center;
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.5),
    0 0 20px rgba(0, 240, 255, 0.1);
}
.modal-overlay.active .modal-content {
  transform: translateY(0);
}
.modal-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: var(--text-main);
  margin-bottom: 10px;
}
.modal-desc {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 20px;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* Utilities */
.hidden {
  display: none !important;
}
.text-center {
  text-align: center;
}
.text-cyan {
  color: var(--accent-cyan);
}
.text-green {
  color: var(--accent-green);
}
.text-pink {
  color: var(--accent-pink);
}
