/* Modern Cookie Banner Styles */
.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 9999;
  background: #fff;
  border-top: 1px solid #e5e5e5;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  transform: translateY(100%);
  transition: transform 0.3s ease-in-out;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.cookie-banner--top {
  top: 0;
  bottom: auto;
  border-top: none;
  border-bottom: 1px solid #e5e5e5;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transform: translateY(-100%);
}

.cookie-banner--visible {
  transform: translateY(0);
}

.cookie-banner--dark {
  background: #1a1a1a;
  border-color: #333;
  color: #fff;
}

.cookie-banner__content {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.cookie-banner__header {
  flex: 1;
}

.cookie-banner__title {
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.cookie-banner--dark .cookie-banner__title {
  color: #fff;
}

.cookie-banner__description {
  margin: 0;
  font-size: 14px;
  color: #666;
  line-height: 1.5;
}

.cookie-banner--dark .cookie-banner__description {
  color: #ccc;
}

.cookie-banner__link {
  color: #007bff;
  text-decoration: none;
  font-weight: 500;
}

.cookie-banner__link:hover {
  text-decoration: underline;
}

.cookie-banner__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.cookie-banner__btn {
  padding: 10px 16px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
}

.cookie-banner__btn--primary {
  background: #007bff;
  border-color: #007bff;
  color: #fff;
}

.cookie-banner__btn--primary:hover {
  background: #0056b3;
  border-color: #0056b3;
}

.cookie-banner__btn--secondary {
  background: #fff;
  border-color: #6c757d;
  color: #6c757d;
}

.cookie-banner__btn--secondary:hover {
  background: #f8f9fa;
  border-color: #495057;
  color: #495057;
}

.cookie-banner__btn--link {
  background: none;
  border: none;
  color: #007bff;
  min-width: auto;
  padding: 8px 12px;
}

.cookie-banner__btn--link:hover {
  background: #f8f9fa;
  color: #0056b3;
}

.cookie-banner--dark .cookie-banner__btn--secondary {
  background: #2a2a2a;
  border-color: #555;
  color: #ccc;
}

.cookie-banner--dark .cookie-banner__btn--secondary:hover {
  background: #3a3a3a;
  border-color: #666;
  color: #fff;
}

.cookie-banner__close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.cookie-banner__close:hover {
  background: #f0f0f0;
  color: #333;
}

.cookie-banner--dark .cookie-banner__close {
  color: #ccc;
}

.cookie-banner--dark .cookie-banner__close:hover {
  background: #333;
  color: #fff;
}

/* Cookie Modal */
.cookie-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.cookie-modal--visible {
  opacity: 1;
  visibility: visible;
}

.cookie-modal__content {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.cookie-modal--visible .cookie-modal__content {
  transform: scale(1);
}

.cookie-modal--dark .cookie-modal__content {
  background: #1a1a1a;
  color: #fff;
}

.cookie-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 24px 0 24px;
  border-bottom: 1px solid #e5e5e5;
  margin-bottom: 24px;
}

.cookie-modal--dark .cookie-modal__header {
  border-bottom-color: #333;
}

.cookie-modal__title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #333;
}

.cookie-modal--dark .cookie-modal__title {
  color: #fff;
}

.cookie-modal__close {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.cookie-modal__close:hover {
  background: #f0f0f0;
  color: #333;
}

.cookie-modal--dark .cookie-modal__close {
  color: #ccc;
}

.cookie-modal--dark .cookie-modal__close:hover {
  background: #333;
  color: #fff;
}

.cookie-modal__body {
  padding: 0 24px;
}

.cookie-modal__description {
  margin: 0 0 24px 0;
  font-size: 14px;
  color: #666;
  line-height: 1.5;
}

.cookie-modal--dark .cookie-modal__description {
  color: #ccc;
}

.cookie-modal__preferences {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cookie-preference {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  background: #f8f9fa;
  border-radius: 8px;
}

.cookie-modal--dark .cookie-preference {
  background: #2a2a2a;
}

.cookie-preference__info {
  flex: 1;
}

.cookie-preference__title {
  margin: 0 0 4px 0;
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.cookie-modal--dark .cookie-preference__title {
  color: #fff;
}

.cookie-preference__description {
  margin: 0;
  font-size: 13px;
  color: #666;
  line-height: 1.4;
}

.cookie-modal--dark .cookie-preference__description {
  color: #ccc;
}

.cookie-preference__toggle {
  flex-shrink: 0;
}

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

.toggle-label {
  display: block;
  width: 44px;
  height: 24px;
  background: #ccc;
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  transition: background 0.3s ease;
}

.toggle-label:hover {
  background: #bbb;
}

.cookie-preference input[type="checkbox"]:checked + .toggle-label {
  background: #007bff;
}

.cookie-preference input[type="checkbox"]:checked + .toggle-label:hover {
  background: #0056b3;
}

.cookie-preference input[type="checkbox"]:disabled + .toggle-label {
  background: #007bff;
  opacity: 0.6;
  cursor: not-allowed;
}

.toggle-slider {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

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

.cookie-modal__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 24px;
  border-top: 1px solid #e5e5e5;
  margin-top: 24px;
}

.cookie-modal--dark .cookie-modal__footer {
  border-top-color: #333;
}

.cookie-modal__btn {
  padding: 12px 20px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 120px;
}

.cookie-modal__btn--primary {
  background: #007bff;
  border-color: #007bff;
  color: #fff;
}

.cookie-modal__btn--primary:hover {
  background: #0056b3;
  border-color: #0056b3;
}

.cookie-modal__btn--secondary {
  background: #fff;
  border-color: #6c757d;
  color: #6c757d;
}

.cookie-modal__btn--secondary:hover {
  background: #f8f9fa;
  border-color: #495057;
  color: #495057;
}

.cookie-modal--dark .cookie-modal__btn--secondary {
  background: #2a2a2a;
  border-color: #555;
  color: #ccc;
}

.cookie-modal--dark .cookie-modal__btn--secondary:hover {
  background: #3a3a3a;
  border-color: #666;
  color: #fff;
}

/* Cookie Backdrop */
.cookie-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.cookie-backdrop--visible {
  opacity: 1;
  visibility: visible;
}

/* Responsive Design */
@media (max-width: 768px) {
  .cookie-banner__content {
    flex-direction: column;
    gap: 16px;
    padding: 16px;
  }
  
  .cookie-banner__actions {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .cookie-banner__btn {
    min-width: 100px;
    padding: 8px 12px;
    font-size: 13px;
  }
  
  .cookie-modal__content {
    width: 95%;
    margin: 20px;
  }
  
  .cookie-modal__header {
    padding: 20px 20px 0 20px;
  }
  
  .cookie-modal__body {
    padding: 0 20px;
  }
  
  .cookie-modal__footer {
    padding: 20px;
    flex-direction: column;
  }
  
  .cookie-modal__btn {
    width: 100%;
    min-width: auto;
  }
  
  .cookie-preference {
    flex-direction: column;
    gap: 12px;
  }
  
  .cookie-preference__toggle {
    align-self: flex-end;
  }
}

@media (max-width: 480px) {
  .cookie-banner__actions {
    flex-direction: column;
    width: 100%;
  }
  
  .cookie-banner__btn {
    width: 100%;
    min-width: auto;
  }
}

/* Focus styles for accessibility */
.cookie-banner__btn:focus,
.cookie-modal__btn:focus,
.cookie-banner__close:focus,
.cookie-modal__close:focus {
  outline: 2px solid #007bff;
  outline-offset: 2px;
}

.toggle-label:focus {
  outline: 2px solid #007bff;
  outline-offset: 2px;
}

/* Animation for smooth transitions */
@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

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

.cookie-banner--visible.cookie-banner--bottom {
  animation: slideUp 0.3s ease-out;
}

.cookie-banner--visible.cookie-banner--top {
  animation: slideDown 0.3s ease-out;
}

/* Print styles */
@media print {
  .cookie-banner,
  .cookie-modal,
  .cookie-backdrop {
    display: none !important;
  }
}
