﻿/* =============================================
   Unterweisungsplattform  app.css
   Bootstrap 5 loaded via CDN in header.php
   Bootstrap Icons loaded via CDN in header.php
   ============================================= */

/*  CSS custom properties  */
:root {
  --brand-primary: #8cbf44;
  --brand-dark:    #6d9a2e;
  --brand-light:   #a8d46a;
  --t4s-primary:   #8cbf44;
  --t4s-primary-dark: #6d9a2e;
}

/*  Tenant color overrides (set inline by header.php)  */
.btn-primary,
.badge.bg-primary,
.bg-primary {
  background-color: var(--brand-primary) !important;
  border-color: var(--brand-primary) !important;
}
.btn-primary:hover,
.btn-primary:focus {
  filter: brightness(0.9);
}
.btn-outline-primary {
  color: var(--brand-primary) !important;
  border-color: var(--brand-primary) !important;
}
.btn-outline-primary:hover {
  background-color: var(--brand-primary) !important;
  color: #fff !important;
}
.text-primary      { color: var(--brand-primary) !important; }
.border-primary    { border-color: var(--brand-primary) !important; }
.form-check-input:checked { background-color: var(--brand-primary); border-color: var(--brand-primary); }
.nav-pills .nav-link.active { background-color: var(--brand-primary); }
.progress-bar      { background-color: var(--brand-primary); }
.page-link         { color: var(--brand-primary); }
.page-item.active .page-link { background-color: var(--brand-primary); border-color: var(--brand-primary); }
.form-control:focus, .form-select:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 .2rem rgba(140,191,68,.2);
}

/*  Base  */
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: #f4f6f8;
  font-size: 0.925rem;
  color: #333;
}
main.container {
  min-height: calc(100vh - 130px);
  position: relative;
  z-index: 1;
}

/*  Navbar  */
.t4s-navbar {
  background: #fff;
  border-bottom: 1px solid #e8ecef;
  z-index: 1040;
  position: sticky;
  top: 0;
}
.t4s-navbar .nav-link {
  font-weight: 500;
  color: #444;
  border-radius: 6px;
  padding: .4rem .7rem;
  transition: color .15s, background .15s;
}
.t4s-navbar .nav-link:hover,
.t4s-navbar .nav-link:focus {
  color: var(--brand-primary);
  background: rgba(140,191,68,.08);
}
.t4s-navbar .nav-link.active {
  color: var(--brand-primary) !important;
  font-weight: 600;
}
.t4s-navbar .dropdown-item:hover,
.t4s-navbar .dropdown-item:focus {
  background: rgba(140,191,68,.08);
  color: var(--brand-dark);
}
.t4s-navbar .dropdown-item.active,
.t4s-navbar .dropdown-item:active {
  background: var(--brand-primary);
  color: #fff;
}
.t4s-navbar .navbar-toggler {
  border-color: #ddd;
}
.t4s-navbar .navbar-toggler:focus {
  box-shadow: 0 0 0 .15rem rgba(140,191,68,.25);
}
.t4s-navbar .navbar-brand img {
  max-height: 36px;
}
.impersonation-bar {
  background: #fff3cd;
  border-bottom: 2px solid #ffc107;
  padding: 4px 16px;
  font-size: .85rem;
}

/*  Cards  */
.card {
  border: 0;
  border-radius: .75rem;
  box-shadow: 0 1px 6px rgba(0,0,0,.07);
}
.card-header {
  background-color: #f9fafb;
  border-bottom: 1px solid #eaecef;
  font-weight: 600;
  border-radius: .75rem .75rem 0 0 !important;
}

/*  Tables  */
.table th {
  font-weight: 600;
  white-space: nowrap;
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: #666;
}
.table td.text-truncate { max-width: 260px; }

/*  Status badges  */
.badge.status-pending     { background-color: #6c757d; }
.badge.status-in_progress { background-color: #0dcaf0; color: #000; }
.badge.status-passed      { background-color: #198754; }
.badge.status-failed      { background-color: #dc3545; }
.badge.status-overdue     { background-color: #fd7e14; }

/*  Flash messages  */
.flash-container {
  position: fixed;
  top: 70px; right: 20px;
  z-index: 1080;
  min-width: 280px;
  max-width: 400px;
}

/*  Section headings  */
h1, h2, h3 { font-weight: 700; }
h2 { font-size: 1.5rem; }

/*  Dashboard stat tiles  */
.stat-tile {
  border-radius: 14px;
  padding: 1.4rem 1.6rem;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
  border: 0;
  transition: transform .15s, box-shadow .15s;
}
.stat-tile:hover { transform: translateY(-2px); box-shadow: 0 4px 18px rgba(0,0,0,.1); }
.stat-tile .stat-num { font-size: 2rem; font-weight: 800; color: var(--brand-primary); }
.stat-tile .stat-lbl { font-size: .8rem; color: #888; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }

/*  Training content blocks  */
.content-block {
  border: 1px solid #dee2e6;
  border-radius: .5rem;
  padding: 1rem;
  margin-bottom: 1rem;
  background: #fff;
}
.content-block[data-type="text"]  { border-left: 4px solid var(--brand-primary); }
.content-block[data-type="video"] { border-left: 4px solid #0dcaf0; }
.content-block[data-type="pdf"]   { border-left: 4px solid #dc3545; }
.content-block[data-type="image"] { border-left: 4px solid #fd7e14; }
.content-block[data-type="link"]  { border-left: 4px solid #198754; }

/*  Certificate  */
@media print {
  nav, footer, .btn, .no-print { display: none !important; }
  .certificate-container { width: 100%; border: none; box-shadow: none; }
}
.certificate-container {
  max-width: 800px;
  margin: 2rem auto;
  background: #fff;
  border: 2px solid var(--brand-primary);
  border-radius: .5rem;
  padding: 3rem;
  text-align: center;
}
.certificate-title {
  font-size: 2rem; font-weight: 700;
  color: var(--brand-primary);
  margin-bottom: .5rem;
}
.certificate-subtitle { font-size: 1.1rem; color: #666; margin-bottom: 2rem; }
.certificate-name {
  font-size: 1.6rem; font-weight: 600;
  border-bottom: 2px solid #dee2e6;
  display: inline-block;
  padding-bottom: .3rem;
  margin-bottom: 1.5rem;
}
.certificate-footer { margin-top: 2rem; font-size: .8rem; color: #aaa; }

/*  Quiz  */
.quiz-question {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: .4rem;
  padding: 1.25rem;
  margin-bottom: 1.2rem;
}
.quiz-question h6 { font-weight: 600; margin-bottom: .8rem; }

/*  Org page inline forms  */
.org-add-form input { max-width: 260px; }

/*  Pagination  */
.pagination { flex-wrap: wrap; }

/*  Responsive  */
@media (max-width: 576px) {
  .table-responsive td, .table-responsive th { font-size: .8rem; }
  h2 { font-size: 1.25rem; }
}

/* ── Cookie Banner (DSGVO / TTDSG) ─────────────────────────── */
.cookie-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 99999;
  display: grid;
  place-items: end center;
  backdrop-filter: blur(2px);
}
.cookie-banner {
  width: 100%;
  background: #fff;
  border-top: 3px solid var(--t4s-primary, #8cbf44);
  box-shadow: 0 -8px 32px rgba(0,0,0,.15);
  max-height: 90vh;
  overflow-y: auto;
}
.cookie-details {
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 1rem;
  background: #f8f9fa;
}
.cookie-category {
  padding: .75rem;
  border-bottom: 1px solid #e9ecef;
}
.cookie-category:last-child { border-bottom: none; }
.cookie-category .form-check-input:checked {
  background-color: var(--t4s-primary, #8cbf44);
  border-color: var(--t4s-primary, #8cbf44);
}
.cookie-category .form-check-input:disabled:checked {
  background-color: #adb5bd;
  border-color: #adb5bd;
  opacity: .7;
}