/* ═══════════════════════════════════════════════════════════════
   BI-IDO Státnicové poznámky – Mobile-First CSS
   ═══════════════════════════════════════════════════════════════ */

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

/* ── CSS Custom Properties ── */
:root {
  /* Colors – Light Theme */
  --bg-primary: #f8f9fc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f3f9;
  --bg-code: #f0f2f8;
  --bg-highlight: rgba(99, 102, 241, 0.06);
  
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-heading: #0f172a;
  
  --accent-1: #4f46e5;     /* Indigo */
  --accent-2: #7c3aed;     /* Violet */
  --accent-3: #0891b2;     /* Cyan */
  --accent-4: #059669;     /* Emerald */
  --accent-5: #d97706;     /* Amber */
  --accent-6: #dc2626;     /* Red */
  --accent-7: #db2777;     /* Pink */
  
  --gradient-1: linear-gradient(135deg, #4f46e5, #7c3aed);
  --gradient-2: linear-gradient(135deg, #0891b2, #059669);
  --gradient-3: linear-gradient(135deg, #d97706, #dc2626);
  
  --border-color: #e2e8f0;
  --border-accent: rgba(79, 70, 229, 0.25);
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.1);
  --shadow-glow: 0 0 20px rgba(79, 70, 229, 0.1);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* ── Reset & Base ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ── Background Pattern ── */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(ellipse at 20% 50%, rgba(79, 70, 229, 0.04) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(124, 58, 237, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 90%, rgba(8, 145, 178, 0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

/* ── Header ── */
.hero {
  background: var(--gradient-1);
  padding: 2rem 1rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.15) 1px, transparent 1px);
  background-size: 30px 30px;
  animation: heroPattern 20s linear infinite;
}

@keyframes heroPattern {
  0% { transform: translate(0, 0); }
  100% { transform: translate(30px, 30px); }
}

.hero h1 {
  font-size: 1.8rem;
  font-weight: 800;
  color: #fff;
  position: relative;
  z-index: 1;
  letter-spacing: -0.02em;
}

.hero .subtitle {
  font-size: 1rem;
  color: rgba(255,255,255,0.85);
  margin-top: 0.5rem;
  position: relative;
  z-index: 1;
  font-weight: 300;
}

.hero .badge-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
  position: relative;
  z-index: 1;
}

.hero .badge {
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  padding: 0.35rem 0.85rem;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
}

/* ── Navigation / TOC ── */
.toc-bar {
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
}

.toc-bar h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.toc-links {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.toc-links a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toc-links a:hover {
  background: var(--bg-highlight);
  color: var(--accent-1);
}

.toc-links a .num {
  background: var(--gradient-1);
  color: #fff;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ── Main Container ── */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem;
}

/* ── Section (Okruh) ── */
.okruh {
  margin-bottom: 3rem;
  animation: fadeInUp 0.5s ease-out;
}

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

.okruh-header {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent-1);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

.okruh-header::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(79,70,229,0.05));
  pointer-events: none;
}

.okruh-header .okruh-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-1);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.okruh-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-heading);
  line-height: 1.3;
}

.okruh-header .okruh-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 0.5rem;
  line-height: 1.6;
}

/* ── Content Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  transition: var(--transition);
}

.card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
}

.card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card h3 .icon {
  font-size: 1.3rem;
}

.card h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent-3);
  margin: 1rem 0 0.5rem;
}

.card h5 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent-4);
  margin: 0.75rem 0 0.5rem;
}

.card p {
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  line-height: 1.7;
}

.card ul, .card ol {
  padding-left: 1.25rem;
  margin-bottom: 0.75rem;
}

.card li {
  margin-bottom: 0.4rem;
  line-height: 1.6;
  color: var(--text-primary);
}

.card li::marker {
  color: var(--accent-1);
}

/* ── Key Terms ── */
.term {
  color: var(--accent-3);
  font-weight: 600;
}

.term-def {
  background: rgba(8, 145, 178, 0.06);
  border-left: 3px solid var(--accent-3);
  padding: 0.75rem 1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 0.75rem 0;
}

.term-def strong {
  color: var(--accent-3);
}

/* ── Highlight Box ── */
.highlight-box {
  background: var(--bg-highlight);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin: 1rem 0;
}

.highlight-box.warning {
  background: rgba(217, 119, 6, 0.06);
  border-color: rgba(217, 119, 6, 0.25);
}

.highlight-box.danger {
  background: rgba(220, 38, 38, 0.06);
  border-color: rgba(220, 38, 38, 0.25);
}

.highlight-box.success {
  background: rgba(5, 150, 105, 0.06);
  border-color: rgba(5, 150, 105, 0.25);
}

.highlight-box .box-title {
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.highlight-box .box-title.accent { color: var(--accent-1); }
.highlight-box .box-title.warning { color: var(--accent-5); }
.highlight-box .box-title.danger { color: var(--accent-6); }
.highlight-box .box-title.success { color: var(--accent-4); }

/* ── Code ── */
code {
  font-family: var(--font-mono);
  background: var(--bg-code);
  color: var(--accent-3);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.85em;
  border: 1px solid var(--border-color);
}

pre {
  background: var(--bg-code);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem;
  overflow-x: auto;
  margin: 0.75rem 0;
  font-size: 0.85rem;
  line-height: 1.6;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text-primary);
}

/* ── Tables ── */
.table-wrap {
  overflow-x: auto;
  margin: 1rem 0;
  border-radius: var(--radius-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead {
  background: var(--gradient-1);
}

th {
  color: #fff;
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
}

td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

tr:hover td {
  background: var(--bg-highlight);
}

/* ── Workflow / Lifecycle Diagram ── */
.lifecycle {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 1rem 0;
}

.lifecycle .state {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-1);
  white-space: nowrap;
}

.lifecycle .state.active {
  background: var(--gradient-1);
  color: #fff;
  border-color: transparent;
}

.lifecycle .arrow {
  color: var(--text-muted);
  font-size: 1.2rem;
}

/* ── Summary Box ── */
.summary-box {
  background: linear-gradient(135deg, rgba(79,70,229,0.05), rgba(124,58,237,0.05));
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.summary-box h3 {
  color: var(--accent-2);
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.summary-box ul {
  padding-left: 1.25rem;
}

.summary-box li {
  margin-bottom: 0.4rem;
  color: var(--text-primary);
}

.summary-box li::marker {
  color: var(--accent-2);
}

/* ── Q&A Section ── */
.qa-section {
  margin: 1.5rem 0;
}

.qa-section h3 {
  color: var(--accent-5);
  font-size: 1.1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.qa-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  overflow: hidden;
  transition: var(--transition);
}

.qa-item:hover {
  border-color: var(--border-accent);
}

.qa-question {
  padding: 1rem 1.25rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  color: var(--text-heading);
  user-select: none;
  transition: var(--transition);
}

.qa-question:hover {
  background: var(--bg-highlight);
}

.qa-question::after {
  content: '▸';
  color: var(--accent-5);
  font-size: 1.2rem;
  transition: transform 0.3s ease;
  flex-shrink: 0;
  margin-left: 0.5rem;
}

.qa-item.open .qa-question::after {
  transform: rotate(90deg);
}

.qa-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.3s ease;
}

.qa-item.open .qa-answer {
  max-height: 1000px;
  padding: 0 1.25rem 1rem;
}

.qa-answer p, .qa-answer ul {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
}

.qa-answer ul {
  padding-left: 1.25rem;
  margin-top: 0.5rem;
}

/* ── Comparison Box ── */
.comparison {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 1rem 0;
}

.comparison .col {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.comparison .col h4 {
  margin-top: 0;
}

/* ── Scroll-to-Top ── */
.scroll-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  background: var(--gradient-1);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 1.3rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow-md);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scroll-top.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-top:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* ── Footer ── */
footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border-color);
  margin-top: 2rem;
}

/* ─── Separator ─── */
.separator {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-color), transparent);
  margin: 2rem 0;
}

/* ── Strong/Bold in context ── */
strong {
  color: var(--text-heading);
  font-weight: 600;
}

/* ── Sub-card ── */
.sub-card {
  background: rgba(79, 70, 229, 0.04);
  border: 1px solid rgba(79, 70, 229, 0.12);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin: 0.75rem 0;
}

/* ═══════════════════════════════════════════════════════════════
   TABLET (≥ 640px)
   ═══════════════════════════════════════════════════════════════ */
@media (min-width: 640px) {
  .hero {
    padding: 3rem 2rem;
  }
  
  .hero h1 {
    font-size: 2.2rem;
  }
  
  .hero .subtitle {
    font-size: 1.1rem;
  }
  
  .container {
    padding: 1.5rem;
  }
  
  .toc-links {
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .card {
    padding: 1.5rem;
  }
  
  .okruh-header {
    padding: 2rem;
  }
  
  .okruh-header h2 {
    font-size: 1.6rem;
  }
  
  .comparison {
    grid-template-columns: 1fr 1fr;
  }
}

/* ═══════════════════════════════════════════════════════════════
   DESKTOP (≥ 1024px)
   ═══════════════════════════════════════════════════════════════ */
@media (min-width: 1024px) {
  .hero h1 {
    font-size: 2.6rem;
  }
  
  .container {
    padding: 2rem;
  }
  
  .card {
    padding: 2rem;
  }
  
  .okruh-header {
    padding: 2.5rem;
  }
  
  .okruh-header h2 {
    font-size: 1.8rem;
  }
}
