:root {
  --bg-dark: #080c14;
  --card-bg: rgba(15, 23, 42, 0.75);
  --card-border: rgba(255, 255, 255, 0.1);
  --primary: #06b6d4;
  --primary-glow: rgba(6, 182, 212, 0.4);
  --primary-hover: #0891b2;
  --accent: #6366f1;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --success: #10b981;
  --warning: #f59e0b;
}

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

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  position: relative;
  padding: 24px;
}

/* Background animated gradient blobs */
.background-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.blob {
  position: absolute;
  filter: blur(90px);
  opacity: 0.25;
  border-radius: 50%;
  animation: float 20s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}

.blob-1 {
  width: 500px;
  height: 500px;
  background: linear-gradient(135deg, #06b6d4, #3b82f6);
  top: -100px;
  left: -100px;
}

.blob-2 {
  width: 450px;
  height: 450px;
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  bottom: -100px;
  right: -100px;
  animation-delay: -5s;
}

.blob-3 {
  width: 350px;
  height: 350px;
  background: linear-gradient(135deg, #10b981, #06b6d4);
  top: 40%;
  left: 60%;
  animation-delay: -10s;
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(60px, 40px) scale(1.1); }
}

/* Main Container */
.dashboard-container {
  width: 100%;
  max-width: 960px;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, #06b6d4, #6366f1);
  display: flex;
  justify-content: center;
  align-items: center;
  color: #fff;
  box-shadow: 0 8px 24px var(--primary-glow);
}

.brand-icon svg {
  width: 30px;
  height: 30px;
}

.title {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  padding: 8px 16px;
  border-radius: 9999px;
  font-size: 0.88rem;
  font-weight: 600;
  backdrop-filter: blur(8px);
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--success);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* Card */
.main-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(20px);
  border-radius: 28px;
  padding: 36px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.grid-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 36px;
  align-items: center;
}

/* QR Panel */
.qr-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.qr-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.qr-frame {
  width: 280px;
  height: 280px;
  background: #ffffff;
  padding: 14px;
  border-radius: 22px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

#qrImage {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: opacity 0.3s ease;
}

.qr-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.qr-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.qr-instruction {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 16px;
  border-radius: 14px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.qr-instruction strong {
  color: var(--text-main);
}

/* Info Panel */
.info-panel {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.info-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.block-label {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.label-with-copy {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ssid-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 18px;
  border-radius: 16px;
  color: var(--primary);
}

.ssid-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

.password-box {
  background: rgba(6, 182, 212, 0.08);
  border: 1.5px dashed rgba(6, 182, 212, 0.4);
  padding: 16px 20px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.3s ease;
}

.password-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: #38bdf8;
  text-shadow: 0 0 16px rgba(56, 189, 248, 0.35);
}

.copy-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

/* Timer */
.timer-block {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 16px;
  border-radius: 16px;
}

.timer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.timer-label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.timer-counter {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fbbf24;
}

.progress-bar-container {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #06b6d4, #6366f1, #ec4899);
  border-radius: 9999px;
  transition: width 1s linear;
}

.timer-tip {
  font-size: 0.78rem;
  color: #64748b;
}

/* Actions */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 24px;
  border-radius: 16px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.25s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #06b6d4, #3b82f6);
  color: #fff;
  box-shadow: 0 8px 24px var(--primary-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0891b2, #2563eb);
  box-shadow: 0 12px 30px rgba(6, 182, 212, 0.6);
  transform: translateY(-2px);
}

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

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* Footer */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 16px;
  font-size: 0.85rem;
  color: #64748b;
}

.footer-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-item strong {
  color: var(--text-muted);
}

.dot-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--success);
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
}

.toast {
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 12px 20px;
  border-radius: 14px;
  font-size: 0.9rem;
  font-weight: 500;
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.3s ease;
}

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

/* Responsive */
@media (max-width: 768px) {
  .grid-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .main-card {
    padding: 24px;
  }
  .password-text {
    font-size: 1.8rem;
  }
  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .footer {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }
}
