/* Enhanced CSS Custom Properties for Consistent Theming */
:root {
  /* Light mode colors - Enhanced for better contrast */
  --primary-color: #02C1D8;
  --primary-hover: #029eb6;
  --primary-light: #67e8f9;
  --primary-dark: #0891b2;
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-inverse: #ffffff;
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --bg-accent: #e0f2fe;
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
  --border-accent: #0891b2;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 255, 255, 0.2);
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --error-color: #ef4444;
  --info-color: #3b82f6;
}

/* Dark mode colors */
.dark {
  --text-primary: #f8fafc;
  --text-secondary: #e2e8f0;
  --text-muted: #94a3b8;
  --text-inverse: #0f172a;
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --bg-accent: #0c4a6e;
  --border-color: #334155;
  --border-light: #475569;
  --border-accent: #0891b2;
  --glass-bg: rgba(15, 23, 42, 0.85);
  --glass-border: rgba(255, 255, 255, 0.1);
  --success-color: #22c55e;
  --warning-color: #fbbf24;
  --error-color: #f87171;
  --info-color: #60a5fa;
}

/* Smooth transitions for theme switching */
/* Enhanced smooth transitions for theme switching */
* {
  transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}


/* Enhanced Glass Card Effect */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg);
  border-radius: 16px;
}

/* Reading Progress Indicator */
#readingProgressWrap {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--bg-secondary);
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#readingProgress {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-hover));
  width: 0%;
  transition: width 0.1s ease;
  box-shadow: 0 0 10px rgba(2, 193, 216, 0.5);
}

/* Watermark Improvements */
.watermark .wm {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  opacity: 0.6;
  user-select: none;
  pointer-events: none;
  transform: rotate(-45deg);
  font-family: 'Courier New', monospace;
}

/* Enhanced Blog Content Styling */
.blog-content {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.8;
  color: var(--text-secondary);
  max-width: 100%;
  overflow-x: hidden;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* Bold text styling for better visibility */
.blog-content strong,
.blog-content b {
  font-weight: 700;
  color: var(--text-primary);
}

/* Enhanced bold text in dark mode */
.dark .blog-content strong,
.dark .blog-content b {
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 0 1px rgba(255, 255, 255, 0.3);
}

/* Improved Headings with Better Dark Mode Support */
.blog-content h1 {
  font-size: 2.25rem;
  font-weight: 800;
  margin: 2rem 0 1.5rem;
  line-height: 1.3;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-color);
  position: relative;
}

.blog-content h1::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-hover));
}

.blog-content h2 {
  font-size: 1.875rem;
  font-weight: 700;
  margin: 2rem 0 1.25rem;
  line-height: 1.3;
  color: var(--text-primary);
  position: relative;
  padding-left: 1rem;
}

.blog-content h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.25em;
  height: 1em;
  width: 4px;
  background: linear-gradient(to bottom, var(--primary-color), var(--primary-hover));
  border-radius: 2px;
}

.blog-content h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 1.75rem 0 1rem;
  color: var(--text-primary);
}

.blog-content h4 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 1.5rem 0 0.75rem;
  color: var(--text-primary);
}

/* Enhanced Links with Better Hover Effects */
.blog-content a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
  border-radius: 4px;
  padding: 0 2px;
}

.blog-content a:hover {
  color: var(--primary-hover);
  background: rgba(2, 193, 216, 0.1);
}

.blog-content a::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-hover));
  transition: width 0.3s ease;
}

.blog-content a:hover::after {
  width: 100%;
}



/* Enhanced Lists */
.blog-content ul,
.blog-content ol {
  margin: 1.25rem 0;
  padding-left: 1.5rem;
}

.blog-content ul {
  list-style: none;
}

.blog-content ul li::before {
  content: '▸';
  color: var(--primary-color);
  font-weight: bold;
  position: absolute;
  margin-left: -1.2rem;
}

.blog-content ol {
  list-style: none;
  counter-reset: item;
}

.blog-content ol li {
  counter-increment: item;
  position: relative;
}

.blog-content ol li::before {
  content: counter(item);
  background: var(--primary-color);
  color: white;
  font-weight: bold;
  font-size: 0.8rem;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  left: -2rem;
  top: 0.1rem;
}

.blog-content li {
  margin-bottom: 0.5rem;
  padding-left: 0.5rem;
  position: relative;
}

/* Enhanced Tables */
.blog-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  box-shadow: var(--shadow-md);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.blog-content table th {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: white;
  font-weight: 600;
  text-align: left;
  position: relative;
}

.blog-content table th,
.blog-content table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.blog-content table tr {
  background: var(--bg-primary);
  transition: background-color 0.2s ease;
}

.blog-content table tr:nth-child(even) {
  background: var(--bg-secondary);
}

.blog-content table tr:hover {
  background: var(--bg-tertiary);
  transform: scale(1.01);
}

/* Enhanced Dark Theme Tables */
.dark .blog-content table {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  border-radius: 12px;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.dark .blog-content table th {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
  color: var(--text-inverse);
  font-weight: 600;
  border-bottom: 2px solid var(--primary-light);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  position: relative;
  padding: 1.25rem 1rem;
}

.dark .blog-content table th::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary-light), transparent);
}

.dark .blog-content table th,
.dark .blog-content table td {
  padding: 1.1rem 1rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.dark .blog-content table tr {
  background: var(--bg-secondary);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.dark .blog-content table tr:nth-child(even) {
  background: rgba(30, 41, 59, 0.4);
}

.dark .blog-content table tr:hover {
  background: var(--bg-tertiary);
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 1;
}

.dark .blog-content table tr:hover td {
  color: var(--text-primary);
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.1);
}

.dark .blog-content table td {
  color: var(--text-secondary);
  position: relative;
}

.dark .blog-content table tr:last-child td {
  border-bottom: none;
}

/* Add subtle row separators */
.dark .blog-content table tr:not(:last-child)::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 1rem;
  right: 1rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-color), transparent);
}

/* Responsive adjustments */
@media (max-width: 768px) {

  .dark .blog-content table th,
  .dark .blog-content table td {
    padding: 0.85rem 0.75rem;
    font-size: 0.9rem;
  }

  .dark .blog-content table th {
    padding: 1rem 0.75rem;
  }
}

/* Enhanced Images */
.blog-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 2rem auto;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-content img:hover {
  transform: scale(1.02);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Enhanced Horizontal Rule */
.blog-content hr {
  border: none;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
  margin: 3rem 0;
  border-radius: 1px;
}

/* Enhanced Video Container */
.video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  background: var(--bg-secondary);
  max-width: 100%;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 12px;
}

.yt-video-wrapper {
  max-width: 100%;
  overflow: hidden;
}

.yt-video-wrapper iframe {
  max-width: 100%;
}


/* Enhanced Blockquote Styling */
/* Global Blockquote Styling */
blockquote {
  margin: 1.5rem 0;
  padding: 1.25rem 1.5rem;
  border-left: 4px solid var(--primary-color);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.7;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  position: relative;
}

blockquote::before {
  content: "“";
  font-size: 3rem;
  font-weight: bold;
  color: var(--primary-light);
  position: absolute;
  top: -10px;
  left: 10px;
  opacity: 0.2;
}

blockquote p {
  margin: 0;
  /* remove extra spacing from markdown <p> inside blockquote */
}

blockquote footer {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  font-style: normal;
  font-weight: 500;
  color: var(--text-muted);
  text-align: right;
}

/* Dark mode */
.dark blockquote {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-left-color: var(--primary-hover);
  box-shadow: var(--shadow-md);
}

.dark blockquote::before {
  color: var(--primary-color);
  opacity: 0.25;
}

.dark blockquote footer {
  color: var(--text-secondary);
}



/* Enhanced Callout Blocks */
[data-node-type="callout"] {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.5rem;
  margin: 2rem 0;
  border-left: 4px solid var(--primary-color);
  background: var(--bg-secondary);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

[data-node-type="callout-emoji"] {
  font-size: 1.5rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

[data-node-type="callout-text"] {
  flex: 1;
  color: var(--text-secondary);
}

[data-node-type="callout-text"] strong {
  font-weight: 600;
  color: var(--text-primary);
}

/* Enhance nested list readability */
.toc ul ul {
  padding-left: 1rem;
  margin-top: 0.4rem;
  border-left: 2px solid var(--border-color);
  margin-left: 0.5rem;
  transition: border-color 0.2s ease;
}

/* Smoother hover state */
.toc ul li a:hover {
  color: var(--primary-color);
  background: var(--bg-tertiary);
  transform: translateX(2px);
}

/* Active link emphasis */
.toc ul li a.active {
  color: var(--primary-color);
  background: rgba(2, 193, 216, 0.08);
  font-weight: 600;
  border-left: 3px solid var(--primary-color);
  padding-left: 0.75rem;
}

/* Better focus accessibility */
.toc ul li a:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Enhanced Collapsible Video */
.collapsible-video-wrapper {
  margin: 1.5rem 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
}

.collapsible-video-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: var(--bg-secondary);
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
}

.collapsible-video-header:hover {
  background: var(--bg-tertiary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.collapsible-video-header h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.collapsible-video-header svg {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  width: 1.25rem;
  height: 1.25rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.collapsible-video-header.active svg {
  transform: rotate(180deg);
  color: var(--primary-color);
}

.collapsible-video-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.collapsible-video-content.active {
  max-height: 600px;
  padding: 1rem;
}

.dark .collapsible-video-wrapper {
  background: var(--bg-secondary);
  border-color: var(--border-color);
}

.dark .collapsible-video-header {
  background: var(--bg-tertiary);
}

.dark .collapsible-video-header:hover {
  background: var(--bg-accent);
}

/* Enhanced Mermaid Diagrams */
.mermaid {
  padding: 2rem;
  max-width: 100%;
  overflow-x: auto;
  display: flex;
  justify-content: center;
  background: var(--bg-secondary);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  margin: 2rem 0;
}

.mermaid svg {
  max-width: 90%;
  height: auto;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

/* Dark Mode Mermaid Enhancements - Better Visibility */
.dark .mermaid {
  background: rgba(51, 65, 85, 0.4); /* Lighter semi-transparent background */
  border: 1px solid rgba(100, 116, 139, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.dark .mermaid svg {
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5))
          drop-shadow(0 0 1px rgba(255, 255, 255, 0.1));
}

/* Force better text contrast in dark mode Mermaid diagrams */
.dark .mermaid .nodeLabel,
.dark .mermaid .edgeLabel {
  color: #f8fafc !important;
  fill: #f8fafc !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* Enhance node shapes with lighter backgrounds in dark mode */
.dark .mermaid .node rect,
.dark .mermaid .node circle,
.dark .mermaid .node ellipse,
.dark .mermaid .node polygon {
  fill: rgba(51, 65, 85, 0.9) !important;
  stroke: #67e8f9 !important;
  stroke-width: 2px !important;
  filter: brightness(1.3);
}

/* Enhance edges/arrows with better visibility */
.dark .mermaid .edgePath .path,
.dark .mermaid .flowchart-link {
  stroke: #94a3b8 !important;
  stroke-width: 2px !important;
  filter: brightness(1.4);
}

/* Enhance arrow markers */
.dark .mermaid marker path {
  fill: #94a3b8 !important;
  filter: brightness(1.4);
}

/* Enhance specific flowchart elements */
.dark .mermaid .cluster rect {
  fill: rgba(30, 41, 59, 0.6) !important;
  stroke: rgba(100, 116, 139, 0.8) !important;
}

/* Better label backgrounds in dark mode */
.dark .mermaid .label {
  color: #f8fafc !important;
  fill: #f8fafc !important;
}

/* Enhance edge label backgrounds for readability */
.dark .mermaid .edgeLabel .label-container {
  background-color: rgba(30, 41, 59, 0.95) !important;
  border: 1px solid rgba(100, 116, 139, 0.5) !important;
  border-radius: 4px;
  padding: 2px 4px;
}

/* Enhanced Focus States for Accessibility */
.focus-ring:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(2, 193, 216, 0.3);
  border-radius: 8px;
}

/* Enhanced Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }
}

.animate-fade-in {
  animation: fadeIn 0.6s ease-out;
}

.animate-slide-up {
  animation: slideUp 0.8s ease-out;
}

.animate-pulse {
  animation: pulse 2s infinite;
}

/* Enhanced Responsive Design */
@media (max-width: 768px) {
  .blog-content h1 {
    font-size: 1.75rem;
  }

  .blog-content h2 {
    font-size: 1.5rem;
  }

  .blog-content h3 {
    font-size: 1.25rem;
  }

  .blog-content pre {
    padding: 1rem;
    font-size: 0.85rem;
  }

  .copy-btn {
    position: static;
    margin-top: 0.5rem;
    width: 100%;
  }

  .blog-content table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .blog-content table th,
  .blog-content table td {
    padding: 0.75rem;
    font-size: 0.9rem;
  }

  .toc {
    padding: 1rem;
  }

  .collapsible-video-header {
    padding: 0.75rem 1rem;
  }

  .yt-video-wrapper {
    margin: 0;
    padding: 0;
  }

  .collapsible-video-wrapper {
    margin: 1rem 0;
  }

  .collapsible-video-content.active {
    max-height: 400px;
    padding: 0.75rem;
  }
}

/* Print Styles */
@media print {
  .watermark {
    opacity: 0.3 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .copy-btn {
    display: none !important;
  }

  #readingProgressWrap {
    display: none !important;
  }
}


/* === Base Code Block Styles (light + dark unified) === */
.blog-content pre {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  padding: 1.5rem;
  border-radius: 12px;
  margin: 1.5rem 0;
  overflow-x: auto;
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  border: 1px solid var(--border-color);
  position: relative;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.blog-content code {
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 0.9rem;
}

.blog-content pre code {
  background-color: transparent;
  color: inherit;
  padding: 0;
  border-radius: 0;
}

/* Inline code */
.blog-content :not(pre)>code {
  background: var(--bg-tertiary);
  color: var(--primary-color);
  padding: 0.2em 0.4em;
  border-radius: 6px;
  font-size: 0.9em;
  font-weight: 500;
  border: 1px solid var(--border-color);
}

/* Enhanced Dark Mode Code Blocks */
.dark .blog-content pre {
  background: rgba(71, 85, 105, 0.9); /* Much lighter for better distinction */
  border: 1px solid rgba(100, 116, 139, 0.6);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.4);
}

.dark .blog-content :not(pre)>code {
  background: rgba(51, 65, 85, 0.8);
  color: #67e8f9;
  border: 1px solid rgba(100, 116, 139, 0.5);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* === Prism/Highlight.js integration === */
pre[class*="language-"],
code[class*="language-"] {
  background: var(--bg-tertiary) !important;
  color: var(--text-primary) !important;
  position: relative;
}

/* Small gradient accent bar on top */
pre[class*="language-"]::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: 12px 12px 0 0;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-hover));
  opacity: 0.6;
}

pre[class*="language-"] {
  padding: 1.75rem 1.5rem 1.5rem;
  margin: 1.75rem 0;
  overflow-x: auto;
  font-family: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  font-size: 0.95rem;
  line-height: 1.6;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

code[class*="language-"] {
  text-shadow: none !important;
  font-family: inherit;
}

/* Enhanced Dark Mode Prism Blocks */
.dark pre[class*="language-"],
.dark code[class*="language-"] {
  background: rgba(71, 85, 105, 0.95) !important;
  color: #f8fafc !important;
}

.dark pre[class*="language-"] {
  border: 1px solid rgba(100, 116, 139, 0.7);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5),
              inset 0 2px 8px rgba(0, 0, 0, 0.3);
}

.dark pre[class*="language-"]::before {
  background: linear-gradient(90deg, #67e8f9, #02C1D8);
  opacity: 0.8;
  height: 3px;
}

/* === Tokens (Light Mode - Subtle Colors) === */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: #6b7280 !important;
  font-style: italic;
}

.token.punctuation {
  color: #4b5563 !important;
}

.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
  color: #2563eb !important; /* Blue for numbers/constants */
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
  color: #059669 !important; /* Green for strings */
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
  color: #dc2626 !important; /* Red for operators */
  background: transparent !important;
}

.token.atrule,
.token.attr-value,
.token.keyword {
  color: #c026d3 !important; /* Magenta for keywords */
}

.token.function,
.token.class-name {
  color: #7c3aed !important; /* Purple for functions/classes */
}

.token.important,
.token.regex,
.token.variable {
  color: #d97706 !important; /* Amber for variables */
}

/* === Enhanced Dark Mode Tokens - Optimized for Python === */
.dark .token.comment,
.dark .token.prolog,
.dark .token.doctype,
.dark .token.cdata {
  color: #94a3b8 !important; /* Lighter gray for better readability */
  font-style: italic;
  opacity: 0.9;
}

.dark .token.punctuation {
  color: #cbd5e1 !important; /* Light gray punctuation */
}

/* Numbers, booleans, constants - Bright blue */
.dark .token.property,
.dark .token.tag,
.dark .token.boolean,
.dark .token.number,
.dark .token.constant,
.dark .token.symbol,
.dark .token.deleted {
  color: #60a5fa !important; /* Bright blue */
  font-weight: 500;
}

/* Strings - Vibrant green (excellent for Python strings) */
.dark .token.selector,
.dark .token.attr-name,
.dark .token.string,
.dark .token.char,
.dark .token.builtin,
.dark .token.inserted {
  color: #34d399 !important; /* Bright emerald green */
  font-weight: 500;
}

/* Triple-quoted strings and docstrings */
.dark .token.string.docstring,
.dark .token.triple-quoted-string {
  color: #6ee7b7 !important; /* Lighter green for docstrings */
  font-style: italic;
}

/* Operators - Bright coral */
.dark .token.operator,
.dark .token.entity,
.dark .token.url {
  color: #fb7185 !important; /* Bright coral pink */
  background: transparent !important;
  font-weight: 600;
}

/* Keywords - Vibrant magenta (def, class, if, return, etc.) */
.dark .token.atrule,
.dark .token.attr-value,
.dark .token.keyword {
  color: #e879f9 !important; /* Bright magenta */
  font-weight: 600;
}

/* Functions and class names - Purple/violet */
.dark .token.function,
.dark .token.class-name {
  color: #a78bfa !important; /* Bright violet */
  font-weight: 600;
}

/* Variables and parameters - Bright yellow/amber */
.dark .token.important,
.dark .token.regex,
.dark .token.variable,
.dark .token.parameter {
  color: #fbbf24 !important; /* Bright amber */
  font-weight: 500;
}

/* Python-specific: decorators */
.dark .token.decorator,
.dark .token.annotation {
  color: #f59e0b !important; /* Orange for decorators */
  font-weight: 600;
}

/* Python-specific: self/cls */
.dark .token.keyword.self,
.dark .token.builtin.self,
.dark .token.builtin.cls {
  color: #f97316 !important; /* Bright orange */
  font-style: italic;
  font-weight: 500;
}

/* === Code Header Styling (unified) === */
.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(to right, var(--bg-primary), var(--bg-secondary));
  padding: 0.75rem 1.25rem;
  border-bottom: none;
  margin-bottom: -1px;
  position: relative;
  z-index: 1;
  border-radius: 12px 12px 0 0;
}

.code-header span {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.code-header span::before {
  content: '';
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary-color);
  display: inline-block;
}

/* === Copy Button === */
.copy-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
  opacity: 0.85;
  min-width: 40px;
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.copy-btn:hover {
  opacity: 1;
  background: var(--bg-secondary);
  transform: translateY(-1px);
}

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

/* === Responsive === */
@media (max-width: 768px) {
  pre[class*="language-"] {
    padding: 1.5rem 1rem 1.25rem;
    font-size: 0.875rem;
  }

  .code-header {
    padding: 0.6rem 1rem;
  }
}



/* Sidebar Enhancements */
.toc-container {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
}

/* Loading States */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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



/************** LAB CARD ****************/
/* Enhanced CSS Custom Properties for Consistent Theming */
:root {
  /* Light mode colors - Enhanced for better contrast */
  --primary-color: #02C1D8;
  --primary-hover: #029eb6;
  --primary-light: #67e8f9;
  --primary-dark: #0891b2;
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-inverse: #ffffff;
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --bg-accent: #e0f2fe;
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
  --border-accent: #0891b2;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 255, 255, 0.2);
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --error-color: #ef4444;
  --info-color: #3b82f6;
}

/* Enhanced Dark mode colors with better contrast ratios */
.dark {
  --text-primary: #f8fafc;
  --text-secondary: #e2e8f0;
  --text-muted: #94a3b8;
  --text-inverse: #0f172a;
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --bg-accent: #0c4a6e;
  --border-color: #334155;
  --border-light: #475569;
  --border-accent: #0891b2;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6), 0 4px 6px -2px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.7), 0 10px 10px -5px rgba(0, 0, 0, 0.6);
  --glass-bg: rgba(15, 23, 42, 0.85);
  --glass-border: rgba(255, 255, 255, 0.1);
  --success-color: #22c55e;
  --warning-color: #fbbf24;
  --error-color: #f87171;
  --info-color: #60a5fa;
}

/* Enhanced smooth transitions for theme switching */
* {
  transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Enhanced Glass Card Effect with better backdrop blur */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg);
  border-radius: 16px;
}

/* Enhanced Lab Card Styling */
.lab-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  position: relative;
}

.lab-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-hover));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lab-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
  border-color: var(--border-accent);
}

.lab-card:hover::before {
  opacity: 1;
}

/* Enhanced Card Image Styling */
.lab-card-image {
  width: 100%;
  height: 160px;
  object-fit: cover;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.lab-card:hover .lab-card-image {
  transform: scale(1.05);
}

.lab-card-placeholder {
  width: 100%;
  height: 160px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.lab-card-placeholder::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
  }

  100% {
    transform: translateX(100%) translateY(100%) rotate(45deg);
  }
}

/* Enhanced Typography */
.lab-card-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 0.5rem;
  transition: color 0.3s ease;
}

.lab-card-description {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Enhanced Badge Styling */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  transition: all 0.3s ease;
}

.badge-free {
  background: linear-gradient(135deg, var(--success-color), #059669);
  color: white;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.badge-premium {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: white;
  box-shadow: 0 2px 4px rgba(139, 92, 246, 0.3);
}

.badge-fundamentals {
  background: linear-gradient(135deg, var(--info-color), #2563eb);
  color: white;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.badge-mentorados {
  background: linear-gradient(135deg, var(--warning-color), #d97706);
  color: white;
  box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

.badge-unavailable {
  background: linear-gradient(135deg, #6b7280, #4b5563);
  color: white;
  box-shadow: 0 2px 4px rgba(107, 114, 128, 0.3);
}

.badge-restricted {
  background: linear-gradient(135deg, var(--error-color), #dc2626);
  color: white;
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

/* Enhanced Button Styling */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.25rem;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border: none;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, var(--primary-hover), var(--primary-dark));
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--bg-tertiary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-danger {
  background: linear-gradient(135deg, var(--error-color), #dc2626);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, #dc2626, #b91c1c);
}

.btn-disabled {
  background: linear-gradient(135deg, #6b7280, #4b5563);
  color: white;
  cursor: not-allowed;
  opacity: 0.7;
}

.btn-disabled:hover {
  transform: none;
  box-shadow: var(--shadow-md);
}

/* Enhanced Tag Styling */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.tag:hover {
  background: var(--bg-accent);
  color: var(--primary-color);
  border-color: var(--border-accent);
  transform: translateY(-1px);
}

/* Enhanced Accordion Styling */
.accordion-item {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.accordion-item:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-accent);
}

.accordion-header {
  background: var(--bg-secondary);
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  border-bottom: 1px solid var(--border-color);
}

.accordion-header:hover {
  background: var(--bg-tertiary);
}

.accordion-header.active {
  background: var(--bg-accent);
  border-bottom-color: var(--border-accent);
}

.accordion-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: var(--shadow-sm);
}

.accordion-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.accordion-chevron {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--text-muted);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.accordion-header.active .accordion-chevron {
  transform: rotate(180deg);
  color: var(--primary-color);
}

.accordion-content {
  padding: 1.5rem;
  background: var(--bg-primary);
}

/* Enhanced Page Header */
.page-header {
  position: relative;
  padding: 2rem 0;
  background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary));
  overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-hover));
}

.page-title {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  margin: 0;
}

.page-title-accent {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Enhanced Grid Layout */
.labs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
  width: 100%;
  min-width: 0;
}

/* Ensure lab cards don't overflow */
.labs-grid > * {
  min-width: 0;
  max-width: 100%;
}

/* Enhanced Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.8;
  }
}

@keyframes bounce {

  0%,
  20%,
  53%,
  80%,
  100% {
    transform: translateY(0);
  }

  40%,
  43% {
    transform: translateY(-8px);
  }

  70% {
    transform: translateY(-4px);
  }

  90% {
    transform: translateY(-2px);
  }
}

.animate-fade-in {
  animation: fadeIn 0.8s ease-out;
}

.animate-slide-up {
  animation: slideUp 0.8s ease-out;
}

.animate-fade-in-up {
  animation: fadeInUp 0.8s ease-out;
}

.animate-pulse {
  animation: pulse 2s infinite;
}

.animate-bounce {
  animation: bounce 1s infinite;
}

/* Enhanced Focus States for Accessibility */
.focus-ring:focus,
.btn:focus,
.accordion-header:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(2, 193, 216, 0.3);
  border-radius: 12px;
}

/* Enhanced Loading States */
.loading {
  position: relative;
  opacity: 0.6;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Enhanced Responsive Design */
@media (max-width: 768px) {
  .labs-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }

  .lab-card {
    width: 100%;
    max-width: 100%;
  }

  .accordion-header {
    padding: 1rem;
  }

  .accordion-content {
    padding: 1rem;
  }

  .page-header {
    padding: 1.5rem 0;
  }

  .btn {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
  }
}

@media (max-width: 480px) {
  .labs-grid {
    gap: 0.75rem;
  }

  .lab-card {
    border-radius: 10px;
  }

  .accordion-item {
    border-radius: 10px;
  }
}

/* Enhanced Dark Mode Specific Improvements */
.dark .lab-card {
  background: var(--bg-secondary);
  border-color: var(--border-color);
}

.dark .lab-card:hover {
  background: var(--bg-tertiary);
  border-color: var(--primary-color);
}

.dark .accordion-item {
  background: var(--bg-secondary);
  border-color: var(--border-color);
}

.dark .accordion-header {
  background: var(--bg-tertiary);
}

.dark .accordion-header:hover {
  background: var(--bg-accent);
}

.dark .page-header {
  background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary));
}

/* Enhanced Print Styles */
@media print {

  .btn,
  .accordion-chevron {
    display: none !important;
  }

  .lab-card {
    break-inside: avoid;
    box-shadow: none !important;
    border: 1px solid #ccc !important;
  }

  .accordion-content {
    display: block !important;
  }
}

/* Enhanced High Contrast Mode Support */
@media (prefers-contrast: high) {
  :root {
    --border-color: #000000;
    --text-secondary: #000000;
  }

  .dark {
    --border-color: #ffffff;
    --text-secondary: #ffffff;
  }
}

/* Enhanced Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   MOBILE-FIRST RESPONSIVE ENHANCEMENTS
   ============================================ */

/* Tablets and smaller (under 768px) */
@media (max-width: 768px) {
  .labs-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .lab-card {
    width: 100%;
  }
}

/* Small mobile devices (under 480px) */
@media (max-width: 480px) {
  /* Prevent horizontal overflow */
  body {
    overflow-x: hidden;
  }

  /* Force single column grid */
  .labs-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  /* Lab Card Mobile Styles */
  .lab-card {
    border-radius: 10px;
    width: 100%;
    max-width: 100%;
  }

  .lab-card-image {
    height: 120px;
  }

  .lab-card-placeholder {
    height: 120px;
  }

  .lab-card-title {
    font-size: 0.9rem;
    line-height: 1.3;
    margin-bottom: 0.35rem;
  }

  .lab-card-description {
    font-size: 0.75rem;
    line-height: 1.5;
    margin-bottom: 0.5rem;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  /* Badge Mobile Styles */
  .badge {
    padding: 0.15rem 0.5rem;
    font-size: 0.6rem;
    border-radius: 6px;
  }

  /* Button Mobile Styles */
  .btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.7rem;
    border-radius: 8px;
  }

  .btn svg {
    width: 12px;
    height: 12px;
    margin-right: 0.25rem;
  }

  /* Tag Mobile Styles */
  .tag {
    padding: 0.125rem 0.35rem;
    font-size: 0.6rem;
    border-radius: 4px;
  }

  /* Accordion Mobile Styles */
  .accordion-header {
    padding: 0.75rem;
  }

  .accordion-content {
    padding: 0.75rem;
  }

  .accordion-title {
    font-size: 0.9rem;
  }

  .accordion-icon {
    width: 1.5rem;
    height: 1.5rem;
  }

  .accordion-chevron {
    width: 1rem;
    height: 1rem;
  }

  /* Page Header Mobile */
  .page-title {
    font-size: 1.5rem;
  }

  /* Glass Card Mobile */
  .glass-card {
    padding: 0.75rem;
    border-radius: 12px;
  }

  /* Grid Mobile */
  .labs-grid {
    gap: 0.75rem;
    margin-top: 0.75rem;
  }
}

/* iPhone SE and similar (375px) */
@media (max-width: 400px) {
  .labs-grid {
    grid-template-columns: 1fr !important;
    gap: 0.625rem;
  }

  .lab-card {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  .lab-card-image {
    height: 110px;
  }

  .lab-card-placeholder {
    height: 110px;
  }

  .lab-card-title {
    font-size: 0.85rem;
  }

  .lab-card-description {
    font-size: 0.7rem;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  .badge {
    padding: 0.125rem 0.45rem;
    font-size: 0.6rem;
  }

  .btn {
    padding: 0.375rem 0.65rem;
    font-size: 0.7rem;
  }

  .page-title {
    font-size: 1.35rem;
  }

  .container {
    padding-left: 0.625rem;
    padding-right: 0.625rem;
  }
}

/* Very small mobile devices (under 360px) */
@media (max-width: 360px) {
  /* Force single column and prevent overflow */
  .labs-grid {
    grid-template-columns: 1fr !important;
    gap: 0.5rem;
  }

  .lab-card {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  .lab-card-image {
    height: 100px;
  }

  .lab-card-placeholder {
    height: 100px;
  }

  .lab-card-title {
    font-size: 0.8rem;
  }

  .lab-card-description {
    font-size: 0.7rem;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  .badge {
    padding: 0.1rem 0.4rem;
    font-size: 0.55rem;
  }

  .btn {
    padding: 0.35rem 0.6rem;
    font-size: 0.65rem;
  }

  .btn svg {
    width: 10px;
    height: 10px;
  }

  .tag {
    padding: 0.1rem 0.25rem;
    font-size: 0.55rem;
  }

  .page-title {
    font-size: 1.25rem;
  }

  .accordion-title {
    font-size: 0.8rem;
  }

  .accordion-content {
    padding: 0.5rem;
  }

  .container {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
}

/* END OF LAB CARD CSS */