/* 
   Glossary Page Global Styles
   This file contains the primary layout and design for all AI Glossary term pages.
*/

:root {
  --gl-primary: #6366f1; /* Indigo */
  --gl-primary-light: #eef2ff;
  --gl-secondary: #1e1b4b; /* Deep Indigo */
  --gl-accent: #f43f5e; /* Rose */
  --gl-text: #334155;
  --gl-text-muted: #64748b;
  --gl-bg: #f8fafc;
  --gl-card-bg: #ffffff;
  --gl-border: #e2e8f0;
  --gl-radius: 12px;
  --gl-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.glossary-term-page {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--gl-text);
  line-height: 1.6;
  background-color: var(--gl-bg);
  scroll-behavior: smooth;
}

.gl-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Hero Section */
.gl-hero {
  padding: 80px 0 60px;
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  border-bottom: 1px solid var(--gl-border);
  position: relative;
  overflow: hidden;
}

.gl-hero::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
  border-radius: 50%;
}

.gl-breadcrumb {
  display: flex;
  gap: 8px;
  font-size: 14px;
  color: var(--gl-text-muted);
  margin-bottom: 24px;
}

.gl-breadcrumb a {
  color: var(--gl-primary);
  text-decoration: none;
}

.gl-hero h1 {
  font-size: 48px;
  font-weight: 800;
  color: var(--gl-secondary);
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.gl-hero-intro {
  font-size: 20px;
  color: var(--gl-text-muted);
  margin-bottom: 32px;
}

.gl-simple-box {
  background: var(--gl-card-bg);
  border-left: 4px solid var(--gl-primary);
  padding: 24px;
  border-radius: 0 var(--gl-radius) var(--gl-radius) 0;
  box-shadow: var(--gl-shadow);
  margin-bottom: 32px;
}

.gl-simple-box h3 {
  font-size: 18px;
  margin-bottom: 12px;
  color: var(--gl-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.gl-hero-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.gl-highlight-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--gl-secondary);
}

.gl-highlight-icon {
  width: 24px;
  height: 24px;
  color: var(--gl-primary);
}

/* Layout */
.gl-main-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
  padding: 60px 0;
}

@media (max-width: 992px) {
  .gl-main-layout {
    grid-template-columns: 1fr;
  }
}

/* TOC */
.gl-sidebar {
  position: sticky;
  top: 100px;
  height: fit-content;
}

@media (max-width: 992px) {
  .gl-sidebar {
    display: none;
  }
}

.gl-toc {
  background: var(--gl-card-bg);
  padding: 24px;
  border-radius: var(--gl-radius);
  border: 1px solid var(--gl-border);
}

.gl-toc h4 {
  margin-bottom: 16px;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gl-text-muted);
}

.gl-toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.gl-toc li {
  margin-bottom: 8px;
}

.gl-toc a {
  text-decoration: none;
  color: var(--gl-text);
  font-size: 15px;
  transition: all 0.2s;
  display: block;
  padding: 4px 0;
}

.gl-toc a:hover, .gl-toc a.active {
  color: var(--gl-primary);
  padding-left: 8px;
  border-left: 2px solid var(--gl-primary);
}

/* Quick Answer Box */
.gl-quick-answer {
  background: linear-gradient(to right, #eff2ff, #e0e7ff);
  padding: 32px;
  border-radius: var(--gl-radius);
  margin-bottom: 48px;
  border: 1px solid #c7d2fe;
}

.gl-quick-answer h2 {
  font-size: 24px;
  margin-bottom: 16px;
  color: var(--gl-secondary);
}

.gl-quick-answer p {
  font-size: 18px;
  font-weight: 500;
  color: #1e1b4b;
}

/* Content Sections */
.gl-section {
  margin-bottom: 64px;
}

.gl-section h2 {
  font-size: 32px;
  margin-bottom: 24px;
  color: var(--gl-secondary);
  display: flex;
  align-items: center;
  gap: 12px;
}

.gl-section p {
  margin-bottom: 20px;
  font-size: 17px;
  color: var(--gl-text);
}

/* Card Elements */
.gl-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 32px;
}

.gl-card {
  background: #ffffff;
  padding: 36px;
  border-radius: 16px;
  border: 1px solid #f1f5f9;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.04), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gl-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.gl-card h3 {
  margin: 0;
  color: #1e1b4b;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
}

.gl-card p {
  margin: 0;
  color: #475569;
  font-size: 16px;
  line-height: 1.6;
}

/* Steps */
.gl-steps {
  list-style: none;
  padding: 0;
}

.gl-step {
  display: flex;
  gap: 20px;
  margin-bottom: 32px;
  position: relative;
}

.gl-step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 20px;
  top: 40px;
  bottom: -20px;
  width: 2px;
  background: var(--gl-border);
}

.gl-step-number {
  width: 40px;
  height: 40px;
  background: var(--gl-primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
  z-index: 1;
}

.gl-step-content h3 {
  margin-bottom: 8px;
  font-size: 20px;
}

/* Tables */
.gl-table-wrapper {
  overflow-x: auto;
  margin: 32px 0;
  border-radius: var(--gl-radius);
  border: 1px solid var(--gl-border);
}

.gl-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--gl-card-bg);
}

.gl-table th {
  background: #f8fafc;
  padding: 16px;
  text-align: left;
  border-bottom: 2px solid var(--gl-border);
  font-weight: 700;
}

.gl-table td {
  padding: 16px;
  border-bottom: 1px solid var(--gl-border);
}

.gl-table tr:last-child td {
  border-bottom: none;
}

.gl-table tr:nth-child(even) {
  background: #fcfcfc;
}

/* FAQs */
.gl-faq-container {
  margin-top: 32px;
}

.gl-faq-item {
  background: var(--gl-card-bg);
  border: 1px solid var(--gl-border);
  border-radius: var(--gl-radius);
  margin-bottom: 16px;
  overflow: hidden;
}

.gl-faq-question {
  padding: 24px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 18px;
  transition: background 0.2s;
}

.gl-faq-question:hover {
  background: #f8fafc;
}

.gl-faq-answer {
  padding: 0 24px;
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s ease-out;
  background: #fff;
}

.gl-faq-item.active .gl-faq-answer {
  padding: 0 24px 24px;
  max-height: 1000px;
}

.gl-faq-icon {
  width: 20px;
  height: 20px;
  transition: transform 0.3s;
}

.gl-faq-item.active .gl-faq-icon {
  transform: rotate(180deg);
}

/* Related Terms Block */
.gl-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.gl-related-link {
  text-decoration: none;
  transition: all 0.2s ease;
}

.gl-related-item {
  background: #ffffff;
  padding: 16px;
  border-radius: 12px;
  text-align: center;
  font-weight: 600;
  color: #1e1b4b;
  font-size: 15px;
  transition: all 0.2s ease;
  border: 1px solid #f1f5f9;
}

.gl-related-link:hover .gl-related-item {
  background: #eff6ff;
  border-color: #dbeafe;
  color: #2563eb;
  transform: translateY(-2px);
}

/* Internal Linking Placeholder Boxes */
.gl-box-note {
  background: #fffbeb;
  border-left: 4px solid #f59e0b;
  padding: 24px;
  border-radius: 8px;
  margin: 32px 0;
}

.gl-box-pro {
  background: #f0fdf4;
  border-left: 4px solid #10b981;
  padding: 24px;
  border-radius: 8px;
  margin: 32px 0;
}

/* Summary Section */
.gl-summary-box {
  background: var(--gl-secondary);
  color: white;
  padding: 48px;
  border-radius: var(--gl-radius);
  margin-top: 60px;
  text-align: center;
}

.gl-summary-box h2 {
  color: white;
  margin-bottom: 16px;
}

.gl-summary-box p {
  color: #cbd5e1;
  font-size: 18px;
  max-width: 600px;
  margin: 0 auto;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
  .gl-hero h1 {
    font-size: 32px;
  }
  
  .gl-section h2 {
    font-size: 26px;
  }
  
  .gl-card {
    padding: 24px;
  }
}

/* Utility */
.copy-btn {
  background: var(--gl-primary-light);
  color: var(--gl-primary);
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  margin-top: 16px;
}

.copy-btn:hover {
  background: #e0e7ff;
}
