/**
 * GDPR Cookie Consent Banner Styles
 * Lightweight, accessible, and customizable
 */

/* Reset and base styles */
.gdpr-consent-banner *,
.gdpr-consent-modal * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Banner container */
.gdpr-consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  padding: 20px;
  z-index: 999999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #333;
  animation: slideUp 0.3s ease-out;
}

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

.gdpr-consent-banner.hidden {
  display: none;
}

/* Banner content */
.gdpr-banner-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.gdpr-banner-text {
  flex: 1;
  min-width: 250px;
}

.gdpr-banner-text h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #1a1a1a;
}

.gdpr-banner-text p {
  margin-bottom: 0;
  color: #555;
}

.gdpr-banner-text a {
  color: #0066cc;
  text-decoration: underline;
}

.gdpr-banner-text a:hover {
  color: #0052a3;
}

/* Button container */
.gdpr-banner-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Buttons */
.gdpr-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  white-space: nowrap;
}

.gdpr-btn:focus {
  outline: 2px solid #0066cc;
  outline-offset: 2px;
}

.gdpr-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.gdpr-btn-primary {
  background: #0066cc;
  color: white;
}

.gdpr-btn-primary:hover:not(:disabled) {
  background: #0052a3;
}

.gdpr-btn-secondary {
  background: #f0f0f0;
  color: #333;
  border: 1px solid #ddd;
}

.gdpr-btn-secondary:hover:not(:disabled) {
  background: #e0e0e0;
}

.gdpr-btn-tertiary {
  background: transparent;
  color: #0066cc;
  border: 1px solid #0066cc;
}

.gdpr-btn-tertiary:hover:not(:disabled) {
  background: #f0f7ff;
}

/* Modal overlay */
.gdpr-consent-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}

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

.gdpr-consent-modal-overlay.hidden {
  display: none;
}

/* Modal */
.gdpr-consent-modal {
  background: white;
  border-radius: 8px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  animation: modalSlideIn 0.3s ease-out;
}

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

/* Modal header */
.gdpr-modal-header {
  padding: 24px;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gdpr-modal-header h2 {
  font-size: 20px;
  font-weight: 600;
  color: #1a1a1a;
}

.gdpr-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #666;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.gdpr-modal-close:hover {
  background: #f0f0f0;
}

/* Modal content */
.gdpr-modal-content {
  padding: 24px;
}

.gdpr-modal-description {
  margin-bottom: 24px;
  color: #555;
  line-height: 1.6;
}

/* Category toggle */
.gdpr-category {
  margin-bottom: 16px;
  padding: 16px;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
}

.gdpr-category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.gdpr-category-title {
  font-weight: 600;
  font-size: 15px;
  color: #1a1a1a;
}

.gdpr-category-required {
  font-size: 12px;
  color: #666;
  font-style: italic;
}

.gdpr-category-description {
  font-size: 13px;
  color: #666;
  margin-top: 8px;
  line-height: 1.5;
}

/* Toggle switch */
.gdpr-toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
}

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

.gdpr-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 24px;
}

.gdpr-toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.gdpr-toggle input:checked + .gdpr-toggle-slider {
  background-color: #0066cc;
}

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

.gdpr-toggle input:disabled + .gdpr-toggle-slider {
  opacity: 0.5;
  cursor: not-allowed;
}

.gdpr-toggle input:focus + .gdpr-toggle-slider {
  box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.3);
}

/* Modal footer */
.gdpr-modal-footer {
  padding: 24px;
  border-top: 1px solid #e0e0e0;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* Settings button - absolute at bottom of page */
.gdpr-settings-button {
  position: absolute;
  bottom: 60px;
  left: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: #f8f9fa;
  color: #666;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 999998;
}

/* Ensure body has relative positioning for absolute child */
body {
  position: relative;
}

.gdpr-settings-button:hover {
  background: #e9ecef;
  border-color: #ced4da;
  color: #495057;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.gdpr-settings-button:focus {
  outline: 2px solid #0066cc;
  outline-offset: 2px;
}

.gdpr-settings-button.hidden {
  display: none;
}

/* Wrapper no longer needed with fixed positioning */
.gdpr-settings-wrapper {
  /* Empty - kept for compatibility */
}

/* Privacy Policy Modal - larger for long content */
.gdpr-privacy-modal {
  background: white;
  border-radius: 8px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  animation: modalSlideIn 0.3s ease-out;
}

.gdpr-privacy-modal .gdpr-modal-content {
  padding: 24px;
  max-height: calc(90vh - 100px);
  overflow-y: auto;
}

/* Privacy policy content styling */
.gdpr-privacy-content {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: #333;
}

.gdpr-privacy-content h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: #2c3e50;
  border-bottom: 3px solid #3498db;
  padding-bottom: 10px;
}

.gdpr-privacy-content h2 {
  font-size: 1.5rem;
  margin: 2rem 0 1rem;
  color: #2c3e50;
  border-left: 4px solid #3498db;
  padding-left: 15px;
}

.gdpr-privacy-content h3 {
  font-size: 1.2rem;
  margin: 1.5rem 0 1rem;
  color: #34495e;
}

.gdpr-privacy-content p {
  margin-bottom: 1rem;
  color: #555;
}

.gdpr-privacy-content ul,
.gdpr-privacy-content ol {
  margin: 1rem 0 1rem 2rem;
  color: #555;
}

.gdpr-privacy-content li {
  margin-bottom: 0.5rem;
}

.gdpr-privacy-content a {
  color: #3498db;
  text-decoration: none;
}

.gdpr-privacy-content a:hover {
  text-decoration: underline;
}

.gdpr-privacy-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

.gdpr-privacy-content th,
.gdpr-privacy-content td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.gdpr-privacy-content th {
  background: #f8f9fa;
  font-weight: 600;
  color: #2c3e50;
}

/* Responsive design */
@media (max-width: 768px) {
  .gdpr-consent-banner {
    padding: 16px;
  }

  .gdpr-banner-content {
    flex-direction: column;
    align-items: stretch;
  }

  .gdpr-banner-buttons {
    width: 100%;
  }

  .gdpr-btn {
    flex: 1;
    min-width: 0;
  }

  .gdpr-consent-modal,
  .gdpr-privacy-modal {
    margin: 10px;
  }

  .gdpr-modal-footer {
    flex-direction: column;
  }

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

  .gdpr-privacy-content h1 {
    font-size: 1.5rem;
  }

  .gdpr-privacy-content h2 {
    font-size: 1.2rem;
  }
}

/* Print styles - hide consent elements */
@media print {
  .gdpr-consent-banner,
  .gdpr-consent-modal-overlay,
  .gdpr-settings-button {
    display: none !important;
  }
}
