/**
 * GDPR Cookie Consent Banner Styles
 */

:root {
  --cookie-primary: #1e3a8a;
  --cookie-bg: #ffffff;
  --cookie-text: #374151;
  --cookie-border: #e5e7eb;
  --cookie-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  --cookie-radius: 12px;
  --cookie-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Banner Container */
.ap-cookie-consent {
  position: fixed;
  z-index: 999999;
  max-width: 100%;
  background: var(--cookie-bg);
  color: var(--cookie-text);
  box-shadow: var(--cookie-shadow);
  border-radius: var(--cookie-radius);
  padding: 1.5rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  animation: slideIn 0.4s ease-out;
}

/* Position Variants */
.ap-cookie-consent--bottom {
  bottom: 20px;
  left: 20px;
  right: 20px;
}

.ap-cookie-consent--top {
  top: 20px;
  left: 20px;
  right: 20px;
}

.ap-cookie-consent--popup {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 600px;
  animation: popIn 0.4s ease-out;
}

/* Layout Variants */
.ap-cookie-consent--bar .ap-cookie-consent__container {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.ap-cookie-consent--box .ap-cookie-consent__container {
  display: block;
}

.ap-cookie-consent--cloud {
  border-radius: 24px;
  padding: 2rem;
}

/* Content */
.ap-cookie-consent__content {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  flex: 1;
  min-width: 250px;
}

.ap-cookie-consent__icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cookie-primary);
  color: white;
  border-radius: 50%;
  opacity: 0.9;
}

.ap-cookie-consent__text {
  flex: 1;
}

.ap-cookie-consent__title {
  margin: 0 0 0.5rem;
  font-size: 16px;
  font-weight: 600;
  color: var(--cookie-text);
}

.ap-cookie-consent__message {
  margin: 0 0 0.75rem;
  color: #6b7280;
  font-size: 14px;
}

.ap-cookie-consent__privacy-link {
  color: var(--cookie-primary);
  text-decoration: underline;
  font-size: 13px;
  transition: var(--cookie-transition);
}

.ap-cookie-consent__privacy-link:hover {
  color: #1e40af;
}

/* Actions */
.ap-cookie-consent__actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.ap-cookie-consent__btn {
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--cookie-transition);
  white-space: nowrap;
  font-family: inherit;
}

.ap-cookie-consent__btn--accept {
  background: var(--cookie-primary);
  color: white;
}

.ap-cookie-consent__btn--accept:hover {
  background: #1e40af;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
}

.ap-cookie-consent__btn--secondary {
  background: #f3f4f6;
  color: var(--cookie-text);
}

.ap-cookie-consent__btn--secondary:hover {
  background: #e5e7eb;
}

.ap-cookie-consent__btn--text {
  background: transparent;
  color: #6b7280;
  padding: 0.625rem;
}

.ap-cookie-consent__btn--text:hover {
  color: var(--cookie-text);
  background: #f3f4f6;
}

/* Branding */
.ap-cookie-consent__branding {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--cookie-border);
  text-align: center;
  color: #9ca3af;
  font-size: 12px;
}

/* Modal */
.ap-cookie-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.ap-cookie-modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease-out;
}

.ap-cookie-modal__content {
  position: relative;
  background: white;
  border-radius: 16px;
  padding: 2rem;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.4s ease-out;
}

.ap-cookie-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  color: #6b7280;
  transition: var(--cookie-transition);
  border-radius: 50%;
}

.ap-cookie-modal__close:hover {
  background: #f3f4f6;
  color: var(--cookie-text);
}

.ap-cookie-modal__title {
  margin: 0 0 1rem;
  font-size: 24px;
  font-weight: 600;
  color: var(--cookie-text);
}

.ap-cookie-modal__description {
  margin: 0 0 2rem;
  color: #6b7280;
  font-size: 15px;
  line-height: 1.6;
}

/* Cookie Categories */
.ap-cookie-modal__categories {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.ap-cookie-category {
  padding: 1.25rem;
  background: #f9fafb;
  border-radius: 12px;
  border: 1px solid var(--cookie-border);
}

.ap-cookie-category__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.ap-cookie-category__title-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.ap-cookie-category__title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--cookie-text);
}

.ap-cookie-category__badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background: var(--cookie-primary);
  color: white;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ap-cookie-category__desc {
  margin: 0;
  color: #6b7280;
  font-size: 14px;
  line-height: 1.6;
}

/* Toggle Switch */
.ap-cookie-toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
  cursor: pointer;
}

.ap-cookie-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.ap-cookie-toggle__slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #d1d5db;
  transition: var(--cookie-transition);
  border-radius: 24px;
}

.ap-cookie-toggle__slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: var(--cookie-transition);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ap-cookie-toggle input:checked + .ap-cookie-toggle__slider {
  background-color: var(--cookie-primary);
}

.ap-cookie-toggle input:checked + .ap-cookie-toggle__slider:before {
  transform: translateX(24px);
}

.ap-cookie-toggle input:disabled + .ap-cookie-toggle__slider {
  opacity: 0.5;
  cursor: not-allowed;
}

.ap-cookie-modal__actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.ap-cookie-modal__actions .ap-cookie-consent__btn {
  flex: 1;
  min-width: 150px;
}

/* Animations */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .ap-cookie-consent {
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: var(--cookie-radius) var(--cookie-radius) 0 0;
    padding: 1.25rem;
  }

  .ap-cookie-consent--top {
    top: 0;
    border-radius: 0 0 var(--cookie-radius) var(--cookie-radius);
  }

  .ap-cookie-consent--popup {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    transform: none;
    border-radius: var(--cookie-radius) var(--cookie-radius) 0 0;
    max-width: 100%;
  }

  .ap-cookie-consent__content {
    flex-direction: column;
  }

  .ap-cookie-consent__icon {
    width: 40px;
    height: 40px;
  }

  .ap-cookie-consent__actions {
    width: 100%;
  }

  .ap-cookie-consent__btn {
    flex: 1;
    min-width: 0;
  }

  .ap-cookie-modal__content {
    padding: 1.5rem;
  }

  .ap-cookie-modal__title {
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .ap-cookie-consent__actions {
    flex-direction: column;
  }

  .ap-cookie-consent__btn {
    width: 100%;
  }
}

/* Print styles */
@media print {
  .ap-cookie-consent,
  .ap-cookie-modal {
    display: none !important;
  }
}
