/* ──────────────────────────────────────────────────────────────────────────
   IFOKS Eğitim Portalı — Ana CSS
   ────────────────────────────────────────────────────────────────────────── */

:root {
  --bg-primary:       #0f1117;
  --bg-secondary:     #1a1d2e;
  --bg-surface:       #242836;
  --bg-surface-hover: #2d3245;
  --text-primary:     #e2e8f0;
  --text-secondary:   #94a3b8;
  --text-muted:       #64748b;
  --border:           #2d3245;
  --accent:           #3b82f6;
  --accent-hover:     #2563eb;
  --code-bg:          #1e293b;
  --success:          #10b981;
  --warning:          #f59e0b;
  --danger:           #ef4444;
  --radius:           8px;
  --radius-sm:        4px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Navbar ────────────────────────────────────────────────────────────── */
.navbar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
}
.brand-logo {
  height: 22px;
  width: auto;
  display: block;
  filter: brightness(0) invert(0.85) sepia(0.25) hue-rotate(5deg);
  opacity: 0.9;
}
.brand-divider {
  display: block;
  width: 1px;
  height: 18px;
  background: var(--border);
}
.brand-portal {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.03em;
}
.navbar-brand:hover .brand-logo { opacity: 1; }
.navbar-brand:hover .brand-portal { color: var(--text-primary); }
.navbar-right { display: flex; align-items: center; gap: 12px; }
.user-badge { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); }
.user-role { padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.role-admin { background: #312e81; color: #a5b4fc; }
.role-user  { background: #1e3a5f; color: #93c5fd; }
.user-name  { color: var(--text-primary); }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); text-decoration: none; color: #fff; }
.btn-secondary { background: var(--bg-surface); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg-surface-hover); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg-surface); color: var(--text-primary); text-decoration: none; }

/* ── Main content ──────────────────────────────────────────────────────── */
.main-content { flex: 1; }

/* ── Hero ──────────────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #0f1117 0%, #1a1d2e 50%, #1e1b4b 100%);
  border-bottom: 1px solid var(--border);
  padding: 56px 24px;
}
.hero-inner { max-width: 1400px; margin: 0 auto; }
.hero-title { font-size: clamp(24px, 4vw, 36px); font-weight: 700; margin-bottom: 12px; }
.hero-subtitle { font-size: 17px; color: var(--text-secondary); max-width: 600px; }
.hero-actions { margin-top: 20px; display: flex; gap: 12px; flex-wrap: wrap; }

/* ── Dashboard Module Grid ─────────────────────────────────────────────── */
.modules-grid-container { max-width: 1400px; margin: 0 auto; padding: 40px 24px; }
.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.module-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s, border-color 0.15s;
  text-decoration: none;
  color: inherit;
  position: relative;
}
.module-card:hover {
  transform: translateY(-2px);
  border-color: var(--mod-color, var(--accent));
  text-decoration: none;
}
.module-card-accent {
  height: 4px;
  background: var(--mod-color, var(--accent));
}
.module-card-body { padding: 20px; flex: 1; }
.module-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.module-number { font-size: 11px; color: var(--text-muted); font-weight: 700; font-family: monospace; }
.platform-badge-exos  { background: #1e3a5f; color: #60a5fa; }
.platform-badge-voss  { background: #2e1065; color: #c4b5fd; }
.platform-badge-both  { background: #1e293b; color: #94a3b8; }
.platform-badge-exos, .platform-badge-voss, .platform-badge-both {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; padding: 2px 7px; border-radius: 99px;
}
.module-title { font-size: 17px; font-weight: 600; margin-bottom: 6px; color: var(--text-primary); }
.module-description { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.module-card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.module-level { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.level-beginner      { color: #34d399; }
.level-intermediate  { color: #fbbf24; }
.level-advanced      { color: #f87171; }
.module-arrow { color: var(--mod-color, var(--accent)); font-size: 18px; }

.empty-state { text-align: center; padding: 80px 24px; color: var(--text-muted); }
.empty-state code { background: var(--code-bg); padding: 2px 6px; border-radius: 4px; }

/* ── Module Page Layout ────────────────────────────────────────────────── */
.module-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  max-width: 1400px;
  margin: 0 auto;
  min-height: calc(100vh - 56px - 52px);
}

.sidebar {
  border-right: 1px solid var(--border);
  padding: 24px 0;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
}
.sidebar-header { padding: 0 20px 16px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.back-link { font-size: 13px; color: var(--text-secondary); display: flex; align-items: center; gap: 4px; }
.back-link:hover { color: var(--text-primary); text-decoration: none; }

.toc { padding: 0 20px; flex: 1; }
.toc-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 10px; }
.toc-list { list-style: none; }
.toc-item { margin-bottom: 2px; }
.toc-level-3 { padding-left: 12px; }
.toc-link { font-size: 13px; color: var(--text-secondary); display: block; padding: 4px 6px; border-radius: var(--radius-sm); line-height: 1.4; }
.toc-link:hover { color: var(--text-primary); background: var(--bg-surface); text-decoration: none; }
.toc-link.active { color: var(--mod-color, var(--accent)); background: var(--bg-surface); }

.sidebar-actions { padding: 16px 20px; border-top: 1px solid var(--border); margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.sidebar-btn { width: 100%; justify-content: center; }
.export-group { display: flex; flex-direction: column; gap: 6px; }
.export-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); }

/* ── Module Content ────────────────────────────────────────────────────── */
.module-content { padding: 32px 48px; max-width: 900px; }
.module-header { margin-bottom: 32px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.module-header-meta { display: flex; gap: 8px; margin-bottom: 12px; }
.module-platform-badge {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em;
  padding: 3px 9px; border-radius: 99px; background: var(--bg-surface); color: var(--text-secondary);
}
.module-level-badge { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: var(--bg-surface); }
.module-page-title { font-size: clamp(22px, 3vw, 30px); font-weight: 700; margin-bottom: 8px; }
.module-page-desc { color: var(--text-secondary); font-size: 16px; }

/* ── Content body typography ───────────────────────────────────────────── */
.content-body { line-height: 1.75; }

.content-body h2 {
  font-size: 22px; font-weight: 700;
  color: var(--text-primary);
  margin: 40px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--mod-color, var(--accent));
}
.content-body h3 { font-size: 17px; font-weight: 600; margin: 28px 0 12px; color: var(--text-primary); }
.content-body h4 { font-size: 15px; font-weight: 600; margin: 20px 0 8px; color: var(--text-secondary); }
.content-body p   { margin-bottom: 16px; }
.content-body ul, .content-body ol { margin: 0 0 16px 24px; }
.content-body li  { margin-bottom: 6px; }
.content-body strong { color: var(--text-primary); }
.content-body hr  { border: none; border-top: 1px solid var(--border); margin: 32px 0; }

.content-body code {
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 0.875em;
  background: var(--code-bg);
  color: #93c5fd;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}
.content-body pre code { background: none; color: inherit; padding: 0; font-size: inherit; }

/* ── Code blocks ───────────────────────────────────────────────────────── */
.code-block, .hljs {
  position: relative;
  background: var(--code-bg) !important;
  border-radius: var(--radius);
  margin: 16px 0;
  overflow: auto;
  padding: 16px 20px;
  font-size: 13.5px;
  line-height: 1.6;
  border: 1px solid var(--border);
}
pre.hljs.code-block { display: block; }

/* ── Platform pair — server renders this; JS upgrades to tabs ──────────── */
.platform-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 20px 0;
}
.platform-block {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.platform-block pre { margin: 0; padding: 14px 16px; overflow-x: auto; }
.platform-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 7px 14px;
  border-bottom: 1px solid var(--border);
}
.platform-exos .platform-label { background: #1e3a5f; color: #60a5fa; }
.platform-voss .platform-label { background: #2e1065; color: #c4b5fd; }

/* ── Platform tabs (JS-upgraded version) ────────────────────────────────── */
.platform-tabs {
  margin: 20px 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  background: #0d1117;
}
.platform-tabs .tab-nav {
  display: flex;
  background: #080b11;
  border-bottom: 1px solid var(--border);
}
.platform-tabs .tab-btn {
  flex: 1;
  padding: 11px 24px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #475569;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  font-family: inherit;
}
.platform-tabs .tab-btn:hover { color: #94a3b8; }
.platform-tabs .tab-btn-exos.active {
  color: #60a5fa;
  border-bottom-color: #60a5fa;
  background: rgba(96,165,250,0.06);
}
.platform-tabs .tab-btn-voss.active {
  color: #a78bfa;
  border-bottom-color: #a78bfa;
  background: rgba(167,139,250,0.06);
}
.platform-tabs .tab-pane { display: none !important; position: relative; }
.platform-tabs .tab-pane.active { display: block !important; }
.platform-tabs pre {
  margin: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 22px 28px !important;
  font-size: 0.9rem !important;
  line-height: 1.7;
  background: #0d1117 !important;
  overflow-x: auto;
}
.platform-tabs pre code { font-size: inherit; }

/* Copy button */
.copy-btn {
  position: absolute;
  top: 10px;
  right: 14px;
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px 10px;
  font-size: 11px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}
.platform-tabs:hover .copy-btn,
.code-block:hover .copy-btn { opacity: 1; }
.copy-btn.copied { color: var(--success); border-color: var(--success); }

/* ── Callout boxes ─────────────────────────────────────────────────────── */
.callout {
  display: flex;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius);
  margin: 20px 0;
  border-left: 4px solid;
}
.callout-icon { font-size: 20px; flex-shrink: 0; margin-top: 2px; }
.callout-body { flex: 1; }
.callout-body > *:last-child { margin-bottom: 0; }
.callout-datacenter { background: #1e3a5f22; border-left-color: #3b82f6; }
.callout-datacenter .callout-icon::before { content: '🏢'; }
.callout-tip      { background: #05603a22; border-left-color: #10b981; }
.callout-tip .callout-icon::before { content: '💡'; }
.callout-warning  { background: #78350f22; border-left-color: #f59e0b; }
.callout-warning .callout-icon::before { content: '⚠️'; }

/* ── Mermaid diagrams ────────────────────────────────────────────────────── */
pre.mermaid {
  background: #0f172a !important;
  border: 1px solid #1e293b !important;
  border-radius: 12px;
  text-align: center;
  padding: 28px 20px;
  margin: 24px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  /* UA varsayılanı monospace'tir; mermaid etiketleri sans ile ölçtüğü için
     mono ile render edilince yazılar kutulardan taşar/kesilir. */
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}
pre.mermaid svg {
  max-width: 100%;
  display: block;
  margin: 0 auto;
}

/* ── Module navigation (prev/next) ─────────────────────────────────────── */
.module-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.module-nav-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-primary);
  text-decoration: none;
  flex: 1;
  max-width: 48%;
  transition: border-color 0.15s, background 0.15s;
}
.module-nav-btn:hover {
  border-color: var(--accent);
  background: var(--bg-surface);
}
.module-nav-next { justify-content: flex-end; text-align: right; }
.module-nav-prev { justify-content: flex-start; text-align: left; }
.module-nav-done { border-style: dashed; opacity: 0.7; }
.module-nav-done:hover { opacity: 1; }
.module-nav-arrow {
  font-size: 20px;
  color: var(--accent);
  flex-shrink: 0;
  line-height: 1;
}
.module-nav-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.module-nav-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}
.module-nav-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Footer ────────────────────────────────────────────────────────────── */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 14px 24px;
  font-size: 12px;
  color: var(--text-muted);
}
.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.footer-logo {
  height: 14px;
  width: auto;
  filter: brightness(0) invert(0.5) sepia(0.2) hue-rotate(5deg);
  opacity: 0.6;
  display: block;
}
.footer-copy {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Login page ────────────────────────────────────────────────────────── */
.login-page {
  background: linear-gradient(135deg, #0f1117 0%, #1a1d2e 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-container { width: 100%; max-width: 440px; padding: 24px; }
.login-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
}
.login-logo { margin-bottom: 24px; }
.login-logo-img {
  height: 36px;
  width: auto;
  filter: brightness(0) invert(0.8) sepia(0.3) hue-rotate(5deg);
  opacity: 0.9;
}
.login-title { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.login-subtitle { color: var(--text-secondary); font-size: 14px; margin-bottom: 28px; }
.btn-login { width: 100%; justify-content: center; padding: 12px 20px; font-size: 15px; }
.login-note { margin-top: 20px; font-size: 12px; color: var(--text-muted); }
.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: 12px;
}
.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.login-form { display: flex; flex-direction: column; gap: 10px; }
.login-input {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
}
.login-input:focus {
  outline: none;
  border-color: #8b5cf6;
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

/* ── Alert ─────────────────────────────────────────────────────────────── */
.alert { padding: 10px 16px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 20px; }
.alert-error { background: #450a0a; border: 1px solid #991b1b; color: #fca5a5; }

/* ── Error pages ───────────────────────────────────────────────────────── */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  padding: 40px 24px;
}
.error-code { font-size: 96px; font-weight: 800; color: var(--bg-surface); line-height: 1; margin-bottom: 16px; }
.error-title { font-size: 28px; font-weight: 700; margin-bottom: 12px; }
.error-message { color: var(--text-secondary); font-size: 16px; margin-bottom: 8px; max-width: 500px; }
.error-detail { color: var(--text-muted); font-size: 13px; margin-bottom: 24px; }
.error-detail code { background: var(--code-bg); padding: 2px 6px; border-radius: 4px; }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .module-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .module-content { padding: 24px; }
  .platform-pair { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .modules-grid { grid-template-columns: 1fr; }
  .hero { padding: 32px 16px; }
  .modules-grid-container { padding: 24px 16px; }
  .navbar-inner { padding: 0 16px; }
  .user-name { display: none; }
}

/* ── Breadcrumb ────────────────────────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--text-primary); text-decoration: none; }
.bc-sep { color: var(--text-muted); }
.breadcrumb span:last-child { color: var(--text-secondary); }

/* In module header, breadcrumb sits above the meta badges */
.module-header .breadcrumb { margin-bottom: 16px; }

/* ── Vendor page hero accent ───────────────────────────────────────────────── */
.hero { --hero-color: var(--accent); }

/* ── Inactive cards ────────────────────────────────────────────────────────── */
.module-card--inactive {
  opacity: 0.55;
  cursor: default;
  user-select: none;
}
.module-card--inactive:hover {
  transform: none;
  border-color: var(--border);
}

/* ── Vendor logo ───────────────────────────────────────────────────────────── */
.vendor-logo     { font-size: 20px; line-height: 1; }
.vendor-logo-lg  { font-size: 36px; line-height: 1; margin-right: 12px; vertical-align: middle; }

/* ── Yakında badge ─────────────────────────────────────────────────────────── */
.badge-yakinda {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--bg-surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
