/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* CSS Variables */
:root {
  --bg-dark: #070a13;
  --bg-main: #0b0f19;
  --card-bg: rgba(20, 26, 46, 0.6);
  --card-border: rgba(255, 255, 255, 0.05);
  --sidebar-bg: rgba(11, 15, 25, 0.85);

  --primary: #10b981; /* Emerald */
  --primary-glow: rgba(16, 185, 129, 0.15);
  --primary-hover: #059669;

  --secondary: #06b6d4; /* Cyan/Teal */
  --secondary-glow: rgba(6, 182, 212, 0.15);

  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;

  --code-bg: #0d1117;
  --code-color: #e6edf3;
  --code-border: #21262d;

  --hero-bg: linear-gradient(135deg, rgba(20, 26, 46, 0.9), rgba(11, 15, 25, 0.9));
  --hero-title-gradient: linear-gradient(to right, #ffffff, #9ca3af, var(--primary));

  --tab-header-bg: #161b22;
  --tab-active-bg: #0d1117;

  --memory-cell-bg: #0d1117;
  --memory-console-bg: #070a13;
  --memory-visualizer-bg: rgba(20, 26, 46, 0.4);

  --input-bg: #0d1117;
  --input-color: var(--text-primary);

  --table-th-bg: #161b22;
  --table-code-bg: #1f2937;
  --table-code-color: #e6edf3;
  --table-row-hover-bg: rgba(255, 255, 255, 0.01);

  --book-image-wrapper-bg: #0f172a;
  --feedback-section-bg: linear-gradient(135deg, rgba(20, 26, 46, 0.6), rgba(7, 10, 19, 0.6));
  --interactive-container-bg: rgba(13, 17, 23, 0.5);

  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar-width: 280px;
}

/* Light Theme overrides */
html[data-theme="light"] {
  --bg-dark: #f0f2f5;
  --bg-main: #ffffff;
  --card-bg: rgba(255, 255, 255, 0.85);
  --card-border: rgba(0, 0, 0, 0.08);
  --sidebar-bg: rgba(240, 242, 245, 0.92);
  --text-primary: #1f2937;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;

  --code-bg: #f6f8fa;
  --code-color: #24292f;
  --code-border: #d0d7de;

  --hero-bg: linear-gradient(135deg, rgba(220, 225, 232, 0.95), rgba(240, 242, 245, 0.95));
  --hero-title-gradient: linear-gradient(to right, #111827, #374151, var(--primary));

  --tab-header-bg: #eaebed;
  --tab-active-bg: #f6f8fa;

  --memory-cell-bg: #f6f8fa;
  --memory-console-bg: #eaebed;
  --memory-visualizer-bg: rgba(230, 235, 240, 0.6);

  --input-bg: #f6f8fa;
  --input-color: #1f2937;

  --table-th-bg: #eaebed;
  --table-code-bg: #dfe3e8;
  --table-code-color: #24292f;
  --table-row-hover-bg: rgba(0, 0, 0, 0.02);

  --book-image-wrapper-bg: #e5e7eb;
  --feedback-section-bg: linear-gradient(135deg, rgba(229, 231, 235, 0.7), rgba(243, 244, 246, 0.8));
  --interactive-container-bg: rgba(246, 248, 250, 0.7);

  --primary-glow: rgba(16, 185, 129, 0.1);
  --secondary-glow: rgba(6, 182, 212, 0.1);
}

@media (prefers-color-scheme: light) {
  html[data-theme="system"] {
    --bg-dark: #f0f2f5;
    --bg-main: #ffffff;
    --card-bg: rgba(255, 255, 255, 0.85);
    --card-border: rgba(0, 0, 0, 0.08);
    --sidebar-bg: rgba(240, 242, 245, 0.92);
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --text-muted: #6b7280;

    --code-bg: #f6f8fa;
    --code-color: #24292f;
    --code-border: #d0d7de;

    --hero-bg: linear-gradient(135deg, rgba(220, 225, 232, 0.95), rgba(240, 242, 245, 0.95));
    --hero-title-gradient: linear-gradient(to right, #111827, #374151, var(--primary));

    --tab-header-bg: #eaebed;
    --tab-active-bg: #f6f8fa;

    --memory-cell-bg: #f6f8fa;
    --memory-console-bg: #eaebed;
    --memory-visualizer-bg: rgba(230, 235, 240, 0.6);

    --input-bg: #f6f8fa;
    --input-color: #1f2937;

    --table-th-bg: #eaebed;
    --table-code-bg: #dfe3e8;
    --table-code-color: #24292f;
    --table-row-hover-bg: rgba(0, 0, 0, 0.02);

    --book-image-wrapper-bg: #e5e7eb;
    --feedback-section-bg: linear-gradient(135deg, rgba(229, 231, 235, 0.7), rgba(243, 244, 246, 0.8));
    --interactive-container-bg: rgba(246, 248, 250, 0.7);

    --primary-glow: rgba(16, 185, 129, 0.1);
    --secondary-glow: rgba(6, 182, 212, 0.1);
  }
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(16, 185, 129, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.05) 0%, transparent 45%);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
  background: var(--code-border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Layout */
.app-container {
  display: flex;
  width: 100%;
  position: relative;
}

/* Sidebar Navigation */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  background: var(--sidebar-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid var(--card-border);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 100;
  overflow-y: auto;
}

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

.logo-icon {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.25rem;
  color: #fff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}

/* Theme Switcher in Sidebar */
.theme-switcher-container {
  margin: -1.5rem 0 2rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.theme-switcher-label {
  font-size: 0.725rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.theme-options {
  display: flex;
  background: var(--interactive-container-bg);
  border: 1px solid var(--card-border);
  padding: 0.2rem;
  border-radius: 10px;
  gap: 0.25rem;
}

.theme-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 0.45rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-btn:hover {
  color: var(--text-primary);
  background: rgba(128, 128, 128, 0.08);
}

.theme-btn.active {
  background: var(--primary);
  color: #fff;
}

.nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-weight: 500;
  font-size: 0.925rem;
  transition: var(--transition-fast);
  border: 1px solid transparent;
}

.nav-item a:hover {
  color: var(--text-primary);
  background: rgba(128, 128, 128, 0.06);
  border-color: rgba(128, 128, 128, 0.08);
}

.nav-item.active a {
  color: var(--primary-hover);
  background: var(--primary-glow);
  border-color: rgba(16, 185, 129, 0.2);
  font-weight: 600;
}

.nav-item.active a i {
  color: var(--primary);
}

.nav-badge {
  font-size: 0.75rem;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  background: var(--table-th-bg);
  color: var(--text-secondary);
  margin-left: auto;
}

.nav-item.active .nav-badge {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

.sidebar-footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--card-border);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

/* Main Content Area */
.main-content {
  margin-left: var(--sidebar-width);
  flex-grow: 1;
  padding: 2.5rem 3.5rem;
  max-width: 1300px;
  width: calc(100% - var(--sidebar-width));
}

/* Header / Hero */
.hero-section {
  position: relative;
  background: var(--hero-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 3.5rem 3rem;
  margin-bottom: 3rem;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.hero-section::after {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
  z-index: 0;
  pointer-events: none;
}

.hero-tag {
  background: rgba(16, 185, 129, 0.1);
  color: var(--primary);
  border: 1px solid rgba(16, 185, 129, 0.2);
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: inline-block;
  margin-bottom: 1.25rem;
}

.hero-title {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1rem;
  letter-spacing: -0.03em;
  background: var(--hero-title-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 700px;
  line-height: 1.6;
}

/* Tip Sections Styling */
.tip-section {
  scroll-margin-top: 2rem;
  background: var(--bg-main);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 2.5rem;
  margin-bottom: 2.5rem;
  transition: var(--transition-normal);
  position: relative;
}

.tip-section:hover {
  border-color: rgba(16, 185, 129, 0.25);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.tip-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 1.25rem;
}

.tip-number {
  background: var(--primary-glow);
  color: var(--primary);
  border: 1px solid rgba(16, 185, 129, 0.2);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
}

.tip-title-group h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.tip-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.tip-content-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
}

/* Left: Book Image Container */
.book-image-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.book-image-wrapper {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: var(--book-image-wrapper-bg);
  border: 1px solid var(--card-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.book-image {
  width: 100%;
  height: auto;
  object-fit: contain;
  transition: transform 0.5s ease;
  cursor: pointer;
}

.book-image-wrapper:hover .book-image {
  transform: scale(1.03);
}

.image-caption {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

/* Right: Descriptions and details */
.tip-details {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.tip-description {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.tip-description p {
  margin-bottom: 0.75rem;
}

.tip-description strong {
  color: var(--text-primary);
}

/* Special term badge styling */
.term-badge {
  background: rgba(6, 182, 212, 0.1);
  color: var(--secondary);
  border: 1px solid rgba(6, 182, 212, 0.2);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  display: inline-block;
}

/* Lists and Highlights */
.tip-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tip-bullets li {
  position: relative;
  padding-left: 1.5rem;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.tip-bullets li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: bold;
}

/* Code Blocks and Tabs */
.interactive-container {
  margin-top: 1.5rem;
  background: var(--interactive-container-bg);
  border-radius: 12px;
  border: 1px solid var(--card-border);
  overflow: hidden;
}

.tab-header {
  display: flex;
  background: var(--tab-header-bg);
  border-bottom: 1px solid var(--code-border);
}

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

.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(128, 128, 128, 0.05);
}

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

.tab-btn.active i {
  color: var(--primary);
}

.tab-content {
  display: none;
  padding: 1.25rem;
  background: var(--code-bg);
}

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

/* Loop conversion playgrounds visibility */
.loop-code-block {
  display: none;
}

.loop-code-block.active {
  display: block;
}

/* Custom Console Description Class */
.console-desc {
  color: var(--text-secondary);
  font-size: 0.8rem;
  margin-top: 0.25rem;
  display: inline-block;
}

.code-wrapper {
  position: relative;
}

.code-lang-tag {
  position: absolute;
  top: 0;
  right: 0;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  background: rgba(128, 128, 128, 0.1);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  pointer-events: none;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--code-color);
  display: block;
  overflow-x: auto;
  white-space: pre;
}

/* Inline code inside paragraphs and list items */
p > code,
li > code,
td > code {
  display: inline;
  white-space: normal;
  padding: 0.1rem 0.3rem;
  background: var(--table-code-bg);
  border-radius: 4px;
  font-size: 0.85em;
}

/* Alert/Caution banners */
.alert-banner {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  font-size: 0.9rem;
  color: #f59e0b;
  margin-top: 1rem;
}

html[data-theme="light"] .alert-banner {
  background: rgba(217, 119, 6, 0.08);
  border-color: rgba(217, 119, 6, 0.25);
  color: #b45309;
}

html[data-theme="light"] .alert-banner strong {
  color: #78350f;
}

@media (prefers-color-scheme: light) {
  html[data-theme="system"] .alert-banner {
    background: rgba(217, 119, 6, 0.08);
    border-color: rgba(217, 119, 6, 0.25);
    color: #b45309;
  }
  html[data-theme="system"] .alert-banner strong {
    color: #78350f;
  }
}

.alert-banner i {
  font-size: 1.1rem;
  margin-top: 0.1rem;
}

.alert-banner p {
  line-height: 1.5;
}

.alert-banner strong {
  color: #fbbf24;
}

/* Specific styling for Comparisons Tables */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.9rem;
  text-align: left;
}

.comparison-table th {
  background: var(--table-th-bg);
  color: var(--text-primary);
  font-weight: 600;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid var(--code-border);
}

.comparison-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--card-border);
  color: var(--text-secondary);
}

.comparison-table tr:hover td {
  background: var(--table-row-hover-bg);
  color: var(--text-primary);
}

.comparison-table code {
  display: inline;
  padding: 0.15rem 0.35rem;
  background: var(--table-code-bg);
  color: var(--table-code-color);
  border-radius: 4px;
  font-size: 0.8rem;
}

/* Block Memory Visualizer */
.memory-visualizer {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1.5rem;
  background: var(--memory-visualizer-bg);
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--card-border);
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
}

.memory-cell {
  background: var(--memory-cell-bg);
  border: 1px solid var(--code-border);
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  transition: var(--transition-fast);
  cursor: pointer;
}

.memory-cell:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: 0 4px 15px var(--primary-glow);
}

.memory-cell.active-step {
  border-color: var(--secondary);
  background: var(--secondary-glow);
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.15);
}

.cell-index {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  font-family: var(--font-mono);
}

.cell-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.cell-address {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}

.memory-cell:hover .cell-index {
  color: var(--primary);
}

.memory-cell:hover .cell-value {
  color: var(--text-primary);
}

.memory-console {
  background: var(--memory-console-bg);
  border: 1px solid var(--code-border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 42px;
}

.console-prompt {
  color: var(--primary);
  font-weight: bold;
}

/* Feedback Form Section */
.feedback-section {
  background: var(--feedback-section-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 2.5rem;
  margin-bottom: 2.5rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group.full-width {
  grid-column: span 2;
}

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

.form-group input,
.form-group select,
.form-group textarea {
  background: var(--input-bg);
  border: 1px solid var(--code-border);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  color: var(--input-color);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: var(--transition-fast);
}

.form-group select option {
  background: var(--input-bg);
  color: var(--input-color);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.rating-options {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.rating-btn {
  flex-grow: 1;
  background: var(--input-bg);
  border: 1px solid var(--code-border);
  border-radius: 8px;
  padding: 0.75rem;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.rating-btn:hover {
  border-color: var(--primary);
  color: var(--text-primary);
}

.rating-btn.selected {
  background: var(--primary-glow);
  border-color: var(--primary);
  color: var(--primary);
}

.submit-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 1rem 2rem;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition-normal);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
  margin-top: 1rem;
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

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

/* Lightbox Modal (For Zooming Images) */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(3, 7, 18, 0.95);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox.active {
  display: flex;
  opacity: 1;
}

.lightbox-content {
  max-width: 90%;
  max-height: 85%;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.lightbox.active .lightbox-content {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  font-size: 1.5rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

/* Responsive Media Queries */
@media (max-width: 1200px) {
  .tip-content-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .book-image-wrapper {
    aspect-ratio: 16/9;
  }
}

@media (max-width: 1024px) {
  body {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid var(--card-border);
    padding: 1.5rem;
  }

  .logo-container {
    margin-bottom: 1.5rem;
  }

  .nav-links {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .nav-badge {
    display: none;
  }

  .sidebar-footer {
    display: none;
  }

  .main-content {
    margin-left: 0;
    width: 100%;
    padding: 1.5rem;
  }

  .hero-section {
    padding: 2.5rem 1.5rem;
    margin-bottom: 2rem;
  }

  .hero-title {
    font-size: 2rem;
  }
}

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

  .form-group.full-width {
    grid-column: span 1;
  }

  .memory-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .nav-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}
