/* Visual Design System for EPICS @ MPG Portal */

:root {
  /* Colors */
  --bg-primary: #f2f5f5; /* Light MPG Green-grey */
  --bg-secondary: #ffffff; /* White cards */
  --bg-tertiary: #e1e7e7; /* Light border / separator */
  --accent-blue: #006c66; /* MPG Green */
  --accent-cyan: #0d9488; /* Teal */
  --accent-purple: #0f766e; /* Darker Teal */
  --accent-orange: #d97706; /* Amber warning */
  --accent-red: #dc2626; /* Red error */
  --accent-warm: #ea580c; /* Premium Coral Orange */
  
  --text-main: #0f172a; /* Dark text */
  --text-muted: #334155; /* Slate-700 */
  --text-dim: #64748b; /* Slate-500 */
  
  --border-color: rgba(0, 108, 102, 0.08); /* Subtle green border */
  --border-glow: rgba(0, 108, 102, 0.15); /* Green glow */
  --glass-bg: rgba(255, 255, 255, 0.85); /* Glass header */
  
  /* Fonts */
  --font-heading: 'Outfit', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-code: 'Fira Code', monospace;
  
  /* Layout */
  --sidebar-width: 280px;
  --top-bar-height: 70px;
  
  /* Transitions */
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;
}

/* Reset and Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Mobile Sidebar Overlay */
.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
  backdrop-filter: blur(2px);
}

.mobile-overlay.active {
  display: block;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  overflow: hidden; /* App-like layout */
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* App Layout Grid */
.app-container {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  height: 100vh;
  width: 100vw;
  transition: grid-template-columns 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-container.sidebar-collapsed {
  grid-template-columns: 0px 1fr;
}

.app-container.sidebar-collapsed .sidebar {
  overflow: hidden;
  padding: 0;
  border-right: none;
}

/* Sidebar Styling */
.sidebar {
  background-color: #004d47; /* Deep MPG Green */
  border-right: 1px solid rgba(0, 108, 102, 0.15);
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 1.5rem 1rem;
  overflow-y: auto;
  overflow-x: hidden;
  transition: padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
  margin-bottom: 2rem;
}

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

.logo-img {
  height: 64px; /* Prominent size for the EPICS brand mark */
  width: auto;
  display: block;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.15));
  transition: var(--transition-smooth);
}

.logo-img:hover {
  filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.35));
  transform: scale(1.02);
}

.status-indicator {
  align-items: center;
  background-color: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
  display: inline-flex;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.35rem 0.75rem;
}

.status-pulse {
  background-color: #34d399;
  border-radius: 50%;
  display: inline-block;
  height: 8px;
  width: 8px;
  box-shadow: 0 0 10px #34d399;
  animation: status-pulse-anim 2s infinite;
}

.status-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: #a7f3d0;
}

/* Sidebar Menu */
.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.menu-category {
  color: #9cd4d0;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  padding-left: 0.75rem;
}

.menu-group {
  margin-top: 0.75rem;
}

.menu-category-summary {
  list-style: none; /* Hide default triangle */
  outline: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #9cd4d0;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.5rem 0.75rem;
  user-select: none;
}

.menu-category-summary::-webkit-details-marker {
  display: none;
}

.menu-category-summary:hover {
  color: #ffffff;
}

.category-header-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chevron-icon {
  width: 12px;
  height: 12px;
  transition: transform 0.2s ease;
  color: #9cd4d0;
}

.menu-group[open] .chevron-icon {
  transform: rotate(180deg);
}

.submenu-links {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-top: 0.25rem;
  padding-left: 0.5rem;
  border-left: 1px solid rgba(255, 255, 255, 0.03);
  margin-left: 1.25rem;
}

.menu-item {
  align-items: center;
  border-radius: 8px;
  color: #cbd5e1;
  display: flex;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: var(--transition-fast);
}

.menu-item:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.menu-item.active {
  background-color: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-left: 4px solid var(--accent-warm);
  padding-left: 0.5rem;
  color: #ffffff;
  box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.05);
}

.menu-item.highlight {
  border: 1px dashed rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.menu-item.highlight:hover {
  background-color: rgba(245, 158, 11, 0.1);
}

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

.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: auto;
  padding-top: 1rem;
}

.footer-link {
  color: #9cd4d0;
  font-size: 0.85rem;
  text-decoration: none;
  transition: var(--transition-fast);
}

.footer-link:hover {
  color: #ffffff;
}

/* Main Panel */
.main-panel {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Hamburger Toggle Button */
.sidebar-toggle-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
  padding: 0.45rem 0.55rem;
  flex-shrink: 0;
  transition: var(--transition-fast);
}

.sidebar-toggle-btn:hover {
  background-color: rgba(0, 108, 102, 0.06);
  border-color: var(--accent-blue);
}

.hamburger-bar {
  background-color: var(--text-muted);
  border-radius: 2px;
  display: block;
  height: 2px;
  transition: var(--transition-fast);
  width: 18px;
}

.sidebar-toggle-btn:hover .hamburger-bar {
  background-color: var(--accent-blue);
}

.sidebar-toggle-btn.is-collapsed .hamburger-bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.sidebar-toggle-btn.is-collapsed .hamburger-bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.sidebar-toggle-btn.is-collapsed .hamburger-bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Top Bar Styling */
.top-bar {
  align-items: center;
  background-color: var(--glass-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  gap: 1rem;
  height: var(--top-bar-height);
  justify-content: space-between;
  padding: 0 2rem;
  z-index: 10;
}

.search-container {
  align-items: center;
  background-color: rgba(0, 108, 102, 0.03);
  border: 1px solid rgba(0, 108, 102, 0.1);
  border-radius: 9999px;
  display: flex;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  width: 350px;
  transition: var(--transition-smooth);
}

.search-container:focus-within {
  background-color: rgba(0, 108, 102, 0.05);
  border-color: var(--accent-blue);
  box-shadow: 0 0 15px rgba(0, 108, 102, 0.1);
}

.search-icon {
  color: var(--text-dim);
  width: 16px;
  height: 16px;
}

#search-input {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.85rem;
  outline: none;
  width: 100%;
}

#search-input::placeholder {
  color: var(--text-dim);
}

.top-actions {
  align-items: center;
  display: flex;
  gap: 1.5rem;
}

.stats-badge {
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  display: flex;
  gap: 0.75rem;
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
}

.badge-title {
  color: var(--text-muted);
}

.badge-value {
  color: var(--accent-warm);
  font-weight: 600;
}

.lang-toggle-group {
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  display: flex;
  padding: 0.15rem;
}

.lang-btn {
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  transition: var(--transition-fast);
}

.lang-btn.active {
  background-color: var(--accent-warm);
  color: white;
}

/* Scrollable Content Container */
.content-scroll-container {
  flex: 1;
  overflow-y: auto;
  padding: 2.5rem;
  /* Scrollbar custom styling */
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.content-scroll-container::-webkit-scrollbar {
  width: 6px;
}

.content-scroll-container::-webkit-scrollbar-thumb {
  background-color: var(--border-color);
  border-radius: 999px;
}

/* Dynamic Section Switching */
.content-section {
  display: none;
  animation: fade-in 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.content-section.active {
  display: block;
}

/* Hero Banner */
.hero-banner {
  background: linear-gradient(135deg, #006c66 0%, #004d47 100%);
  border: 1px solid rgba(0, 108, 102, 0.2);
  border-radius: 16px;
  padding: 3rem;
  position: relative;
  overflow: hidden;
  margin-bottom: 2rem;
  box-shadow: 0 10px 30px rgba(0, 108, 102, 0.1);
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, white 60%, #a7f3d0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  color: #e6f1f0;
  font-size: 1.15rem;
  max-width: 700px;
  z-index: 2;
  position: relative;
}

.hero-glow {
  background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 60%);
  position: absolute;
  top: -150px;
  right: -150px;
  width: 400px;
  height: 400px;
  pointer-events: none;
}

/* Alert Banner Styling */
.alert-card {
  align-items: flex-start;
  background: linear-gradient(90deg, rgba(220, 38, 38, 0.04) 0%, rgba(220, 38, 38, 0.01) 100%);
  border: 1px solid rgba(220, 38, 38, 0.15);
  border-left: 4px solid var(--accent-red);
  border-radius: 12px;
  display: flex;
  gap: 1.25rem;
  margin-bottom: 2.5rem;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 4px 20px rgba(220, 38, 38, 0.02);
}

.alert-icon-container {
  color: var(--accent-red);
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.alert-icon {
  width: 24px;
  height: 24px;
}

.alert-title {
  color: #991b1b;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.alert-text {
  color: #7f1d1d;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Feature & Grid Card Designs */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.card-grid.col-3 {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.feature-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  position: relative;
  transition: var(--transition-smooth);
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.feature-card.border-glow:hover {
  border-color: var(--accent-blue);
  box-shadow: 0 0 20px rgba(0, 108, 102, 0.12);
}

.card-icon {
  border-radius: 8px;
  display: inline-flex;
  padding: 0.75rem;
  margin-bottom: 1.5rem;
}

.card-icon.blue {
  background-color: rgba(0, 108, 102, 0.08);
  color: var(--accent-blue);
}

.card-icon.cyan {
  background-color: rgba(13, 148, 136, 0.08);
  color: var(--accent-cyan);
}

.card-icon.purple {
  background-color: rgba(15, 118, 110, 0.08);
  color: var(--accent-purple);
}

.card-icon.orange {
  background-color: rgba(234, 88, 12, 0.08);
  color: var(--accent-warm);
}

.card-icon svg {
  width: 24px;
  height: 24px;
}

.card-tag {
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-muted);
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding: 0.2rem 0.5rem;
  text-transform: uppercase;
}

.card-heading {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.card-text {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Sections Layout */
.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2rem;
  background: linear-gradient(135deg, white, var(--text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-top: -1.5rem;
  margin-bottom: 2.5rem;
}

/* Card base class */
.card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
}

/* Text Layout (Double block) */
.text-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.text-block h3 {
  font-size: 1.4rem;
  margin-bottom: 1.25rem;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.text-block p {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

.text-block ul {
  padding-left: 1.25rem;
}

.text-block li {
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

/* ChemLab Hero Custom Style */
.chemlab-hero {
  background: linear-gradient(135deg, rgba(8, 182, 212, 0.08) 0%, rgba(15, 22, 38, 0.5) 100%);
  border: 1px solid rgba(6, 182, 212, 0.2);
  border-radius: 16px;
  padding: 2.5rem;
  margin-bottom: 2.5rem;
  box-shadow: 0 4px 30px rgba(6, 182, 212, 0.03);
}

.chemlab-content h3 {
  font-size: 1.5rem;
  color: var(--accent-cyan);
  margin-bottom: 0.75rem;
}

.chemlab-content p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 800px;
}

/* Installation Guide Steps */
.interactive-steps-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.step-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  display: flex;
  gap: 2rem;
  padding: 2rem;
}

.step-num {
  align-items: center;
  background-color: rgba(255, 255, 255, 0.02);
  border: 2px solid var(--border-color);
  border-radius: 50%;
  color: var(--text-muted);
  display: flex;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  height: 60px;
  justify-content: center;
  width: 60px;
  flex-shrink: 0;
}

.step-card:hover .step-num {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
  transition: var(--transition-smooth);
}

.step-details h4 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.step-details p {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

/* Code Blocks */
.code-box {
  background-color: #05080E;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: #38bdf8;
  font-family: var(--font-code);
  font-size: 0.85rem;
  padding: 1rem 1.25rem;
  overflow-x: auto;
}

.code-box code {
  font-family: var(--font-code);
}

/* Architecture section style */
.arch-container {
  display: grid;
  grid-template-columns: 1.2fr 1.8fr;
  gap: 2rem;
}

.arch-description h3, .arch-diagram h3 {
  font-size: 1.35rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.arch-description p {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.interactive-svg {
  background-color: #05080E;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  width: 100%;
  height: auto;
  padding: 1rem;
}

/* Community Support Card */
.support-channels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.support-card {
  align-items: center;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  padding: 3rem 2rem;
  text-align: center;
  transition: var(--transition-smooth);
}

.support-card:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 255, 255, 0.15);
}

.support-icon {
  align-items: center;
  border-radius: 50%;
  display: flex;
  height: 70px;
  justify-content: center;
  margin-bottom: 1.5rem;
  width: 70px;
}

.support-card.email .support-icon {
  background-color: rgba(0, 108, 102, 0.08);
  color: var(--accent-blue);
}

.support-card.chat .support-icon {
  background-color: rgba(15, 118, 110, 0.08);
  color: var(--accent-purple);
}

.support-card.on-site .support-icon {
  background-color: rgba(13, 148, 136, 0.08);
  color: var(--accent-cyan);
}

.support-icon svg {
  width: 32px;
  height: 32px;
}

.support-card h4 {
  font-size: 1.35rem;
  margin-bottom: 0.75rem;
}

.support-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 2rem;
  min-height: 50px;
}

.btn-support {
  align-items: center;
  background-color: rgba(0, 108, 102, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-main);
  cursor: pointer;
  display: inline-flex;
  font-family: var(--font-heading);
  font-weight: 600;
  justify-content: center;
  padding: 0.65rem 1.25rem;
  text-decoration: none;
  transition: var(--transition-fast);
  width: 100%;
}

.btn-support:hover {
  background-color: var(--accent-blue);
  border-color: var(--accent-blue);
  color: white;
}

/* Demosystems cards */
.demo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.demo-item {
  cursor: pointer;
  transition: var(--transition-smooth);
}

.demo-item:hover {
  border-color: var(--accent-blue);
  box-shadow: 0 5px 25px rgba(59, 130, 246, 0.1);
  transform: translateY(-4px);
}

.demo-header {
  margin-bottom: 1.25rem;
}

.demo-badge {
  background-color: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.2);
  border-radius: 4px;
  color: var(--accent-cyan);
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  padding: 0.15rem 0.4rem;
  text-transform: uppercase;
}

.demo-item h3 {
  font-size: 1.35rem;
  color: var(--text-main);
}

.demo-item p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.btn-details {
  color: var(--accent-blue);
  font-weight: 600;
  font-size: 0.9rem;
}

/* Modal details container */
.demo-detail-container {
  border-left: 4px solid var(--accent-blue);
  margin-top: 2rem;
  position: relative;
  animation: slide-up 0.3s ease-out;
}

.demo-detail-container.hidden {
  display: none;
}

.close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.75rem;
  position: absolute;
  top: 1rem;
  right: 1.5rem;
}

.close-btn:hover {
  color: var(--text-main);
}

.demo-detail-content h4 {
  font-size: 1.4rem;
  color: var(--text-main);
  margin-bottom: 0.75rem;
}

.demo-detail-content p {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.demo-detail-content ul {
  padding-left: 1.25rem;
  margin-bottom: 1.5rem;
}

.demo-detail-content li {
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

/* Hardware catalog styling */
.hw-catalog {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.hw-item {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 2rem;
  align-items: center;
}

.hw-meta .hw-category {
  color: var(--accent-orange);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-block;
  margin-bottom: 0.25rem;
}

.hw-meta h3 {
  font-size: 1.4rem;
  color: var(--text-main);
}

.hw-item p {
  color: var(--text-muted);
  line-height: 1.6;
}

/* Animations */
@keyframes logo-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes status-pulse-anim {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.4; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive Breakpoints */
@media (max-width: 900px) {
  .app-container {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    width: var(--sidebar-width);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
  }

  .app-container.sidebar-open .sidebar {
    display: flex;
  }

  .text-layout {
    grid-template-columns: 1fr;
  }

  .arch-container {
    grid-template-columns: 1fr;
  }

  .hw-item {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .content-scroll-container {
    padding: 1.5rem;
  }
}

/* Wiki Text Content Custom Styles */
.wikitext-content {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.75;
}

.wikitext-content h1, 
.wikitext-content h2, 
.wikitext-content h3, 
.wikitext-content h4 {
  color: var(--text-main);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-family: var(--font-heading);
}

.wikitext-content h1 {
  font-size: 1.85rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
  margin-top: 0;
}

.wikitext-content h2 { font-size: 1.5rem; }
.wikitext-content h3 { font-size: 1.3rem; }

.wikitext-content p {
  margin-bottom: 1.25rem;
}

.wikitext-content ul, 
.wikitext-content ol {
  margin-bottom: 1.5rem;
  padding-left: 1.75rem;
}

.wikitext-content li {
  margin-bottom: 0.5rem;
}

.wikitext-content table {
  border-collapse: collapse;
  margin: 1.75rem 0;
  width: 100% !important;
  font-size: 0.95rem;
}

.wikitext-content th, 
.wikitext-content td {
  border: 1px solid var(--border-color);
  padding: 0.85rem 1.15rem;
  text-align: left;
}

.wikitext-content th {
  background-color: rgba(0, 108, 102, 0.05);
  color: var(--text-main);
  font-family: var(--font-heading);
  font-weight: 600;
}

.wikitext-content tr:nth-child(even) {
  background-color: rgba(0, 108, 102, 0.015);
}

/* Scraped source code blocks from Gitea / PmWiki */
.wikitext-content pre, 
.wikitext-content .sourceblock, 
.wikitext-content code {
  font-family: var(--font-code);
  font-size: 0.9rem;
}

.wikitext-content pre,
.wikitext-content .sourceblock {
  background-color: #080c10 !important;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: #2dd4bf;
  padding: 1.25rem;
  margin: 1.5rem 0;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.wikitext-content code {
  background-color: rgba(0, 108, 102, 0.06);
  border-radius: 4px;
  color: #0f766e;
  padding: 0.2rem 0.4rem;
}

.wikitext-content pre code,
.wikitext-content .sourceblock code {
  background-color: transparent;
  color: inherit;
  padding: 0;
}

/* Wiki Links styling */
.wikitext-content a {
  color: var(--accent-blue);
  text-decoration: none;
  border-bottom: 1px dashed rgba(0, 108, 102, 0.4);
  transition: var(--transition-fast);
}

.wikitext-content a:hover {
  color: var(--accent-warm);
  border-bottom-color: var(--accent-warm);
  text-shadow: 0 0 10px rgba(234, 88, 12, 0.2);
}

.wikitext-content .createlinktext {
  color: var(--accent-red) !important;
  border-bottom-color: rgba(220, 38, 38, 0.4) !important;
}

.wikitext-content .createlink {
  display: none; /* Hide the wiki "?" link for missing pages */
}

/* Img tag handling */
.wikitext-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  margin: 1.5rem 0;
  display: block;
}

.wikitext-content .vspace {
  margin-top: 1.25rem;
}

.wikitext-content .indent {
  margin-left: 2.5rem;
}

.wiki-header-card {
  background: linear-gradient(135deg, rgba(0, 108, 102, 0.04) 0%, rgba(0, 108, 102, 0.08) 100%);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  margin-bottom: 1.5rem;
}

.wiki-category-label {
  color: var(--accent-blue);
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.wiki-page-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 0.25rem;
}

/* Sidebar Icon Accent Colors */
.icon-color-layers { color: #2dd4bf; }
.icon-color-beaker { color: #10b981; }
.icon-color-help-circle { color: #fbbf24; }
.icon-color-users { color: #ea580c; }
.icon-color-monitor { color: #3b82f6; }
.icon-color-cpu { color: #ef4444; }
.icon-color-code { color: #a855f7; }

/* Wiki Header Category Accent Borders */
.wiki-header-card.border-accent-blue { border-left: 5px solid #006c66; }
.wiki-header-card.border-accent-green { border-left: 5px solid #10b981; }
.wiki-header-card.border-accent-yellow { border-left: 5px solid #fbbf24; }
.wiki-header-card.border-accent-orange { border-left: 5px solid #ea580c; }
.wiki-header-card.border-accent-blue-accent { border-left: 5px solid #3b82f6; }
.wiki-header-card.border-accent-red { border-left: 5px solid #ef4444; }
.wiki-header-card.border-accent-purple { border-left: 5px solid #a855f7; }

/* Dashboard Cards Custom Border Glows */
.border-glow-blue:hover {
  border-color: #006c66;
  box-shadow: 0 10px 25px rgba(0, 108, 102, 0.15);
}
.border-glow-orange:hover {
  border-color: #ea580c;
  box-shadow: 0 10px 25px rgba(234, 88, 12, 0.15);
}
.border-glow-purple:hover {
  border-color: #a855f7;
  box-shadow: 0 10px 25px rgba(168, 85, 247, 0.15);
}
