/**
 * Haupt-CSS-Datei für das Projekt
 * Importiert alle anderen CSS-Dateien in der richtigen Reihenfolge
 */

/* 1. Variablen zuerst laden */
@import url('variables.css');

/* 2. Kritische Styles für schnelles Rendering */
@import url('critical.css');

/* 3. Base Styles und Layout */
@import url('styles.css');

/* 4. Komponenten-spezifische Styles */
@import url('card-layout.css');
@import url('categories.css');
@import url('infinite-slider.css');
@import url('banner.css');
@import url('templates.css');

/* 5. Form-spezifische Styles */
@import url('responsive-forms.css');
@import url('login-modal.css');

/* 6. Responsive Images */
@import url('responsive-images.css');

/* 7. Utility Framework (falls verwendet) */
/* @import url('tailwind.min.css'); */

/**
 * Globale Überschreibungen und Fixes
 * Hier können projektspezifische Anpassungen vorgenommen werden
 */

/* Verbesserte Fokus-Sichtbarkeit für Barrierefreiheit */
*:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Smooth Scrolling für bessere UX */
html {
  scroll-behavior: smooth;
}

/* Verbesserte Textauswahl */
::selection {
  background-color: var(--primary-light);
  color: var(--white);
}

/* Print Styles */
@media print {
  * {
    background: transparent !important;
    color: black !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  .content-card {
    border: 1px solid #000;
    page-break-inside: avoid;
  }

  .no-print {
    display: none !important;
  }
}

/* Reduced Motion für Barrierefreiheit */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .content-card {
    border: 2px solid var(--text-primary);
  }

  .category-image {
    border: 2px solid var(--text-primary);
  }
}

/* Utility Classes für häufige Anwendungsfälle */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--primary-color);
  color: var(--white);
  padding: 8px;
  text-decoration: none;
  z-index: var(--z-tooltip);
}

.skip-link:focus {
  top: 6px;
}

/* Loading States */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--gray-300);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Favoriten Loading State */
.favorites-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  text-align: center;
  grid-column: 1 / -1;
  /* Spans all columns in grid */
}

.favorites-loading i {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 0.75rem;
  animation: spin 1s linear infinite;
}

.favorites-loading p {
  color: var(--gray-600);
  font-size: 0.875rem;
  margin: 0;
  font-weight: 500;
}

/* Favoriten Error State */
.favorites-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  text-align: center;
  grid-column: 1 / -1;
  /* Spans all columns in grid */
  color: var(--error-color, #dc2626);
  font-size: 0.875rem;
  font-weight: 500;
}

/* Favoriten Empty State */
.favorites-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  text-align: center;
  grid-column: 1 / -1;
  /* Spans all columns in grid */
  color: var(--gray-500, #6b7280);
  font-size: 0.875rem;
  font-weight: 500;
}

/* Aspect Ratio Utilities */
.aspect-square {
  aspect-ratio: 1 / 1;
}

/* Fallback für ältere Browser */
@supports not (aspect-ratio: 1 / 1) {
  .aspect-square {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 100%;
  }

  .aspect-square>* {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }
}

/* Thumbnail-Größe für Hintergrundbilder */
.background-thumbnail {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  margin: 0 auto;
  display: block;
}

@media (min-width: 640px) {
  .background-thumbnail {
    width: 100px;
    height: 100px;
  }
}

@media (min-width: 768px) {
  .background-thumbnail {
    width: 120px;
    height: 120px;
  }
}

/* Toast Notification Styles */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 400px;
  pointer-events: none;
}

.toast {
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 250px;
  max-width: 100%;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
  pointer-events: auto;
  border-left: 4px solid #3b82f6;
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

.toast.success {
  border-left-color: #10b981;
  background-color: #f0fdf4;
  color: #166534;
}

.toast.error {
  border-left-color: #ef4444;
  background-color: #fef2f2;
  color: #dc2626;
}

.toast.warning {
  border-left-color: #f59e0b;
  background-color: #fffbeb;
  color: #d97706;
}

.toast.info {
  border-left-color: #3b82f6;
  background-color: #eff6ff;
  color: #1d4ed8;
}

.toast-content {
  display: flex;
  align-items: center;
  flex: 1;
}

.toast-content i {
  margin-right: 8px;
  font-size: 16px;
}

.toast-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin-left: 8px;
  border-radius: 4px;
  transition: background-color 0.2s;
  color: inherit;
}

.toast-close:hover {
  background-color: rgba(0, 0, 0, 0.1);
}

/* Mobile Responsive */
@media (max-width: 640px) {
  #toast-container {
    bottom: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
  }

  .toast {
    min-width: auto;
    width: 100%;
  }
}

/* Animation für Toast-Einblendung */
@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastSlideOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }

  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

#cookie-consent-modal,
#share-modal {
  z-index: 60;
}

#share-modal-content {
  max-height: calc(100vh - 80px);
  overflow-y: auto;
}

@media (max-width: 480px) {
  #share-modal-content {
    padding: 1.25rem;
    max-width: 100%;
    margin-left: 12px;
    margin-right: 12px;
  }
}

/* ============================================
   TAGS WRAPPING - Erlaubt Tags auf mehrere Zeilen
   ============================================ */

/* Tags können umbrechen */
.content-card .flex.flex-wrap.gap-2.justify-center {
  max-width: 100%;
  flex-wrap: wrap !important;
}

/* Mobile-spezifische Anpassungen für Tags */
@media (max-width: 640px) {

  /* Kleinere Schrift und Padding für Tags auf Mobile */
  .spruch-tag {
    font-size: 0.6875rem !important;
    padding: 0.2rem 0.4rem !important;
  }

  /* Kartenbreite begrenzen */
  .content-card {
    max-width: 100vw;
    overflow: hidden;
  }
}

/* Modal Helpers to override utility conflicts */
.modal-hidden {
  display: none !important;
}

.modal-flex {
  display: flex !important;
}

/* 
   UI Preference: Compact Tag Layout
   Tag lists within content cards (e.g. spruch items) should be compact 
   and mimic mobile layout on desktop (max-w-md mx-auto) to force wrapping.
   Index pages (tags.html) remain full width.
*/

/* For detail pages where tags are in the footer */
.content-card footer .flex.flex-wrap,
/* For list items where tags are in a tags-section */
.content-card .tags-section .flex.flex-wrap {
  max-width: 28rem !important;
  /* max-w-md */
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Cookie-Zahnrad nach oben schieben */
.ccm-settings-summoner {
  bottom: 110px !important;
}