/* ===== RENDITEFREUNDE AFTERSALES — Design System ===== */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600;700&family=DM+Mono:wght@400;500&family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
  --bg: #f5f0e8;
  --bg2: #ffffff;
  --bg3: #eee9df;
  --bg4: #e8e2d6;
  --gold: #c9a84c;
  --gold2: #e2c476;
  --gold-dark: #9a7a34;
  --gold-subtle: rgba(201,168,76,0.10);
  --gold-border: rgba(201,168,76,0.30);
  --text: #1a1714;
  --text2: #7a6858;
  --text3: #b0a090;
  --green: #27ae60;
  --red: #c0392b;
  --border: rgba(26,23,20,0.09);
  --border2: rgba(26,23,20,0.14);
  --radius: 10px;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'DM Mono', monospace;
  --shadow: 0 2px 4px rgba(0,0,0,0.04), 0 10px 20px rgba(201,168,76,0.06);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

/* ===== HEADER ===== */
.header {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text);
}

.header-logo svg { flex-shrink: 0; }

.header-logo span {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
}

.header-progress {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--text2);
}

.header-progress .progress-text {
  font-family: var(--font-mono);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.progress-bar-wrap {
  width: 120px;
  height: 6px;
  background: var(--bg3);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* ===== MAIN ===== */
.main { flex: 1; padding: 2rem; max-width: 1200px; margin: 0 auto; width: 100%; }

/* ===== WELCOME ===== */
.welcome {
  text-align: center;
  margin-bottom: 2.5rem;
}

.welcome h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.welcome p {
  color: var(--text2);
  font-size: 1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* ===== CATEGORY SECTIONS ===== */
.category-section { margin-bottom: 2.5rem; }

.category-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--gold-border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.category-title .cat-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
}

/* ===== VIDEO CARDS ===== */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.video-card {
  background: var(--bg2);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  position: relative;
}

.video-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06), 0 16px 32px rgba(201,168,76,0.10);
  border-color: var(--gold-border);
}

.video-card.completed { border-color: var(--green); }

.video-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-thumb .play-icon {
  position: absolute;
  width: 56px;
  height: 56px;
  background: rgba(201,168,76,0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background 0.2s;
}

.video-card:hover .play-icon {
  transform: scale(1.1);
  background: var(--gold);
}

.play-icon svg { width: 24px; height: 24px; fill: #fff; margin-left: 3px; }

.video-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: var(--green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(39,174,96,0.3);
}

.video-info { padding: 1rem; }

.video-info h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.video-info p {
  font-size: 0.85rem;
  color: var(--text2);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-progress-bar {
  height: 3px;
  background: var(--bg3);
}

.video-progress-bar .fill {
  height: 100%;
  background: var(--gold);
  transition: width 0.3s;
}

/* ===== VIDEO PLAYER VIEW ===== */
.player-view { display: none; }
.player-view.active { display: block; }
.overview-view.hidden { display: none; }

.player-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--gold);
  font-weight: 500;
  text-decoration: none;
  margin-bottom: 1.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  transition: color 0.15s;
}

.player-back:hover { color: var(--gold-dark); }

.player-container {
  background: var(--bg2);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.player-embed {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
}

.player-embed iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.player-meta { padding: 1.5rem; }

.player-meta h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.player-meta p { color: var(--text2); line-height: 1.6; }

.player-nav {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  text-decoration: none;
}

.btn-gold {
  background: var(--gold);
  color: #fff;
}

.btn-gold:hover { background: var(--gold2); }

.btn-sec {
  background: var(--bg3);
  color: var(--text);
}

.btn-sec:hover { background: var(--bg4); }

/* ===== ERROR VIEW ===== */
.error-view {
  display: none;
  text-align: center;
  padding: 4rem 2rem;
}

.error-view.active { display: block; }

.error-icon {
  width: 80px;
  height: 80px;
  background: var(--gold-subtle);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  color: var(--gold);
  font-size: 2rem;
}

.error-view h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  margin-bottom: 0.75rem;
}

.error-view p {
  color: var(--text2);
  max-width: 400px;
  margin: 0 auto;
}

/* ===== LOADING ===== */
.loading-view {
  text-align: center;
  padding: 6rem 2rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--bg3);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-view p { color: var(--text2); }

/* ===== FOOTER ===== */
.footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text3);
  margin-top: auto;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: var(--text2);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-links a:hover { color: var(--gold); }

.footer-company { font-size: 0.75rem; color: var(--text3); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .header { padding: 0.75rem 1rem; }
  .header-logo span { font-size: 1.2rem; }
  .main { padding: 1.25rem; }
  .welcome h1 { font-size: 1.5rem; }
  .video-grid { grid-template-columns: 1fr; }
  .player-meta h2 { font-size: 1.3rem; }
  .player-nav { flex-direction: column; }
}

@media (max-width: 480px) {
  .header { padding: 0.5rem 0.75rem; }
  .header-logo span { font-size: 1rem; }
  .header-progress { flex-direction: column; gap: 0.25rem; align-items: flex-end; }
  .progress-bar-wrap { width: 80px; }
  .welcome h1 { font-size: 1.3rem; }
}
