/* ==========================================
   AETHER - CHAT DEMO STYLING SYSTEM
   High Contrast Dark Theme for Projectors
   ========================================== */

:root {
  /* Core Theme Colors */
  --bg-primary: #06070a;
  --bg-secondary: #0c0d14;
  --glass-bg: rgba(18, 20, 32, 0.6);
  --glass-bg-hover: rgba(28, 30, 48, 0.8);
  --glass-border: rgba(255, 255, 255, 0.08);
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  
  /* Active Theme Accents */
  --accent-primary: #8b5cf6;
  --accent-primary-glow: rgba(139, 92, 246, 0.2);
  --accent-primary-hover: #7c3aed;

  /* Neon Accents */
  --accent-purple: #8b5cf6;
  --accent-purple-glow: rgba(139, 92, 246, 0.2);
  --accent-purple-hover: #7c3aed;
  
  --accent-cyan: #06b6d4;
  --accent-cyan-glow: rgba(6, 182, 212, 0.2);
  --accent-cyan-hover: #0891b2;
  
  --accent-rose: #f43f5e;
  --accent-rose-glow: rgba(244, 63, 94, 0.2);
  --accent-rose-hover: #e11d48;
  
  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.2);
  --accent-emerald-hover: #059669;

  --accent-orange: #f97316;
  --accent-orange-glow: rgba(249, 115, 22, 0.2);
  --accent-orange-hover: #ea580c;

  --accent-gold: #eab308;
  --accent-gold-glow: rgba(234, 179, 8, 0.2);
  --accent-gold-hover: #ca8a04;
  
  /* Borders & Blur */
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 20px;
  --border-radius-full: 9999px;
  --glass-blur: blur(20px) saturate(180%);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --box-shadow-glow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* Base Styles & Custom Scrollbar */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  line-height: 1.5;
  background-image: 
    radial-gradient(circle at 5% 5%, rgba(139, 92, 246, 0.04) 0%, transparent 35%),
    radial-gradient(circle at 95% 95%, rgba(6, 182, 212, 0.03) 0%, transparent 35%);
}

/* Scrollbar styles */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Grid Layout */
.app-layout {
  display: grid;
  grid-template-columns: 1fr;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* ==========================================
   MAIN CHAT CONTAINER
   ========================================== */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  background-color: var(--bg-primary);
}

/* Chat Header */
.chat-header {
  height: 80px;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  background: rgba(6, 7, 10, 0.6);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-glow {
  width: 38px;
  height: 38px;
  border-radius: var(--border-radius-md);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px var(--accent-primary-glow);
}

.logo-glow i {
  color: #fff;
  width: 20px;
  height: 20px;
}

.brand-text h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.badge-status {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
  display: block;
  margin-top: -2px;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* Counter Badge */
.counter-badge {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius-full);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.dot-indicator {
  width: 8px;
  height: 8px;
  border-radius: var(--border-radius-full);
  background-color: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
}

.dot-indicator.pulsing {
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.8; box-shadow: 0 0 0 0 rgba(6, 182, 212, 0.5); }
  50% { transform: scale(1.1); opacity: 1; box-shadow: 0 0 12px 4px rgba(6, 182, 212, 0.3); }
  100% { transform: scale(0.9); opacity: 0.8; box-shadow: 0 0 0 0 rgba(6, 182, 212, 0); }
}

.counter-text strong {
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
}

/* Chat History Window */
.chat-history {
  flex-grow: 1;
  overflow-y: auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  scroll-behavior: smooth;
}

/* Welcome Panel styling */
.welcome-message-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: auto;
  max-width: 480px;
  text-align: center;
  padding: 2rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--box-shadow-glow);
  animation: scaleUp 0.3s ease-out;
}

@keyframes scaleUp {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.welcome-icon {
  width: 48px;
  height: 48px;
  color: var(--accent-primary);
  margin-bottom: 1rem;
  filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.3));
}

.welcome-message-panel h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.welcome-message-panel p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.demo-hints {
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid var(--glass-border);
  padding-top: 0.85rem;
  width: 100%;
}

.demo-hints strong {
  color: var(--text-secondary);
}

/* Message Bubbles */
.message {
  display: flex;
  flex-direction: column;
  max-width: 80%;
  animation: messageFadeIn 0.3s ease-out forwards;
}

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

.message.user {
  align-self: flex-end;
}

.message.assistant {
  align-self: flex-start;
}

.message-bubble {
  padding: 0.9rem 1.25rem;
  border-radius: var(--border-radius-lg);
  font-size: 0.95rem;
  line-height: 1.6;
}

.message.user .message-bubble {
  background: var(--accent-primary-glow);
  border: 1px solid var(--accent-primary-glow);
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 15px var(--accent-primary-glow);
}

.message.assistant .message-bubble {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-left: 3px solid var(--accent-primary);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

/* Markdown formatting in assistant response */
.message-bubble h1, .message-bubble h2, .message-bubble h3 {
  font-family: 'Outfit', sans-serif;
  margin: 0.75rem 0 0.5rem 0;
  font-weight: 600;
}
.message-bubble h1:first-child, .message-bubble h2:first-child, .message-bubble h3:first-child {
  margin-top: 0;
}
.message-bubble h3 {
  font-size: 1.05rem;
  color: var(--accent-cyan);
}
.message-bubble p {
  margin-bottom: 0.75rem;
}
.message-bubble p:last-child {
  margin-bottom: 0;
}
.message-bubble blockquote {
  border-left: 2px solid var(--accent-cyan);
  padding-left: 0.75rem;
  color: var(--text-secondary);
  font-style: italic;
  margin: 0.5rem 0;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
}
.message-bubble ul, .message-bubble ol {
  padding-left: 1.25rem;
  margin-bottom: 0.75rem;
}

.message-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  margin-left: 0.5rem;
}

.message.user .message-time {
  text-align: right;
  margin-right: 0.5rem;
}

/* Typing / Loading Indicator */
.loading-indicator {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 2rem;
  margin-bottom: 1.5rem;
}

.typing-dots {
  display: flex;
  gap: 4px;
}

.typing-dots span {
  width: 8px;
  height: 8px;
  background-color: var(--accent-primary);
  border-radius: var(--border-radius-full);
  animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1.0); }
}

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

/* ==========================================
   SOURCES PANEL (COLLAPSIBLE BELOW CHAT)
   ========================================== */
.sources-panel {
  background: rgba(12, 13, 20, 0.8);
  border-top: 1px solid var(--glass-border);
  z-index: 5;
  transition: all var(--transition-normal);
}

.sources-header {
  padding: 0.75rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.sources-header:hover {
  background: rgba(255, 255, 255, 0.02);
}

.sources-header i {
  width: 16px;
  height: 16px;
}

.toggle-icon {
  transition: transform var(--transition-normal);
}

.sources-panel.collapsed .toggle-icon {
  transform: rotate(180deg);
}

.sources-content {
  max-height: 180px;
  overflow-y: auto;
  padding: 0 2rem 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  animation: slideDown var(--transition-normal) forwards;
}

.sources-panel.collapsed .sources-content {
  display: none !important;
}

.source-citation-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  padding: 0.75rem 1rem;
}

.source-title {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
}

.source-title i {
  width: 14px;
  height: 14px;
}

.source-snippet {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.5;
  white-space: pre-wrap;
}

/* ==========================================
   INPUT BAR & SECURITY LOCKOUT
   ========================================== */
.chat-input-bar {
  padding: 1.5rem 2rem 2rem 2rem;
  border-top: 1px solid var(--glass-border);
  background: rgba(6, 7, 10, 0.85);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  z-index: 10;
}

.input-form {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  max-width: 100%;
}

.textarea-wrapper {
  flex-grow: 1;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  padding: 0.65rem 1rem;
  display: flex;
  transition: border-color var(--transition-normal);
}

.textarea-wrapper:focus-within {
  border-color: var(--accent-primary);
}

#user-input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  resize: none;
  height: 1.5em;
  max-height: 120px;
  line-height: 1.5;
  padding: 0;
  margin: 0;
  overflow-y: auto;
}

/* Lockout Alert Message */
.lockout-alert {
  background: var(--accent-rose-glow);
  border-top: 1px solid rgba(244, 63, 94, 0.3);
  border-bottom: 1px solid rgba(244, 63, 94, 0.3);
  padding: 0.75rem 2rem;
  color: var(--accent-rose);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  animation: slideInBottom var(--transition-normal) forwards;
}

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

.lockout-alert i {
  width: 16px;
  height: 16px;
}

/* Disabled styling on elements */
textarea:disabled, 
.textarea-wrapper.disabled {
  background: rgba(255, 255, 255, 0.02) !important;
  border-color: rgba(255, 255, 255, 0.05) !important;
  color: var(--text-muted) !important;
  cursor: not-allowed;
}

button:disabled {
  background-color: rgba(255, 255, 255, 0.05) !important;
  border-color: transparent !important;
  color: var(--text-muted) !important;
  box-shadow: none !important;
  cursor: not-allowed;
  transform: none !important;
}

/* Buttons */
.btn {
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--border-radius-md);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn i {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background-color: var(--accent-primary);
  color: #fff;
  box-shadow: 0 4px 15px var(--accent-primary-glow);
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--accent-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.45);
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  border-color: var(--glass-border);
}

.btn-secondary:hover:not(:disabled) {
  background-color: rgba(255, 255, 255, 0.09);
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-danger-only:hover {
  background-color: var(--accent-rose-glow);
  color: var(--accent-rose);
  border-color: rgba(244, 63, 94, 0.3);
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  border-radius: var(--border-radius-sm);
}

.btn-sm i {
  width: 14px;
  height: 14px;
}

/* ==========================================
   SIDEBAR PANEL (RIGHT SIDE)
   ========================================== */
.sidebar-panel {
  background-color: var(--bg-secondary);
  border-left: 1px solid var(--glass-border);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  overflow-y: auto;
}

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

.section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 0.5rem;
}

.section-title i {
  color: var(--accent-primary);
  width: 18px;
  height: 18px;
}

.section-title h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
}

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

/* Upload zone */
.upload-zone {
  border: 1.5px dashed var(--glass-border);
  border-radius: var(--border-radius-md);
  padding: 1.5rem 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.1);
  transition: all var(--transition-normal);
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--accent-primary);
  background: rgba(139, 92, 246, 0.05);
}

.upload-zone i {
  width: 32px;
  height: 32px;
  color: var(--text-muted);
}

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

/* Document list */
.document-list-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.list-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.document-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 160px;
  overflow-y: auto;
}

.document-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-sm);
  font-size: 0.8rem;
}

.document-item-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow: hidden;
}

.document-item-left i {
  color: var(--accent-cyan);
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.document-item-left .doc-preview-icon {
  color: var(--text-muted);
  opacity: 0.5;
  transition: all var(--transition-normal);
}

.document-item-left:hover .doc-preview-icon {
  color: var(--accent-cyan);
  opacity: 1;
  transform: scale(1.15);
}


.doc-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-secondary);
}

.doc-delete-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0.2rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.doc-delete-btn:hover {
  color: var(--accent-rose);
  background: var(--accent-rose-glow);
}

/* Info section card */
.info-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  padding: 1rem;
  font-size: 0.8rem;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.small-text {
  font-size: 0.7rem;
  color: var(--text-muted);
}

code {
  font-family: monospace;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  color: var(--accent-cyan);
}

/* Sidebar Footer status */
.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--glass-border);
  padding-top: 1rem;
}

.system-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: var(--border-radius-full);
}

.status-indicator.online {
  background-color: var(--accent-emerald);
  box-shadow: 0 0 6px var(--accent-emerald);
}

.status-indicator.simulated {
  background-color: var(--accent-cyan);
  box-shadow: 0 0 6px var(--accent-cyan);
}

/* Toast Notification Styling */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 2000;
}

.toast {
  background: rgba(12, 13, 20, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  padding: 0.8rem 1.25rem;
  border-radius: var(--border-radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  min-width: 260px;
  border-left: 4px solid var(--accent-primary);
}

.toast-success { border-left-color: var(--accent-emerald); }
.toast-error { border-left-color: var(--accent-rose); }
.toast-info { border-left-color: var(--accent-cyan); }

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

.toast.fade-out {
  animation: fadeOutRight 0.3s ease-out forwards;
}

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

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

/* Responsive (Mobile/Tablet) */
@media (max-width: 900px) {
  .app-layout {
    grid-template-columns: 1fr;
  }
  
  .sidebar-panel {
    display: none; /* simple hidden for conference single pane layout */
  }
}

/* ==========================================
   ADMIN PANELS & CONSOLE
   ========================================== */
.admin-content-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  padding: 2rem;
  overflow-y: auto;
  flex-grow: 1;
}

.admin-pane {
  display: flex;
  flex-direction: column;
  height: max-content;
}

.card-panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  padding: 1.75rem;
  box-shadow: var(--box-shadow-glow);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.btn-icon {
  padding: 0.65rem;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-md);
}

.btn-icon i {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn-danger-only:hover:not(:disabled) {
  background-color: var(--accent-rose-glow) !important;
  color: var(--accent-rose) !important;
  border-color: rgba(244, 63, 94, 0.3) !important;
}

/* Admin Tabs Navigation */
.admin-tabs-nav {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 2rem 0 2rem;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(6, 7, 10, 0.3);
}

.tab-nav-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  padding: 0.75rem 1.25rem;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all var(--transition-normal);
}

.tab-nav-btn i {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.tab-nav-btn:hover {
  color: var(--text-primary);
}

.tab-nav-btn.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
}

/* Tab content panes */
.admin-tab-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-tab-pane {
  display: none;
  flex-grow: 1;
  flex-direction: column;
  overflow-y: auto;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s ease-out, transform 0.25s ease-out;
}

.admin-tab-pane.active {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

/* Grids for tabs content */
.admin-content-grid.kb-grid {
  grid-template-columns: 1fr 1.2fr;
}

.admin-content-grid.single-pane-grid {
  grid-template-columns: 1fr;
  max-width: 580px;
  margin: 0 auto;
  width: 100%;
}

.admin-content-grid.wide-pane-grid {
  grid-template-columns: 1fr;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

@media (max-width: 1024px) {
  .admin-content-grid.kb-grid,
  .admin-content-grid.single-pane-grid,
  .admin-content-grid.wide-pane-grid {
    grid-template-columns: 1fr;
    padding: 1.5rem;
    gap: 1.5rem;
  }
}

/* ==========================================
   MODALS & LOGIN FORM
   ========================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(6, 8, 14, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

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

.modal-container {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  width: 90%;
  max-width: 450px;
  box-shadow: var(--box-shadow-glow);
  overflow: hidden;
  transform: scale(0.95);
  transition: transform var(--transition-normal);
}

.modal-overlay.active .modal-container {
  transform: scale(1);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--border-radius-sm);
  transition: all var(--transition-normal);
}

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

.modal-form {
  padding: 1.5rem;
}

.form-group {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.form-group input {
  padding: 0.65rem 0.85rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition-normal);
}

.form-group input:focus {
  border-color: var(--accent-primary);
}

.modal-footer {
  margin-top: 1.5rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Theme Classes applied to body */
body.theme-purple {
  --accent-primary: var(--accent-purple);
  --accent-primary-glow: var(--accent-purple-glow);
  --accent-primary-hover: var(--accent-purple-hover);
}
body.theme-cyan {
  --accent-primary: var(--accent-cyan);
  --accent-primary-glow: var(--accent-cyan-glow);
  --accent-primary-hover: var(--accent-cyan-hover);
}
body.theme-rose {
  --accent-primary: var(--accent-rose);
  --accent-primary-glow: var(--accent-rose-glow);
  --accent-primary-hover: var(--accent-rose-hover);
}
body.theme-emerald {
  --accent-primary: var(--accent-emerald);
  --accent-primary-glow: var(--accent-emerald-glow);
  --accent-primary-hover: var(--accent-emerald-hover);
}
body.theme-orange {
  --accent-primary: var(--accent-orange);
  --accent-primary-glow: var(--accent-orange-glow);
  --accent-primary-hover: var(--accent-orange-hover);
}
body.theme-gold {
  --accent-primary: var(--accent-gold);
  --accent-primary-glow: var(--accent-gold-glow);
  --accent-primary-hover: var(--accent-gold-hover);
}

/* Custom Select styling & Theme radios */
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 1rem;
  padding-right: 2.5rem !important;
}

select:focus {
  border-color: var(--accent-primary) !important;
}

.theme-option-label:has(input:checked) {
  border-color: var(--accent-primary) !important;
  background: var(--accent-primary-glow) !important;
}
