/* ============================================
   RUIX MK1 CNC Grundkurs - Stylesheet
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Bitter:ital,wght@0,400;0,600;0,700;1,400&display=swap');

/* User-Bar (login info, shown below site-header) */
.user-bar {
  background: #132231;
  color: rgba(255,255,255,0.75);
  font-size: 0.8rem;
  padding: 5px 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.user-bar strong { color: white; }
.user-bar a { color: var(--accent, #e67e22); text-decoration: none; }
.user-bar a:hover { text-decoration: underline; }

:root {
  --primary: #1a2e44;
  --accent: #e67e22;
  --accent-dark: #ca6f1e;
  --success: #27ae60;
  --danger: #e74c3c;
  --warning-bg: #fef9e7;
  --warning-border: #f39c12;
  --info-bg: #eaf4fb;
  --info-border: #3498db;
  --danger-bg: #fdedec;
  --danger-border: #e74c3c;
  --success-bg: #eafaf1;
  --success-border: #27ae60;
  --bg: #f4f4f0;
  --card-bg: #ffffff;
  --text: #2c2c2c;
  --text-light: #666666;
  --border: #ddd;
  --nav-height: 60px;
}

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

body {
  font-family: 'Bitter', Georgia, serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
}

/* ---- HEADER ---- */
.site-header {
  background: var(--primary);
  color: white;
  padding: 0 2rem;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.site-header .logo {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 14px;
}

.site-header .logo .logo-img {
  height: 38px;
  border-radius: 4px;
  background: white;
  padding: 3px 10px;
  display: block;
}

.site-header .logo .logo-course {
  font-family: 'Bitter', Georgia, serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  letter-spacing: 0.3px;
  border-left: 2px solid var(--accent);
  padding-left: 14px;
  line-height: 1.3;
}

.site-header nav {
  display: flex;
  gap: 4px;
}

.site-header nav a {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 500;
  transition: all 0.2s;
  white-space: nowrap;
}

.site-header nav a:hover,
.site-header nav a.active {
  background: var(--accent);
  color: white;
}

/* ---- HAMBURGER ---- */
.hamburger {
  display: none !important;
  -webkit-appearance: none;
  appearance: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 6px;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.2s;
}
.hamburger:hover { background: rgba(255,255,255,0.12); }
.hamburger span {
  display: block;
  height: 2px;
  background: white;
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
  transform-origin: center;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---- HERO / PAGE TITLE ---- */
.page-hero {
  background: linear-gradient(135deg, var(--primary) 0%, #2c4a6e 100%);
  color: white;
  padding: 3rem 2rem;
  text-align: center;
}

.page-hero .chapter-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.page-hero h1 {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.page-hero .subtitle {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.75);
  max-width: 600px;
  margin: 0 auto;
}

/* ---- MAIN CONTENT ---- */
.main-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
}

/* ---- SECTION ---- */
.section {
  background: var(--card-bg);
  border-radius: 10px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.section h2 {
  font-size: 1.45rem;
  color: var(--primary);
  margin-bottom: 1.25rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--accent);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section h2 .icon {
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: white;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.section h2 .icon svg {
  width: 14px;
  height: 14px;
}

.section h3 {
  font-size: 1.1rem;
  color: var(--primary);
  margin: 1.5rem 0 0.6rem 0;
}

.section p {
  margin-bottom: 0.85rem;
  color: var(--text);
}

.section ul, .section ol {
  margin: 0.5rem 0 1rem 1.5rem;
}

.section li {
  margin-bottom: 0.4rem;
}

/* ---- CALLOUT BOXES ---- */
.callout {
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  border-left: 4px solid;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.callout .callout-icon {
  font-size: 0;
  line-height: 0;
  flex-shrink: 0;
  margin-top: 3px;
}

.callout .callout-icon svg {
  width: 14px;
  height: 14px;
}

.chapter-card h3 svg {
  width: 14px;
  height: 14px;
  vertical-align: -1px;
}


.callout .callout-content strong {
  display: block;
  margin-bottom: 0.25rem;
}

.callout.warning {
  background: var(--warning-bg);
  border-color: var(--warning-border);
}

.callout.info {
  background: var(--info-bg);
  border-color: var(--info-border);
}

.callout.danger {
  background: var(--danger-bg);
  border-color: var(--danger-border);
}

.callout.success {
  background: var(--success-bg);
  border-color: var(--success-border);
}

/* ---- TABLES ---- */
.table-wrap {
  overflow-x: auto;
  margin: 1rem 0;
}

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

thead {
  background: var(--primary);
  color: white;
}

thead th {
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

tbody tr:nth-child(even) {
  background: #f8f8f6;
}

tbody td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
}

tbody tr:last-child td {
  border-bottom: none;
}

.tag-good {
  background: #d5f5e3;
  color: #1e8449;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 600;
}

.tag-bad {
  background: #fde8e8;
  color: #c0392b;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 600;
}

.tag-mid {
  background: #fef3cd;
  color: #856404;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 600;
}

/* ---- TOOL CARDS (Fräsertypen) ---- */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.tool-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  background: white;
  border-top: 3px solid var(--accent);
}

.tool-card .tool-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.35rem;
}

.tool-card .tool-sub {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-bottom: 0.75rem;
  font-style: italic;
}

.tool-card .pros-cons {
  font-size: 0.87rem;
}

.tool-card .pros-cons .pro {
  color: var(--success);
  font-weight: 600;
}

.tool-card .pros-cons .con {
  color: var(--danger);
  font-weight: 600;
}

.tool-card .pros-cons ul {
  margin: 0.2rem 0 0.6rem 1.1rem;
}

.tool-card .use-for {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #eee;
  font-size: 0.83rem;
  color: var(--text-light);
}

.tool-card .use-for strong {
  color: var(--primary);
}

/* ---- SVG DIAGRAMS ---- */
.diagram-row {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 1.5rem 0;
}

.diagram-item {
  text-align: center;
}

.diagram-item figcaption {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-top: 6px;
  font-weight: 600;
}

/* ---- STEPS ---- */
.steps {
  counter-reset: step-counter;
  list-style: none;
  margin: 0.5rem 0 1rem 0;
  padding: 0;
}

.steps li {
  counter-increment: step-counter;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f0f0f0;
}

.steps li:last-child {
  border-bottom: none;
}

.steps li::before {
  content: counter(step-counter);
  background: var(--accent);
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.steps li .step-content strong {
  display: block;
  color: var(--primary);
  margin-bottom: 0.2rem;
}

/* ---- CHECKLIST ---- */
.checklist {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
}

.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid #f4f4f0;
}

.checklist li::before {
  content: '☐';
  font-size: 1.1rem;
  color: var(--accent);
  flex-shrink: 0;
}

/* ---- CHAPTER NAVIGATION CARDS (Index) ---- */
.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.25rem;
  margin: 2rem 0;
}

.chapter-card {
  background: white;
  border-radius: 10px;
  padding: 1.5rem;
  text-decoration: none;
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border: 1px solid var(--border);
  transition: all 0.25s;
  display: block;
  border-top: 4px solid var(--accent);
}

.chapter-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  border-top-color: var(--primary);
}

.chapter-card .card-num {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.chapter-card h3 {
  font-size: 1.1rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.chapter-card p {
  font-size: 0.87rem;
  color: var(--text-light);
  line-height: 1.5;
}

.chapter-card .card-topics {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.chapter-card .topic-tag {
  background: #f0f0ec;
  color: var(--text-light);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
}

/* ---- QUIZ SECTION ---- */
.quiz-section {
  background: var(--primary);
  border-radius: 10px;
  padding: 2rem;
  margin-top: 2.5rem;
  color: white;
}

.quiz-section h2 {
  font-size: 1.4rem;
  margin-bottom: 0.4rem;
  color: white;
}

.quiz-section .quiz-intro {
  color: rgba(255,255,255,0.7);
  margin-bottom: 1.5rem;
  font-size: 0.92rem;
}

.quiz-question {
  background: rgba(255,255,255,0.07);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  border: 1px solid rgba(255,255,255,0.1);
}

.quiz-question .q-text {
  font-weight: 600;
  margin-bottom: 1rem;
  font-size: 1rem;
  line-height: 1.5;
}

.quiz-question .q-num {
  color: var(--accent);
  margin-right: 4px;
}

.quiz-options {
  list-style: none;
  padding: 0;
  margin: 0;
}

.quiz-options li {
  margin-bottom: 0.5rem;
}

.quiz-options label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.15);
  transition: background 0.15s;
  font-size: 0.93rem;
  line-height: 1.4;
}

.quiz-options label:hover {
  background: rgba(255,255,255,0.1);
}

.quiz-options input[type="radio"] {
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--accent);
}

.quiz-options label.correct {
  background: rgba(39, 174, 96, 0.25);
  border-color: var(--success);
}

.quiz-options label.wrong {
  background: rgba(231, 76, 60, 0.2);
  border-color: var(--danger);
}

.quiz-options label.correct-unselected {
  background: rgba(39, 174, 96, 0.12);
  border-color: var(--success);
  opacity: 0.8;
}

.quiz-explanation {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.08);
  border-radius: 6px;
  font-size: 0.87rem;
  color: rgba(255,255,255,0.85);
  display: none;
  border-left: 3px solid var(--accent);
}

.quiz-explanation.show {
  display: block;
}

.quiz-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 12px 32px;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 0.5rem;
}

.quiz-btn:hover {
  background: var(--accent-dark);
}

.quiz-result {
  margin-top: 1.25rem;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  display: none;
}

.quiz-result.show {
  display: block;
}

.quiz-result.pass {
  background: rgba(39, 174, 96, 0.2);
  border: 1px solid var(--success);
  color: #aaffcc;
}

.quiz-result.fail {
  background: rgba(231, 76, 60, 0.15);
  border: 1px solid var(--danger);
  color: #ffcccc;
}

/* ---- PAGE NAVIGATION ---- */
.page-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.page-nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 10px 20px;
  border: 2px solid var(--border);
  border-radius: 6px;
  transition: all 0.2s;
}

.page-nav a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.page-nav .spacer {
  flex: 1;
}

/* ---- FORMULA BOX ---- */
.formula-box {
  background: #1a2e44;
  color: white;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin: 1.25rem 0;
  font-family: 'Courier New', monospace;
  font-size: 0.97rem;
}

.formula-box .formula-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  margin-bottom: 0.5rem;
  font-family: 'Bitter', Georgia, serif;
  font-weight: 600;
}

.formula-box .formula {
  font-size: 1.1rem;
  color: #fff;
  margin-bottom: 0.25rem;
}

.formula-box .formula-example {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.6);
  margin-top: 0.5rem;
}

/* ---- PROGRESS BAR ---- */
.progress-bar {
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  height: 4px;
  margin-top: 8px;
}

.progress-bar .fill {
  background: var(--accent);
  height: 4px;
  border-radius: 4px;
}

/* ---- FOOTER ---- */
.site-footer {
  background: var(--primary);
  color: rgba(255,255,255,0.5);
  text-align: center;
  padding: 1.5rem 2rem;
  font-size: 0.83rem;
  margin-top: 3rem;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .hamburger { display: flex !important; }

  .site-header nav {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--primary);
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 1rem 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 99;
  }
  .site-header nav.open { display: flex; }
  .site-header nav a {
    padding: 10px 14px;
    font-size: 0.95rem;
    border-radius: 6px;
  }

  .page-hero h1 {
    font-size: 1.6rem;
  }

  .main-content {
    padding: 1.5rem 1rem;
  }

  .section {
    padding: 1.25rem;
  }

  .tool-grid {
    grid-template-columns: 1fr;
  }

  .chapter-grid {
    grid-template-columns: 1fr;
  }

  .page-nav {
    flex-direction: column;
    gap: 10px;
  }
}

/* ---- HIGHLIGHT / KEYBOARD ---- */
kbd {
  background: #eee;
  border: 1px solid #ccc;
  border-bottom: 3px solid #bbb;
  border-radius: 4px;
  padding: 1px 7px;
  font-family: monospace;
  font-size: 0.85rem;
  color: #333;
}

code {
  background: #f0f0ec;
  border-radius: 4px;
  padding: 1px 6px;
  font-family: monospace;
  font-size: 0.9rem;
  color: #c0392b;
}

strong.highlight {
  color: var(--accent);
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 600px) {
  .two-col {
    grid-template-columns: 1fr;
  }
}
