/* DSGVO Cookie Consent Management Platform - MWB Finanzmakler */
/* Responsive, accessible, neutral design without dark patterns */

.cmp-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.3s ease-in-out;
}

.cmp-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 2px solid #e2e8f0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  z-index: 9999;
  padding: 1.5rem;
  animation: slideUp 0.4s ease-out;
}

.cmp-dialog {
  background: white;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: scaleIn 0.3s ease-out;
}

.cmp-header {
  padding: 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  position: relative;
}

.cmp-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0;
  padding-right: 2rem;
}

.cmp-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #64748b;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.cmp-close:hover,
.cmp-close:focus {
  background-color: #f1f5f9;
  color: #334155;
  outline: 2px solid #0ea5e9;
}

.cmp-content {
  padding: 1.5rem;
}

.cmp-text {
  color: #475569;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.cmp-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.cmp-button {
  padding: 0.75rem 1.5rem;
  border: 2px solid #e2e8f0;
  background: white;
  color: #374151;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 44px; /* WCAG touch target size */
  position: relative;
}

/* Equal prominence for all buttons - no green/red nudging */
.cmp-button:hover,
.cmp-button:focus {
  border-color: #0ea5e9;
  background-color: #f0f9ff;
  color: #0c4a6e;
  outline: 2px solid transparent;
  box-shadow: 0 0 0 2px #0ea5e9;
}

.cmp-button:active {
  transform: translateY(1px);
}

.cmp-categories {
  margin-top: 1.5rem;
}

.cmp-category {
  margin-bottom: 1.5rem;
  padding: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

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

.cmp-category-title {
  font-weight: 600;
  color: #1e293b;
  font-size: 1rem;
}

.cmp-toggle {
  position: relative;
  width: 48px;
  height: 24px;
  background-color: #cbd5e1;
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border: none;
  outline: none;
}

.cmp-toggle:focus {
  box-shadow: 0 0 0 2px #0ea5e9;
}

.cmp-toggle.active {
  background-color: #0ea5e9;
}

.cmp-toggle.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.cmp-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.cmp-toggle.active::after {
  transform: translateX(24px);
}

.cmp-category-description {
  color: #64748b;
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.cmp-vendors {
  font-size: 0.85rem;
  color: #64748b;
}

.cmp-vendor-link {
  color: #0ea5e9;
  text-decoration: underline;
  margin: 0 0.25rem;
}

.cmp-vendor-link:hover,
.cmp-vendor-link:focus {
  color: #0284c7;
}

/* Withdrawal button - persistent on every page */
.cmp-withdrawal {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  background: white;
  border: 2px solid #e2e8f0;
  color: #475569;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  transition: all 0.2s ease;
}

.cmp-withdrawal:hover,
.cmp-withdrawal:focus {
  border-color: #0ea5e9;
  background-color: #f0f9ff;
  color: #0c4a6e;
  outline: 2px solid transparent;
  box-shadow: 0 0 0 2px #0ea5e9, 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Responsive design */
@media (max-width: 768px) {
  .cmp-banner {
    padding: 1rem;
  }
  
  .cmp-dialog {
    margin: 0.5rem;
    max-height: 95vh;
  }
  
  .cmp-buttons {
    flex-direction: column;
  }
  
  .cmp-button {
    width: 100%;
  }
  
  .cmp-category-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .cmp-withdrawal {
    left: 0.5rem;
    bottom: 0.5rem;
    right: 0.5rem;
    text-align: center;
  }
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes scaleIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Focus management for accessibility */
.cmp-banner:focus,
.cmp-dialog:focus {
  outline: none;
}

/* Screen reader only text */
.cmp-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;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .cmp-button,
  .cmp-toggle,
  .cmp-withdrawal {
    border-width: 3px;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .cmp-overlay,
  .cmp-banner,
  .cmp-dialog,
  .cmp-button,
  .cmp-toggle,
  .cmp-withdrawal {
    animation: none;
    transition: none;
  }
}

/* Print styles - hide consent UI when printing */
@media print {
  .cmp-overlay,
  .cmp-banner,
  .cmp-dialog,
  .cmp-withdrawal {
    display: none !important;
  }
}