/* ========================================
   COOKIE CONSENT BANNER - RGPD/LSSI Compliant
   ======================================== */

/* Banner Container - Bottom Position */
#cookie-consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 3px solid var(--brand, #e91e63);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  z-index: 10000;
  display: none;
  animation: slideUp 0.4s ease-out;
}

#cookie-consent-banner.show {
  display: block;
}

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

/* Inner Container */
.cookie-consent-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Icon */
.cookie-icon {
  font-size: 32px;
  flex-shrink: 0;
}

/* Content */
.cookie-content {
  flex: 1;
  min-width: 0;
}

.cookie-title {
  font-size: 18px;
  font-weight: 700;
  color: #071325;
  margin: 0 0 8px;
}

.cookie-text {
  font-size: 14px;
  color: #5c6368;
  line-height: 1.5;
  margin: 0;
}

.cookie-text a {
  color: var(--brand, #e91e63);
  text-decoration: underline;
  font-weight: 500;
}

.cookie-text a:hover {
  color: #c2185b;
}

/* Buttons Container */
.cookie-actions {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.cookie-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.cookie-btn-primary {
  background: var(--brand, #e91e63);
  color: #fff;
}

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

.cookie-btn-secondary {
  background: transparent;
  color: #071325;
  border: 2px solid #ddd;
}

.cookie-btn-secondary:hover {
  background: #f5f5f5;
  border-color: #bbb;
}

.cookie-btn-link {
  background: transparent;
  color: var(--brand, #e91e63);
  border: none;
  padding: 12px 16px;
  text-decoration: underline;
}

.cookie-btn-link:hover {
  color: #c2185b;
  background: rgba(233, 30, 99, 0.05);
}

/* ========================================
   COOKIE SETTINGS MODAL
   ======================================== */

#cookie-settings-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10001;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

#cookie-settings-modal.show {
  display: flex;
}

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

/* Modal Container */
.cookie-modal-content {
  background: #fff;
  border-radius: 16px;
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

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

.cookie-modal-title {
  font-size: 22px;
  font-weight: 700;
  color: #071325;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.cookie-modal-close {
  background: transparent;
  border: none;
  font-size: 28px;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.cookie-modal-close:hover {
  background: #f5f5f5;
  color: #333;
}

/* Modal Body */
.cookie-modal-body {
  padding: 24px;
  overflow-y: auto;
}

.cookie-category {
  padding: 20px;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  margin-bottom: 16px;
  transition: all 0.2s ease;
}

.cookie-category:hover {
  border-color: var(--brand, #e91e63);
  box-shadow: 0 2px 8px rgba(233, 30, 99, 0.1);
}

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

.cookie-category-title {
  font-size: 16px;
  font-weight: 700;
  color: #071325;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cookie-category-required {
  font-size: 11px;
  background: #4caf50;
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
}

.cookie-category-description {
  font-size: 14px;
  color: #5c6368;
  line-height: 1.6;
  margin: 0;
}

/* Toggle Switch */
.cookie-toggle {
  position: relative;
  width: 50px;
  height: 26px;
  flex-shrink: 0;
}

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

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

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

.cookie-toggle input:checked + .cookie-toggle-slider {
  background: var(--brand, #e91e63);
}

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

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

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

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
  .cookie-consent-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .cookie-icon {
    font-size: 28px;
  }

  .cookie-title {
    font-size: 16px;
  }

  .cookie-text {
    font-size: 13px;
  }

  .cookie-actions {
    width: 100%;
    flex-direction: column;
  }

  .cookie-btn {
    width: 100%;
    text-align: center;
  }

  .cookie-modal-content {
    max-height: 90vh;
  }

  .cookie-modal-header {
    padding: 20px;
  }

  .cookie-modal-title {
    font-size: 18px;
  }

  .cookie-modal-body {
    padding: 20px;
  }

  .cookie-category {
    padding: 16px;
  }

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

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

@media (max-width: 480px) {
  #cookie-consent-banner {
    border-top-width: 2px;
  }

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

  .cookie-title {
    font-size: 15px;
  }

  .cookie-text {
    font-size: 12px;
  }

  .cookie-btn {
    padding: 10px 20px;
    font-size: 13px;
  }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

.cookie-btn:focus,
.cookie-toggle input:focus + .cookie-toggle-slider,
.cookie-modal-close:focus {
  outline: 2px solid var(--brand, #e91e63);
  outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  #cookie-consent-banner,
  #cookie-settings-modal,
  .cookie-modal-content {
    animation: none;
  }

  .cookie-btn,
  .cookie-toggle-slider,
  .cookie-toggle-slider:before {
    transition: none;
  }
}
