/* Global Styles & Overrides */
body {
  background-color: #020617;
  color: #f8fafc;
  /* Fallback auf System Fonts für maximale Performance & Privacy */
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue',
    Arial, sans-serif;
  overscroll-behavior-y: none;
}

/* Accordion Transitions */
.topic-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s ease-out, opacity 0.3s ease;
  opacity: 0;
  overflow: hidden;
}
.topic-body.open {
  grid-template-rows: 1fr;
  opacity: 1;
  border-top: 1px solid #1e293b;
}
.topic-content {
  min-height: 0;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #020617;
}
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #334155;
}

/* Checkbox Animation */
.checkbox-wrapper input:checked + div {
  background-color: #0ea5e9;
  border-color: #0ea5e9;
}
.checkbox-wrapper input:checked + div svg {
  transform: scale(1);
}

/* Header Blur */
.glass-header {
  background: rgba(2, 6, 23, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid #1e293b;
}

/* Streak Calendar */
.streak-cell {
  transition: all 0.2s ease;
}
.streak-cell:hover {
  transform: scale(1.2);
  z-index: 10;
  box-shadow: 0 0 8px rgba(14, 165, 233, 0.6);
}

/* Utility Classes */
.force-hide {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Micro-Animations */
@keyframes dice-soft-tumble {
  0% {
    transform: rotate(0deg) scale(1);
  }
  25% {
    transform: rotate(-5deg) scale(1.05);
  }
  50% {
    transform: rotate(5deg) scale(1.05);
  }
  75% {
    transform: rotate(-2deg) scale(1.02);
  }
  100% {
    transform: rotate(0deg) scale(1);
  }
}
.group:hover .animate-dice-hover {
  animation: dice-soft-tumble 0.4s cubic-bezier(0.45, 0.05, 0.55, 0.95) forwards;
}

@keyframes focus-soft-snap {
  0% {
    transform: scale(1) rotate(0deg);
  }
  40% {
    transform: scale(1.1) rotate(5deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}
.group:hover .animate-focus-hover {
  animation: focus-soft-snap 0.3s ease-out forwards;
  filter: drop-shadow(0 0 4px rgba(16, 185, 129, 0.4));
}

/* Print Styles */
@media print {
  body {
    background-color: white;
    color: black;
  }
  .no-print {
    display: none !important;
  }
  .topic-card {
    border: 1px solid #ccc;
    break-inside: avoid;
    margin-bottom: 10px;
    color: black;
    background: white;
    box-shadow: none;
  }
  .topic-title {
    color: black !important;
  }
  .topic-body {
    display: block !important;
    opacity: 1 !important;
    grid-template-rows: 1fr !important;
  }
  .topic-content {
    padding: 10px !important;
  }
}

/* Premium Lernzettel Styles */
.lz-details {
  border: 1px solid #1e293b;
  border-radius: 0.75rem;
  background-color: #0f172a;
  overflow: hidden;
  transition: all 0.2s ease;
}
.lz-details[open] {
  border-color: rgba(139, 92, 246, 0.4);
  background-color: #020617;
}
.lz-details summary {
  padding: 1rem;
  font-weight: bold;
  cursor: pointer;
  list-style: none; /* remove default arrow */
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.lz-details summary::-webkit-details-marker {
  display: none;
}
.lz-details summary::after {
  content: '\f078';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  transition: transform 0.2s ease;
  color: #64748b;
}
.lz-details[open] summary::after {
  transform: rotate(180deg);
  color: #8b5cf6;
}
.lz-details .lz-content {
  padding: 0 1rem 1rem 1rem;
  color: #cbd5e1;
  font-size: 0.875rem;
  border-top: 1px solid #1e293b;
  margin-top: 0.5rem;
  padding-top: 1rem;
}
