/* Cookie Consent Banner & Modal Styles */

/* Cookie Banner */
#cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, var(--primary) 0%, #152a4a 100%);
  color: var(--white);
  padding: 1.5rem;
  box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.2);
  z-index: 10000;
  transform: translateY(100%);
  animation: slideUpBanner 0.5s ease-out forwards;
}

@keyframes slideUpBanner {
  to {
    transform: translateY(0);
  }
}

.cookie-banner-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  text-align: left;
}

.cookie-banner-text {
  flex: 1;
}

.cookie-banner-text h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.2rem;
  color: var(--white);
  text-align: left;
}

.cookie-banner-text p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.4;
  opacity: 0.95;
  text-align: left;
}

.cookie-banner-buttons {
  display: flex;
  gap: 1rem;
  flex-shrink: 0;
  align-items: center;
}

.cookie-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  white-space: nowrap;
  /* Accessibility: Mindest-Touch-Target-Größe */
  min-height: 44px;
}

.cookie-btn-primary {
  background: var(--accent);
  color: #000000; /* Schwarz für besseren Kontrast auf gelbem Hintergrund */
  font-weight: 700; /* Fetter für bessere Lesbarkeit */
}

.cookie-btn-primary:hover {
  background: #e6a700;
  color: #000000;
  transform: translateY(-1px);
}

.cookie-btn-secondary {
  background: #ffffff; /* Weißer Hintergrund für besseren Kontrast */
  color: #1a4e8a; /* Dunkelblaue Schrift für optimalen Kontrast */
  border: 2px solid #1a4e8a; /* Kontrastreicherer Rand */
  font-weight: 600;
}

.cookie-btn-secondary:hover {
  background: #f8f9fa;
  color: #1a4e8a;
  border-color: #0d2a4a;
}

.cookie-btn-link {
  background: transparent;
  color: #ffffff; /* Weiß bleibt gut auf dunklem Hintergrund */
  text-decoration: underline;
  padding: 0.75rem 1rem;
  font-weight: 600;
  /* Kein aufdringlicher Fokus-Indikator */
  outline: none;
}

.cookie-btn-link:hover {
  color: var(--accent);
  text-decoration: none;
}

.cookie-btn-link:focus {
  /* Subtile Fokus-Anzeige ohne gelben Kasten */
  opacity: 0.8;
}

/* Cookie Modal */
#cookie-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  box-sizing: border-box;
}

.cookie-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: inherit;
}

.cookie-modal-content {
  background: var(--white);
  border-radius: 12px;
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow: hidden;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUpModal 0.3s ease-out;
  margin: auto;
  z-index: 1;
}

@keyframes slideUpModal {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cookie-modal-header {
  padding: 2rem 2rem 1rem;
  border-bottom: 1px solid var(--light-gray);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cookie-modal-header h2 {
  margin: 0;
  color: var(--primary);
  font-size: 1.5rem;
}

.cookie-close-btn {
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: var(--secondary);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.cookie-close-btn:hover {
  background: var(--light-gray);
  color: var(--primary);
}

.cookie-modal-body {
  padding: 1.5rem 2rem;
  max-height: 60vh;
  overflow-y: auto;
}

.cookie-category {
  margin-bottom: 2rem;
  padding: 1.5rem;
  border: 1px solid var(--light-gray);
  border-radius: 8px;
  background: #fafafa;
}

.cookie-category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.cookie-category h3 {
  margin: 0;
  color: var(--primary);
  font-size: 1.1rem;
}

/* Custom Toggle Switch */
.cookie-toggle {
  position: relative;
}

.cookie-toggle input[type="checkbox"] {
  display: none;
}

.cookie-toggle label {
  display: block;
  width: 50px;
  height: 26px;
  background: #ccc;
  border-radius: 13px;
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
}

.cookie-toggle label::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  background: var(--white);
  border-radius: 50%;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.cookie-toggle input[type="checkbox"]:checked + label {
  background: var(--accent);
}

.cookie-toggle input[type="checkbox"]:checked + label::after {
  transform: translateX(24px);
}

.cookie-toggle input[type="checkbox"]:disabled + label {
  background: var(--primary);
  opacity: 0.7;
  cursor: not-allowed;
}

.cookie-category p {
  margin: 0 0 1rem 0;
  color: var(--secondary);
  line-height: 1.5;
}

.cookie-category details {
  margin-top: 1rem;
}

.cookie-category summary {
  cursor: pointer;
  color: var(--primary);
  font-weight: 600;
  padding: 0.5rem 0;
}

.cookie-category summary:hover {
  text-decoration: underline;
}

.cookie-category ul {
  margin: 1rem 0 0 1.5rem;
  padding: 0;
}

.cookie-category li {
  margin-bottom: 0.5rem;
  color: var(--secondary);
  font-size: 0.9rem;
}

.cookie-info {
  background: var(--light-gray);
  padding: 1.5rem;
  border-radius: 8px;
  margin-top: 1.5rem;
}

.cookie-info p {
  margin: 0 0 0.5rem 0;
  font-size: 0.9rem;
  color: var(--secondary);
}

.cookie-info p:last-child {
  margin-bottom: 0;
}

.cookie-info a {
  color: var(--primary);
  text-decoration: underline;
}

.cookie-modal-footer {
  padding: 1.5rem 2rem 2rem;
  border-top: 1px solid var(--light-gray);
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

/* Cookie Settings Link in Footer */
#cookie-settings-link {
  color: var(--white);
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.9rem;
}

#cookie-settings-link:hover {
  opacity: 0.8;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  #cookie-banner {
    padding: 1.25rem;
  }

  .cookie-banner-content {
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
    align-items: center;
  }

  .cookie-banner-text {
    width: 100%;
  }

  .cookie-banner-text h3,
  .cookie-banner-text p {
    text-align: center;
  }

  .cookie-banner-buttons {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
  }

  .cookie-btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.85rem;
    flex: 1;
    min-width: 120px;
  }

  #cookie-modal {
    padding: 1rem;
    align-items: center;
    justify-content: center;
  }

  .cookie-modal-content {
    max-height: 90vh;
    width: calc(100% - 2rem);
    max-width: 500px;
    margin: 0;
  }

  .cookie-modal-header {
    padding: 1.5rem 1.5rem 1rem;
  }

  .cookie-modal-header h2 {
    font-size: 1.3rem;
  }

  .cookie-modal-body {
    padding: 1rem 1.5rem;
  }

  .cookie-category {
    padding: 1rem;
  }

  .cookie-category-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .cookie-modal-footer {
    padding: 1rem 1.5rem;
    flex-direction: column;
  }

  .cookie-modal-footer .cookie-btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  #cookie-banner {
    padding: 1rem;
  }

  .cookie-banner-content {
    gap: 1rem;
  }

  .cookie-banner-text h3 {
    font-size: 1.1rem;
  }

  .cookie-banner-text p {
    font-size: 0.9rem;
  }

  .cookie-banner-buttons {
    flex-direction: column;
    width: 100%;
    gap: 0.5rem;
  }

  .cookie-btn {
    width: 100%;
    text-align: center;
    padding: 0.875rem 1rem;
    font-size: 0.9rem;
  }

  #cookie-modal {
    padding: 0.5rem;
  }

  .cookie-modal-content {
    width: calc(100% - 1rem);
    max-width: none;
    max-height: 95vh;
  }

  .cookie-modal-header {
    padding: 1rem;
  }

  .cookie-modal-body {
    padding: 1rem;
  }

  .cookie-category {
    padding: 0.75rem;
  }

  .cookie-modal-footer {
    padding: 1rem;
  }
}

/* Animation für Banner hide */
#cookie-banner.hiding {
  animation: slideDownBanner 0.3s ease-in forwards;
}

@keyframes slideDownBanner {
  to {
    transform: translateY(100%);
  }
}
