@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg-main: #070a13;
  --bg-card: #0d1222;
  --bg-card-hover: #12192e;
  --bg-input: #080c18;
  --border-color: #1e293b;
  --border-focus: #6366f1;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
  --cyan-accent: #38bdf8;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
}

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

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  padding: 0;
  margin: 0;
}

/* Header & Top Bar */
.top-header {
  background: rgba(13, 18, 34, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 16px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--primary-gradient);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.logo-title {
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.5px;
  background: linear-gradient(90deg, #fff 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-badges {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chatid-badge {
  background: #111827;
  border: 1px solid #1f2937;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  color: var(--cyan-accent);
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
}

.chatid-badge.missing {
  border-color: rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.1);
}

.admin-nav-btn {
  text-decoration: none;
  background: #1e293b;
  color: var(--text-main);
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-nav-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
}

/* Category Switcher Tabs */
.nav-tabs-wrapper {
  max-width: 900px;
  margin: 24px auto 0 auto;
  padding: 0 16px;
  width: 100%;
}

.category-tabs {
  display: flex;
  gap: 10px;
  background: #0f172a;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  width: fit-content;
}

.cat-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.cat-btn .badge {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 7px;
  border-radius: 12px;
  font-size: 11px;
  color: #cbd5e1;
}

.cat-btn.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.cat-btn.active .badge {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* Sub-items list (Pills) */
.sub-items-container {
  max-width: 900px;
  margin: 16px auto 0 auto;
  padding: 0 16px;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.item-pill {
  background: #0e1526;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.item-pill:hover {
  border-color: #3b82f6;
  color: #f1f5f9;
  background: #172033;
}

.item-pill.active {
  background: #1e293b;
  border-color: var(--cyan-accent);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

/* Form Container Card */
.main-content {
  max-width: 780px;
  margin: 24px auto 60px auto;
  padding: 0 16px;
  width: 100%;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.card-header {
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 16px;
}

.path-badge {
  font-family: 'JetBrains Mono', monospace;
  color: var(--cyan-accent);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
  display: block;
}

.subtitle {
  color: var(--text-muted);
  font-size: 14px;
}

/* Form inputs */
.form-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 14px;
  font-weight: 600;
  color: #cbd5e1;
}

.form-control {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: #f8fafc;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-family: inherit;
  transition: all 0.2s ease;
  width: 100%;
}

.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
  background: #0b1122;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* Action Buttons */
.button-row {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

.btn-primary {
  flex: 2;
  background: var(--primary-gradient);
  border: none;
  color: #ffffff;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.45);
}

.btn-secondary {
  flex: 1;
  background: #1e293b;
  border: 1px solid #334155;
  color: var(--text-main);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-secondary:hover:not(:disabled) {
  background: #27354a;
  border-color: #475569;
}

.btn-primary:disabled, .btn-secondary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Status Notifications */
.status-box {
  margin-top: 20px;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 14px;
  display: none;
}

.status-box.show {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-box.success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.status-box.error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.status-box.info {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #7dd3fc;
}

/* Modal for Image Preview */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 500px;
  width: 100%;
  padding: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
  position: relative;
  text-align: center;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
}

.modal-img {
  max-width: 100%;
  max-height: 70vh;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  object-fit: contain;
}

/* Spinner */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

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

/* Admin Dashboard Specific */
.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
}

.admin-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.data-table th {
  padding: 12px 14px;
  background: #080c18;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
}

.badge-failed {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
}

.setting-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.action-buttons {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

/* ==========================================================================
   ⚡ ADVANCED CYBER ZERO-TRUST LOGIN GATEWAY
   ========================================================================== */
.gateway-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at 50% 25%, rgba(99, 102, 241, 0.12) 0%, rgba(56, 189, 248, 0.04) 45%, transparent 70%);
}

.gateway-wrapper::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: 
    radial-gradient(1.5px 1.5px at 20px 30px, rgba(255, 255, 255, 0.1), transparent),
    radial-gradient(1.5px 1.5px at 40px 70px, rgba(56, 189, 248, 0.15), transparent),
    radial-gradient(1px 1px at 90px 40px, rgba(99, 102, 241, 0.2), transparent);
  background-repeat: repeat;
  background-size: 100px 100px;
  opacity: 0.35;
  pointer-events: none;
  animation: starryDrift 60s linear infinite;
}

@keyframes starryDrift {
  from { transform: translateY(0); }
  to { transform: translateY(-100px); }
}

.gateway-card {
  width: 100%;
  max-width: 440px;
  background: rgba(13, 18, 34, 0.78);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 20px;
  padding: 38px 32px 30px;
  box-shadow: 
    0 20px 50px -10px rgba(0, 0, 0, 0.7),
    0 0 30px -5px rgba(99, 102, 241, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
  z-index: 10;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

.gateway-card:hover {
  box-shadow: 
    0 25px 60px -10px rgba(0, 0, 0, 0.8),
    0 0 45px -5px rgba(56, 189, 248, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.gateway-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 6px 14px;
  border-radius: 30px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--cyan-accent);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulseNeon 2s infinite ease-in-out;
}

@keyframes pulseNeon {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.6; }
}

.gateway-icon-wrap {
  width: 68px;
  height: 68px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(56, 189, 248, 0.2) 100%);
  border: 1px solid rgba(56, 189, 248, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 0 25px rgba(99, 102, 241, 0.35);
}

.gateway-icon-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px dashed rgba(56, 189, 248, 0.4);
  animation: rotateRing 20s linear infinite;
}

@keyframes rotateRing {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.gateway-icon-svg {
  width: 32px;
  height: 32px;
  fill: none;
  stroke: var(--cyan-accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.6));
}

.gateway-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #ffffff;
  margin-bottom: 8px;
}

.gateway-desc {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 28px;
}

/* Cyber Form Inputs */
.cyber-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(8, 12, 24, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  transition: all 0.25s ease;
  overflow: hidden;
}

.cyber-input-wrap:focus-within {
  border-color: var(--cyan-accent);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.3);
  background: rgba(8, 12, 24, 0.98);
}

.cyber-input-prefix {
  padding-left: 14px;
  display: flex;
  align-items: center;
  color: var(--cyan-accent);
  opacity: 0.8;
}

.cyber-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  padding: 14px 12px;
  letter-spacing: 1px;
}

.cyber-input::placeholder {
  color: rgba(148, 163, 184, 0.5);
  font-family: 'Plus Jakarta Sans', sans-serif;
  letter-spacing: 0;
}

.cyber-toggle-pass {
  background: transparent;
  border: none;
  padding: 10px 14px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.cyber-toggle-pass:hover {
  color: #ffffff;
}

.caps-alert {
  display: none;
  margin-top: 8px;
  padding: 6px 10px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 6px;
  font-size: 11.5px;
  color: #fbbf24;
  text-align: left;
  animation: fadeIn 0.2s ease;
}

.cyber-submit-btn {
  width: 100%;
  margin-top: 20px;
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1 0%, #38bdf8 100%);
  border: none;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
  transition: all 0.25s ease;
}

.cyber-submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(56, 189, 248, 0.5);
}

.cyber-submit-btn:active:not(:disabled) {
  transform: translateY(0);
}

.cyber-submit-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.cyber-footer-telemetry {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-around;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
}

.cyber-footer-telemetry span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Shake Animation for Failed Logins */
.shake-card {
  animation: shakeKeyframes 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shakeKeyframes {
  10%, 90% { transform: translate3d(-3px, 0, 0); }
  20%, 80% { transform: translate3d(5px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
  40%, 60% { transform: translate3d(6px, 0, 0); }
}

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


