/* Enterprise Slate & Azure Palette */
:root {
  --bg-base: #020617;
  --bg-surface: #0f172a;
  --bg-gradient: radial-gradient(circle at 50% 0%, #1e293b 0%, #020617 100%);
  --primary: #38bdf8;
  --primary-muted: rgba(56, 189, 248, 0.1);
  --primary-glow: rgba(56, 189, 248, 0.25);
  --accent: #818cf8;
  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-bright: rgba(255, 255, 255, 0.1);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --radius-xl: 1.5rem;
  --radius-2xl: 2rem;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-base);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
.logo {
  font-family: 'Outfit', sans-serif;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 4rem;
  background: rgba(2, 6, 23, 0.8);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.logo {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  background: linear-gradient(to right, #fff, var(--primary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 3rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.875rem;
  transition: var(--ease-out);
}

.nav-links a:hover {
  color: var(--primary);
  text-shadow: 0 0 15px var(--primary-glow);
}

.section {
  padding: 4rem 2rem;
  max-width: 1300px;
  margin: 0 auto;
}

/* Hero Section */
.hero-title {
  font-size: clamp(3.5rem, 8vw, 6rem);
  font-weight: 900;
  letter-spacing: -0.05em;
  margin-bottom: 1rem;
  line-height: 1;
  background: linear-gradient(to bottom, #fff, #94a3b8);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin-bottom: 4rem;
  font-weight: 400;
  line-height: 1.6;
}

/* Header Buttons */
.header-buttons {
  margin-bottom: 3rem;
}

.nav-btn {
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  font-family: inherit;
  border: none;
}

.nav-btn {
  padding: 0.625rem 1.25rem;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--ease-out);
  font-family: inherit;
  border: 1px solid transparent;
}

.nav-btn.primary {
  background: var(--primary);
  color: #020617;
  box-shadow: 0 0 20px var(--primary-glow);
}

.nav-btn.primary:hover {
  transform: translateY(-1px);
  background: #7dd3fc;
  box-shadow: 0 0 30px var(--primary-glow);
}

.nav-btn.secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-bright);
}

.nav-btn.secondary:hover {
  background: #1e293b;
  border-color: var(--primary);
}

/* Grids */
.category-grid,
.algo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.card,
.algo-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 2rem;
  border-radius: var(--radius-xl);
  transition: var(--ease-out);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.card:hover,
.algo-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  background: #111a2e;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--primary-muted);
}

.card h3,
.algo-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.card p,
.algo-card p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.5;
}

/* Badges */
.badge {
  font-size: 0.7rem;
  padding: 0.3rem 0.8rem;
  border-radius: 2rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge.basic {
  background: rgba(46, 204, 113, 0.1);
  color: #2ecc71;
  border: 1px solid rgba(46, 204, 113, 0.2);
}

.badge.intermediate {
  background: rgba(241, 196, 15, 0.1);
  color: #f1c40f;
  border: 1px solid rgba(241, 196, 15, 0.2);
}

.badge.advanced {
  background: rgba(231, 76, 60, 0.1);
  color: #e74c3c;
  border: 1px solid rgba(231, 76, 60, 0.2);
}

/* Detail Layout */
.detail-view .section-header {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  margin-bottom: 4rem;
}

.back-btn {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  padding: 0.8rem 1.8rem;
  border-radius: 1rem;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.back-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateX(-5px);
}

.detail-layout {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 5rem;
  align-items: start;
}

@media (max-width: 1100px) {
  .detail-layout {
    grid-template-columns: 1fr;
  }
}

.info-panel {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.info-block h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.pros-box,
.cons-box {
  padding: 1.5rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
}

.pros-box h4 {
  color: #2ecc71;
  margin-bottom: 1rem;
}

.cons-box h4 {
  color: #e74c3c;
  margin-bottom: 1rem;
}

.pros-box ul,
.cons-box ul {
  list-style: none;
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pros-box li::before {
  content: "• ";
  color: #2ecc71;
}

.cons-box li::before {
  content: "• ";
  color: #e74c3c;
}

/* Enterprise Detail Blocks */
.info-block.mastery-block {
  margin-top: 3rem;
  background: rgba(129, 140, 248, 0.03);
  border: 1px solid rgba(129, 140, 248, 0.1);
  border-left: 4px solid var(--accent);
  padding: 2rem;
  border-radius: 1.5rem;
}

.info-block.code-block {
  margin-top: 3rem;
  background: #020617;
  border: 1px solid var(--border-bright);
  padding: 2.5rem;
  border-radius: 1.5rem;
}

.code-output-pre {
  margin-top: 1.5rem;
  background: rgba(15, 23, 42, 0.6);
  padding: 1.5rem;
  border-radius: 1rem;
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Visual Panel */
.visual-panel {
  position: sticky;
  top: 120px;
}

.viz-container {
  background: #05070a;
  border: 1px solid var(--border-bright);
  border-radius: 2.5rem;
  height: 600px;
  position: relative;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.7), 0 0 1px 1px rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 2rem;
}

.viz-placeholder {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 3rem;
  background: radial-gradient(circle at center, rgba(56, 189, 248, 0.05) 0%, transparent 70%);
  border-radius: 2rem;
}

.viz-placeholder h3 {
  font-size: 1.5rem;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.viz-placeholder p {
  color: var(--text-secondary);
  max-width: 400px;
  line-height: 1.6;
}

.viz-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  animation: fadeIn 0.5s ease-out;
}

.coming-soon-icon {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 0 15px var(--primary-glow));
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.viz-image {
  max-width: 100%;
  max-height: 100%;
  border-radius: 1.5rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-bright);
}

/* Controls */
.controls-panel {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%);
  border: 1px solid var(--glass-border);
  padding: 2rem;
  border-radius: 1.5rem;
}

.control-group {
  margin-top: 1.5rem;
}

.control-group label {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  font-weight: 500;
}

input[type="range"] {
  width: 100%;
  height: 6px;
  background: var(--glass-border);
  border-radius: 10px;
  appearance: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  background: var(--primary-color);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--primary-color);
}

/* ---------------------------------
   AI Expert Chat Widget Styles
   --------------------------------- */
#ai-chat-widget {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 9999;
  font-family: 'Inter', sans-serif;
}

#ai-chat-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3498db, #9b59b6);
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  align-items: center;
  justify-content: center;
}

#ai-chat-toggle:hover {
  transform: scale(1.1);
}

#ai-chat-panel {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 380px;
  height: 600px;
  max-height: 80vh;
  background: rgba(15, 15, 15, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  transition: opacity 0.3s, transform 0.3s;
  transform-origin: bottom right;
}

#ai-chat-panel.hidden {
  opacity: 0;
  transform: scale(0.9) translateY(20px);
  pointer-events: none;
}

.chat-header {
  padding: 15px 20px;
  background: rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-info h3 {
  font-size: 1rem;
  color: #fff;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-indicator {
  width: 8px;
  height: 8px;
  background: #2ecc71;
  border-radius: 50%;
  border: 1px solid #000;
  box-shadow: 0 0 8px #2ecc71;
}

.header-actions button {
  background: none;
  border: none;
  color: #aaa;
  cursor: pointer;
  font-size: 1.1rem;
  transition: color 0.2s;
  margin-left: 10px;
}

.header-actions button:hover {
  color: #fff;
}

#chat-settings-panel {
  padding: 15px;
  background: #111;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#chat-settings-panel label {
  font-size: 0.8rem;
  color: #aaa;
}

#chat-settings-panel input {
  padding: 8px;
  border-radius: 4px;
  border: 1px solid #333;
  background: #000;
  color: #fff;
  font-size: 0.9rem;
}

#chat-settings-panel button {
  padding: 8px;
  background: #3498db;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.message {
  display: flex;
  flex-direction: column;
  max-width: 85%;
}

.system-msg {
  align-self: flex-start;
}

.user-msg {
  align-self: flex-end;
}

.msg-content {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.95rem;
  line-height: 1.5;
  word-wrap: break-word;
}

.system-msg .msg-content {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom-left-radius: 2px;
}

.system-msg .msg-content pre {
  background: #000;
  padding: 10px;
  border-radius: 8px;
  overflow-x: auto;
  margin-top: 5px;
  font-size: 0.85rem;
}

.user-msg .msg-content {
  background: #3498db;
  color: white;
  border-bottom-right-radius: 2px;
}

.chat-input-area {
  padding: 15px;
  background: rgba(0, 0, 0, 0.6);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

#image-preview-container {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
}

#image-preview-container.hidden {
  display: none !important;
}

#chat-image-preview {
  max-height: 80px;
  max-width: 80px;
  border-radius: 4px;
  object-fit: contain;
}

#remove-image-btn {
  background: #e74c3c;
  color: white;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.input-controls {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.upload-btn {
  cursor: pointer;
  font-size: 1.2rem;
  padding: 5px;
  color: #aaa;
  transition: color 0.2s;
}

.upload-btn:hover {
  color: #3498db;
}

#chat-input {
  flex: 1;
  background: transparent;
  border: none;
  color: white;
  font-size: 0.95rem;
  resize: none;
  max-height: 120px;
  padding: 5px 0;
  font-family: inherit;
  outline: none;
}

#chat-input::placeholder {
  color: #666;
}

#chat-send-btn {
  background: #3498db;
  color: white;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background 0.2s;
}

#chat-send-btn:hover {
  background: #2980b9;
  transform: scale(1.05);
}

#chat-send-btn:disabled {
  background: #555;
  cursor: not-allowed;
  transform: none;
}

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  width: fit-content;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  background: #aaa;
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) {
  animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes typing {

  0%,
  80%,
  100% {
    transform: scale(0);
  }

  40% {
    transform: scale(1);
  }
}

/* Footer Styling */
.site-footer {
  text-align: center;
  padding: 2rem;
  margin-top: 4rem;
  border-top: 1px solid var(--border-subtle);
  background: rgba(2, 6, 23, 0.8);
  backdrop-filter: blur(10px);
}

.site-footer p {
  color: var(--text-tertiary);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}