:root {
  --primary: #00e5ff;
  --secondary: #7000ff;
  --accent: #ff007a;
  --bg: #030408;
  --sidebar-bg: rgba(6, 7, 12, 0.85);
  --card-bg: rgba(255, 255, 255, 0.02);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-glow: rgba(0, 229, 255, 0.08);
  --text-main: #ffffff;
  --text-muted: #8e92a4;
  --success: #00ffb3;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Outfit", sans-serif;
  user-select: none;
}

body {
  background: var(--bg);
  color: var(--text-main);
  overflow: hidden;
  height: 100vh;
  position: relative;
}

/* Premium Background Blobs */
.bg-blobs {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
  filter: blur(140px);
}

.blob {
  position: absolute;
  border-radius: 50%;
  opacity: 0.15;
  animation: blobFloat 20s infinite alternate;
}

.blob-1 {
  width: 600px;
  height: 600px;
  background: var(--accent);
  top: -10%;
  left: -5%;
}

.blob-2 {
  width: 500px;
  height: 500px;
  background: var(--primary);
  bottom: -5%;
  right: -5%;
  animation-delay: -5s;
}

.blob-3 {
  width: 400px;
  height: 400px;
  background: var(--secondary);
  top: 40%;
  left: 30%;
  animation-delay: -10s;
}

@keyframes blobFloat {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(100px, 50px) scale(1.1); }
}

.dashboard-container {
  display: flex;
  height: 100vh;
  position: relative;
  z-index: 1;
}

/* Sidebar Styling */
.sidebar {
  width: 280px;
  background: var(--sidebar-bg);
  backdrop-filter: blur(25px);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  padding: 2.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-bottom: 3.5rem;
}

.logo {
  width: 42px;
  filter: drop-shadow(0 0 10px rgba(0, 204, 255, 0.4));
}

.brand-name {
  font-size: 1.6rem;
  font-weight: 700;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1rem 1.2rem;
  text-decoration: none;
  color: var(--text-muted);
  border-radius: 16px;
  font-weight: 500;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  border: 1px solid transparent;
}

.nav-link i {
  font-size: 1.1rem;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  transform: translateX(5px);
}

.nav-link.active {
  background: var(--glass-glow);
  color: var(--primary);
  border-color: rgba(0, 204, 255, 0.2);
  box-shadow: 0 8px 24px rgba(0, 204, 255, 0.1);
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--glass-border);
}

.creator-logo {
  width: 32px;
  opacity: 0.8;
}

.creator-info strong {
  display: block;
  font-size: 0.9rem;
  color: var(--text-main);
}

.creator-info p {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Main Content Styling */
.main-content {
  flex: 1;
  padding: 3.5rem;
  overflow-y: auto;
}

.content-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 4rem;
}

.header-title h1 {
  font-size: 3.2rem;
  font-weight: 800;
  letter-spacing: -2px;
  background: linear-gradient(to right, #ffffff, var(--primary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 10px 30px rgba(0, 229, 255, 0.2);
}

.header-title p {
  color: var(--text-muted);
  font-size: 1.2rem;
  margin-top: 0.5rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: 0.8;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 1.4rem;
  background: rgba(0, 245, 180, 0.08);
  color: var(--success);
  border-radius: 100px;
  font-size: 0.95rem;
  font-weight: 700;
  border: 1px solid rgba(0, 245, 180, 0.2);
  box-shadow: 0 0 20px rgba(0, 245, 180, 0.1);
}

.pulse-dot {
  width: 10px;
  height: 10px;
  background: var(--success);
  border-radius: 50%;
  position: relative;
}

.pulse-dot::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--success);
  border-radius: 50%;
  animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(3); opacity: 0; }
}

/* Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2.5rem;
  margin-bottom: 4rem;
}

.stat-card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  padding: 2.5rem;
  border-radius: 32px;
  display: flex;
  align-items: center;
  gap: 2rem;
  position: relative;
  overflow: hidden;
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(135deg, transparent 40%, var(--primary) 50%, transparent 60%);
  background-size: 300% 300%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.stat-card:hover {
  transform: translateY(-15px) scale(1.03);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 229, 255, 0.1);
}

.stat-card:hover::before {
  opacity: 1;
  animation: shine 2s infinite linear;
}

@keyframes shine {
  0% { background-position: 0% 0%; }
  100% { background-position: 100% 100%; }
}

.stat-icon {
  width: 70px;
  height: 70px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  position: relative;
}

.stat-icon::after {
  content: "";
  position: absolute;
  width: 100%; height: 100%;
  border-radius: inherit;
  filter: blur(15px);
  opacity: 0.3;
  z-index: -1;
}

.stat-icon.database { background: rgba(0, 204, 255, 0.15); color: var(--primary); }
.stat-icon.database::after { background: var(--primary); }
.stat-icon.firebase { background: rgba(255, 174, 0, 0.15); color: #ffae00; }
.stat-icon.firebase::after { background: #ffae00; }
.stat-icon.sockets { background: rgba(110, 0, 255, 0.15); color: var(--accent); }
.stat-icon.sockets::after { background: var(--accent); }

.stat-details h3 {
  font-size: 1rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 0.5rem;
}

.stat-details p {
  font-size: 1.5rem;
  font-weight: 800;
  transition: color 0.3s ease;
}

.status-connected {
  color: var(--success);
  text-shadow: 0 0 10px rgba(0, 255, 179, 0.3);
}

.status-disconnected {
  color: var(--accent);
  text-shadow: 0 0 10px rgba(255, 0, 122, 0.3);
}

/* Info Banner */
.info-banner {
  background: linear-gradient(135deg, rgba(0, 204, 255, 0.05), rgba(255, 0, 255, 0.05));
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  padding: 4rem;
  border-radius: 40px;
  position: relative;
  overflow: hidden;
}

.banner-content h2 {
  font-size: 2.2rem;
  margin-bottom: 1.5rem;
  letter-spacing: -1px;
}

.banner-content p {
  color: var(--text-muted);
  font-size: 1.2rem;
  line-height: 1.6;
  max-width: 600px;
}

.location-tag {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 2.5rem;
  font-weight: 600;
  color: var(--primary);
  background: rgba(0, 204, 255, 0.1);
  padding: 0.5rem 1.2rem;
  border-radius: 50px;
  width: fit-content;
}

/* Docs Design */
.content-section { display: none; }
.content-section.active { display: block; animation: sectionIn 0.6s cubic-bezier(0.23, 1, 0.32, 1); }

@keyframes sectionIn {
  from { opacity: 0; transform: translateY(30px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.docs-container { max-width: 900px; }
.doc-header { margin-bottom: 3.5rem; }
.subtitle_doc { color: var(--text-muted); font-size: 1.2rem; margin-top: 1rem; }

.doc-card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  padding: 2.5rem;
  border-radius: 28px;
  margin-bottom: 2rem;
  transition: border-color 0.3s ease;
}

.doc-card:hover { border-color: rgba(255, 255, 255, 0.15); }

.endpoint-badge {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  background: linear-gradient(90deg, rgba(0, 204, 255, 0.1), rgba(110, 0, 255, 0.1));
  color: var(--primary);
  border-radius: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(0, 204, 255, 0.2);
}

.doc-table { width: 100%; border-collapse: collapse; margin-top: 1.5rem; }
.doc-table th { color: var(--text-muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; padding: 1rem; border-bottom: 1px solid var(--glass-border); }
.doc-table td { padding: 1.2rem 1rem; border-bottom: 1px solid var(--glass-border); font-size: 0.95rem; }
.doc-table td code { color: var(--primary); font-weight: 600; }

pre {
  background: #000;
  padding: 2rem;
  border-radius: 20px;
  overflow-x: auto;
  border: 1px solid #222;
  margin-top: 1rem;
}

code { font-family: 'JetBrains Mono', 'Courier New', monospace; color: #7697ff; }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--card-bg); border-radius: 20px; border: 2px solid var(--bg); }

/* Docs Step Design */
.step-card {
  position: relative;
  border-left: 4px solid var(--primary);
  padding-left: 3rem;
}

.step-number {
  position: absolute;
  left: -20px;
  top: 20px;
  background: var(--primary);
  color: #000;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.4);
}

.param-info {
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.highlight-card {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.08), rgba(112, 0, 255, 0.08));
  border: 1px solid rgba(0, 229, 255, 0.3);
}

.sync-list {
  list-style: none;
  margin: 2rem 0;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.sync-list li {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 1.1rem;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
  padding: 1rem 1.5rem;
  border-radius: 16px;
  transition: transform 0.3s ease;
}

.sync-list li:hover {
  transform: scale(1.02);
  background: rgba(255, 255, 255, 0.06);
}

.sync-list i {
  color: var(--success);
  font-size: 1.4rem;
}

.sync-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 1rem;
}

/* Responsive */
@media (max-width: 1024px) {
  .sidebar { width: 80px; padding: 1.5rem 0; align-items: center; }
  .brand-name, .nav-link span, .creator-info, .sidebar-footer strong { display: none; }
  .logo { margin-bottom: 0; }
  .nav-link { padding: 1.2rem; justify-content: center; }
  .main-content { padding: 2rem; }
}
