/**
 * Cookie Consent Banner Styles
 * GDPR/DSGVO-compliant design
 */

/* Overlay */
.cookie-consent-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9998;
  animation: fadeIn 0.3s ease-out;
}

/* Modal Container */
.cookie-consent-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

/* Header */
.cookie-consent-header {
  padding: 24px 24px 16px;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.cookie-consent-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  color: #1f2937;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Body */
.cookie-consent-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.cookie-intro {
  margin: 0 0 24px;
  font-size: 15px;
  line-height: 1.6;
  color: #4b5563;
}

/* Cookie Categories */
.cookie-categories {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

.cookie-category {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.cookie-category:hover {
  border-color: #d1d5db;
}

.cookie-category-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: #f9fafb;
}

.cookie-category-info {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cookie-category-info h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.required-badge {
  display: inline-block;
  padding: 2px 8px;
  background: #dbeafe;
  color: #1e40af;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Toggle Switch */
.cookie-toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  cursor: pointer;
}

.cookie-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.cookie-toggle-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #d1d5db;
  border-radius: 26px;
  transition: 0.3s;
}

.cookie-toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.3s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cookie-toggle input:checked + .cookie-toggle-slider {
  background-color: #6366f1;
}

.cookie-toggle input:checked + .cookie-toggle-slider:before {
  transform: translateX(22px);
}

.cookie-toggle input:disabled + .cookie-toggle-slider {
  background-color: #9ca3af;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Details Toggle Button */
.cookie-details-toggle {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: #6b7280;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.cookie-details-toggle:hover {
  background: #e5e7eb;
  color: #1f2937;
}

.cookie-details-toggle svg {
  transition: transform 0.2s;
}

.cookie-details-toggle.open svg {
  transform: rotate(180deg);
}

/* Cookie Details */
.cookie-details {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out, padding 0.3s ease-out;
  padding: 0 16px;
  background: white;
}

.cookie-details.open {
  max-height: 500px;
  padding: 16px;
  border-top: 1px solid #e5e7eb;
}

.cookie-details p {
  margin: 0 0 12px;
  font-size: 14px;
  color: #6b7280;
  line-height: 1.5;
}

.cookie-details ul {
  margin: 0 0 12px;
  padding-left: 20px;
}

.cookie-details li {
  margin-bottom: 8px;
  font-size: 14px;
  color: #4b5563;
  line-height: 1.5;
}

.cookie-details li strong {
  color: #1f2937;
}

.cookie-note {
  font-size: 13px !important;
  color: #9ca3af !important;
  font-style: italic;
  margin-top: 12px;
}

/* Footer Info */
.cookie-footer-info {
  padding: 16px;
  background: #f3f4f6;
  border-radius: 8px;
  margin-top: 8px;
}

.cookie-footer-info p {
  margin: 0;
  font-size: 13px;
  color: #6b7280;
  line-height: 1.5;
}

.cookie-footer-info a {
  color: #6366f1;
  text-decoration: none;
  font-weight: 500;
}

.cookie-footer-info a:hover {
  text-decoration: underline;
}

/* Footer Buttons */
.cookie-consent-footer {
  padding: 16px 24px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  flex-shrink: 0;
  background: #f9fafb;
}

.cookie-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  flex: 1;
  min-width: 140px;
}

.cookie-btn-primary {
  background: #6366f1;
  color: white;
}

.cookie-btn-primary:hover {
  background: #4f46e5;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.cookie-btn-secondary {
  background: #10b981;
  color: white;
}

.cookie-btn-secondary:hover {
  background: #059669;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.cookie-btn-text {
  background: transparent;
  color: #6b7280;
  border: 1px solid #d1d5db;
}

.cookie-btn-text:hover {
  background: #f3f4f6;
  color: #1f2937;
  border-color: #9ca3af;
}

/* Cookie Settings Link (for footer) */
.cookie-settings-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  color: #4b5563;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
}

.cookie-settings-link:hover {
  background: #e5e7eb;
  color: #1f2937;
  border-color: #9ca3af;
}

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

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translate(-50%, -45%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

/* Mobile Responsive */
@media (max-width: 640px) {
  .cookie-consent-modal {
    width: 95%;
    max-height: 90vh;
    border-radius: 12px;
  }

  .cookie-consent-header {
    padding: 20px 16px 12px;
  }

  .cookie-consent-header h2 {
    font-size: 20px;
  }

  .cookie-consent-body {
    padding: 16px;
  }

  .cookie-intro {
    font-size: 14px;
  }

  .cookie-category-header {
    padding: 12px;
  }

  .cookie-category-info h3 {
    font-size: 15px;
  }

  .cookie-consent-footer {
    padding: 12px 16px;
    flex-direction: column;
  }

  .cookie-btn {
    width: 100%;
    min-width: auto;
  }

  .required-badge {
    font-size: 10px;
    padding: 2px 6px;
  }
}

/* Print - hide cookie banner */
@media print {
  #cookie-consent-banner {
    display: none !important;
  }
}

/* Accessibility */
.cookie-btn:focus,
.cookie-details-toggle:focus,
.cookie-toggle:focus-within {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .cookie-consent-overlay,
  .cookie-consent-modal,
  .cookie-toggle-slider,
  .cookie-toggle-slider:before,
  .cookie-details-toggle svg {
    animation: none;
    transition: none;
  }
}
