/**
 * Leja Learning Center - Guide Styles
 * Modern design with glassmorphism, gradients, and smooth animations
 */

/* ==========================================================================
   CSS Variables & Theme
   ========================================================================== */
:root {
  /* Primary colors */
  --guide-primary: #6366f1;
  --guide-primary-light: #818cf8;
  --guide-primary-dark: #4f46e5;

  /* Secondary colors */
  --guide-secondary: #8b5cf6;
  --guide-secondary-light: #a78bfa;

  /* Semantic colors */
  --guide-success: #10b981;
  --guide-warning: #f59e0b;
  --guide-danger: #ef4444;
  --guide-info: #3b82f6;

  /* Neutral colors */
  --guide-text: #1e293b;
  --guide-text-muted: #64748b;
  --guide-text-light: #94a3b8;
  --guide-bg: #ffffff;
  --guide-bg-subtle: #f8fafc;
  --guide-bg-muted: #f1f5f9;
  --guide-border: #e2e8f0;
  --guide-border-light: #f1f5f9;

  /* Typography */
  --guide-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --guide-font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', 'Consolas', monospace;

  /* Spacing */
  --guide-space-xs: 0.25rem;
  --guide-space-sm: 0.5rem;
  --guide-space-md: 1rem;
  --guide-space-lg: 1.5rem;
  --guide-space-xl: 2rem;
  --guide-space-2xl: 3rem;

  /* Border radius */
  --guide-radius-sm: 0.375rem;
  --guide-radius-md: 0.5rem;
  --guide-radius-lg: 0.75rem;
  --guide-radius-xl: 1rem;

  /* Shadows */
  --guide-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --guide-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --guide-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --guide-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  /* Transitions */
  --guide-transition-fast: 150ms ease;
  --guide-transition-base: 200ms ease;
  --guide-transition-slow: 300ms ease;
}

/* Dark mode support removed - guide pages always render on white background,
   so dark CSS variables made text invisible (light text on white bg) */

/* ==========================================================================
   Base Styles
   ========================================================================== */
.guide-content {
  font-family: var(--guide-font-sans);
  color: var(--guide-text);
  line-height: 1.7;
  max-width: 100%;
  animation: guideEnter 0.5s ease-out;
}

@keyframes guideEnter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   Typography
   ========================================================================== */

/* Headings with gradient accent */
.guide-content h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-top: var(--guide-space-2xl);
  margin-bottom: var(--guide-space-lg);
  letter-spacing: -0.025em;
  position: relative;
}

.guide-content h1:first-child {
  margin-top: 0;
}

.guide-content h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: var(--guide-space-2xl);
  margin-bottom: var(--guide-space-md);
  padding-bottom: var(--guide-space-sm);
  border-bottom: 2px solid transparent;
  border-image: linear-gradient(135deg, var(--guide-primary), var(--guide-secondary)) 1;
  background: linear-gradient(135deg, var(--guide-primary), var(--guide-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.guide-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: var(--guide-space-xl);
  margin-bottom: var(--guide-space-md);
  color: var(--guide-text);
}

.guide-content h4 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-top: var(--guide-space-lg);
  margin-bottom: var(--guide-space-sm);
  color: var(--guide-text);
}

.guide-content h5,
.guide-content h6 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: var(--guide-space-lg);
  margin-bottom: var(--guide-space-sm);
  color: var(--guide-text-muted);
}

/* Paragraphs */
.guide-content p {
  margin-bottom: var(--guide-space-md);
}

/* Strong & emphasis */
.guide-content strong {
  font-weight: 600;
  color: var(--guide-text);
}

.guide-content em {
  font-style: italic;
}

/* Links with animated underline */
.guide-content a {
  color: var(--guide-primary);
  text-decoration: none;
  position: relative;
  transition: color var(--guide-transition-fast);
}

.guide-content a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: linear-gradient(135deg, var(--guide-primary), var(--guide-secondary));
  transition: width var(--guide-transition-base);
}

.guide-content a:hover {
  color: var(--guide-primary-dark);
}

.guide-content a:hover::after {
  width: 100%;
}

/* ==========================================================================
   Lists
   ========================================================================== */
.guide-content ul.guide-list,
.guide-content ol.guide-list {
  margin-bottom: var(--guide-space-lg);
  padding-left: var(--guide-space-lg);
}

.guide-content ul.guide-list {
  list-style: none;
}

.guide-content ul.guide-list > li {
  position: relative;
  padding-left: var(--guide-space-md);
  margin-bottom: var(--guide-space-sm);
}

.guide-content ul.guide-list > li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.625em;
  width: 6px;
  height: 6px;
  background: linear-gradient(135deg, var(--guide-primary), var(--guide-secondary));
  border-radius: 50%;
}

.guide-content ol.guide-list-ordered {
  counter-reset: guide-counter;
  list-style: none;
}

.guide-content ol.guide-list-ordered > li {
  counter-increment: guide-counter;
  position: relative;
  padding-left: var(--guide-space-xl);
  margin-bottom: var(--guide-space-sm);
}

.guide-content ol.guide-list-ordered > li::before {
  content: counter(guide-counter);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.5rem;
  height: 1.5rem;
  background: linear-gradient(135deg, var(--guide-primary), var(--guide-secondary));
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Nested lists */
.guide-content ul.guide-list ul,
.guide-content ol.guide-list ol,
.guide-content ul.guide-list ol,
.guide-content ol.guide-list ul {
  margin-top: var(--guide-space-sm);
  margin-bottom: 0;
}

/* ==========================================================================
   Tables with hover effect
   ========================================================================== */
.guide-content table.guide-table {
  width: 100%;
  margin-bottom: var(--guide-space-lg);
  border-collapse: collapse;
  background: var(--guide-bg);
  border-radius: var(--guide-radius-lg);
  overflow: hidden;
  box-shadow: var(--guide-shadow-sm);
}

.guide-content table.guide-table th,
.guide-content table.guide-table td {
  padding: var(--guide-space-md);
  text-align: left;
  border-bottom: 1px solid var(--guide-border);
}

.guide-content table.guide-table th {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(139, 92, 246, 0.05));
  font-weight: 600;
  color: var(--guide-text);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.guide-content table.guide-table tr {
  transition: all var(--guide-transition-base);
}

.guide-content table.guide-table tbody tr:hover {
  background: rgba(99, 102, 241, 0.04);
  transform: translateX(4px);
}

.guide-content table.guide-table tbody tr:last-child td {
  border-bottom: none;
}

/* Responsive table wrapper */
.guide-table-wrapper {
  overflow-x: auto;
  margin-bottom: var(--guide-space-lg);
  border-radius: var(--guide-radius-lg);
}

/* ==========================================================================
   Code Blocks with Glassmorphism
   ========================================================================== */
.guide-content pre.guide-code {
  background: rgba(30, 41, 59, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--guide-radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: var(--guide-space-lg);
  margin-bottom: var(--guide-space-lg);
  overflow-x: auto;
  position: relative;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -2px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.guide-content pre.guide-code code {
  font-family: var(--guide-font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
  color: #e2e8f0;
  background: none;
  padding: 0;
}

/* Code block header */
.guide-content pre.guide-code::before {
  content: '';
  position: absolute;
  top: var(--guide-space-md);
  left: var(--guide-space-md);
  display: flex;
  gap: 6px;
}

/* Terminal dots decoration */
.guide-content pre.guide-code[data-language]::after {
  content: attr(data-language);
  position: absolute;
  top: var(--guide-space-sm);
  right: var(--guide-space-md);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Inline code */
.guide-content code.guide-inline-code {
  font-family: var(--guide-font-mono);
  font-size: 0.875em;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.08));
  color: var(--guide-primary-dark);
  padding: 0.125rem 0.375rem;
  border-radius: var(--guide-radius-sm);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

/* ==========================================================================
   Callout Boxes
   ========================================================================== */
.guide-callout {
  display: flex;
  gap: var(--guide-space-md);
  padding: var(--guide-space-lg);
  margin-bottom: var(--guide-space-lg);
  border-radius: var(--guide-radius-lg);
  border-left: 4px solid;
}

.guide-callout > i {
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.guide-callout > div {
  flex: 1;
}

.guide-callout strong {
  display: block;
  margin-bottom: var(--guide-space-xs);
}

.guide-callout p {
  margin: 0;
}

/* Info callout */
.guide-callout-info {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(99, 102, 241, 0.05));
  border-left-color: var(--guide-info);
}

.guide-callout-info > i {
  color: var(--guide-info);
}

/* Tip callout */
.guide-callout-tip {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(52, 211, 153, 0.05));
  border-left-color: var(--guide-success);
}

.guide-callout-tip > i {
  color: var(--guide-success);
}

/* Warning callout */
.guide-callout-warning {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(251, 191, 36, 0.05));
  border-left-color: var(--guide-warning);
}

.guide-callout-warning > i {
  color: var(--guide-warning);
}

/* Danger callout */
.guide-callout-danger {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(248, 113, 113, 0.05));
  border-left-color: var(--guide-danger);
}

.guide-callout-danger > i {
  color: var(--guide-danger);
}

/* ==========================================================================
   Blockquotes (default, non-callout)
   ========================================================================== */
.guide-content blockquote {
  margin: var(--guide-space-lg) 0;
  padding: var(--guide-space-lg);
  background: var(--guide-bg-subtle);
  border-left: 4px solid var(--guide-border);
  border-radius: 0 var(--guide-radius-md) var(--guide-radius-md) 0;
  font-style: italic;
  color: var(--guide-text-muted);
}

.guide-content blockquote p:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   Images
   ========================================================================== */
.guide-content img.guide-image {
  max-width: 100%;
  height: auto;
  border-radius: var(--guide-radius-lg);
  margin: var(--guide-space-lg) 0;
  box-shadow: var(--guide-shadow-lg);
  transition: transform var(--guide-transition-slow);
}

.guide-content img.guide-image:hover {
  transform: scale(1.02);
}

/* ==========================================================================
   Horizontal Rules
   ========================================================================== */
.guide-content hr {
  margin: var(--guide-space-2xl) 0;
  border: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--guide-border) 20%,
    var(--guide-border) 80%,
    transparent
  );
}

/* ==========================================================================
   Navigation Styles
   ========================================================================== */
.guide-nav {
  display: flex;
  justify-content: space-between;
  gap: var(--guide-space-lg);
  margin-top: var(--guide-space-2xl);
  padding-top: var(--guide-space-lg);
  border-top: 1px solid var(--guide-border);
}

.guide-nav-link {
  display: flex;
  align-items: center;
  gap: var(--guide-space-sm);
  padding: var(--guide-space-md) var(--guide-space-lg);
  background: var(--guide-bg-subtle);
  border-radius: var(--guide-radius-md);
  text-decoration: none;
  color: var(--guide-text);
  transition: all var(--guide-transition-base);
}

.guide-nav-link:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.05));
  transform: translateY(-2px);
  box-shadow: var(--guide-shadow-md);
}

.guide-nav-link::after {
  display: none;
}

/* ==========================================================================
   Table of Contents
   ========================================================================== */
.guide-toc {
  background: var(--guide-bg-subtle);
  border-radius: var(--guide-radius-lg);
  padding: var(--guide-space-lg);
  margin-bottom: var(--guide-space-xl);
}

.guide-toc-title {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--guide-text-muted);
  margin-bottom: var(--guide-space-md);
}

.guide-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.guide-toc-list li {
  margin-bottom: var(--guide-space-xs);
}

.guide-toc-list a {
  display: block;
  padding: var(--guide-space-xs) var(--guide-space-sm);
  border-radius: var(--guide-radius-sm);
  font-size: 0.875rem;
  color: var(--guide-text-muted);
  transition: all var(--guide-transition-fast);
}

.guide-toc-list a:hover {
  background: var(--guide-bg);
  color: var(--guide-primary);
}

.guide-toc-list a::after {
  display: none;
}

/* ==========================================================================
   Keyboard Shortcuts
   ========================================================================== */
.guide-content kbd {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  font-family: var(--guide-font-mono);
  font-size: 0.75rem;
  color: var(--guide-text);
  background: var(--guide-bg-muted);
  border: 1px solid var(--guide-border);
  border-radius: var(--guide-radius-sm);
  box-shadow:
    0 1px 0 var(--guide-border),
    inset 0 -1px 0 var(--guide-bg-subtle);
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */
.guide-text-center {
  text-align: center;
}

.guide-text-muted {
  color: var(--guide-text-muted);
}

.guide-mt-0 { margin-top: 0; }
.guide-mb-0 { margin-bottom: 0; }
.guide-mt-lg { margin-top: var(--guide-space-lg); }
.guide-mb-lg { margin-bottom: var(--guide-space-lg); }

/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
  .guide-content {
    font-size: 12pt;
    line-height: 1.5;
  }

  .guide-content h2 {
    background: none;
    -webkit-text-fill-color: var(--guide-text);
    border-bottom-color: var(--guide-border);
  }

  .guide-content pre.guide-code {
    background: var(--guide-bg-muted);
    border: 1px solid var(--guide-border);
    box-shadow: none;
  }

  .guide-content a::after {
    display: none;
  }

  .guide-callout {
    border: 1px solid;
  }
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */
@media (max-width: 768px) {
  .guide-content h1 {
    font-size: 1.75rem;
  }

  .guide-content h2 {
    font-size: 1.25rem;
  }

  .guide-content h3 {
    font-size: 1.125rem;
  }

  .guide-content pre.guide-code {
    padding: var(--guide-space-md);
    border-radius: var(--guide-radius-md);
  }

  .guide-content table.guide-table th,
  .guide-content table.guide-table td {
    padding: var(--guide-space-sm);
    font-size: 0.875rem;
  }

  .guide-callout {
    flex-direction: column;
    gap: var(--guide-space-sm);
  }

  .guide-nav {
    flex-direction: column;
  }
}

/* ==========================================================================
   Animation Classes
   ========================================================================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.guide-animate-in {
  animation: fadeInUp 0.5s ease-out;
}

.guide-animate-slide {
  animation: slideIn 0.3s ease-out;
}
