/**
 * Cookie Consent Banner & Modal
 * Matches mynzhome branding and design system
 */

/* Banner positioning and base styles */
#cookie-consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(65, 107, 235, 0.97);
  color: #fff;
  padding: 1.25rem 0;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.15);
  z-index: 10001;
  transform: translateY(100%);
  transition: transform 0.3s ease-out;
}

#cookie-consent-banner.show {
  transform: translateY(0);
}

#cookie-consent-banner .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

#cookie-consent-banner p {
  margin: 0;
  flex: 1 1 300px;
  font-size: 0.95rem;
  line-height: 1.5;
}

#cookie-consent-banner a {
  color: #fff;
  text-decoration: underline;
  font-weight: 500;
}

#cookie-consent-banner a:hover {
  text-decoration: none;
}

#cookie-consent-banner .btn-group {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

#cookie-consent-banner .btn {
  font-size: 0.9rem;
  padding: 0.5rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  white-space: nowrap;
  border-width: 2px;
  transition: all 0.15s ease-in-out;
}

#cookie-consent-banner .btn-accept {
  background: #fff;
  color: #416BEB;
  border: 2px solid #fff;
}

#cookie-consent-banner .btn-accept:hover {
  background: #f8f9fa;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#cookie-consent-banner .btn-outline-light {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.6);
}

#cookie-consent-banner .btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: #fff;
}

/* Modal overlay */
#cookie-consent-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.85);
  z-index: 10002;
  padding: 2rem;
  overflow-y: auto;
}

#cookie-consent-modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Modal dialog */
#cookie-consent-modal .modal-dialog {
  background: #fff;
  border: 2px solid #416BEB;
  border-radius: 16px;
  padding: 2.5rem;
  max-width: 600px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  position: relative;
  pointer-events: auto;
}

#cookie-consent-modal h2 {
  color: #0b2a4a;
  margin-bottom: 1.5rem;
  font-size: 1.75rem;
  font-weight: 600;
}

#cookie-consent-modal .modal-intro {
  color: #6c757d;
  margin-bottom: 2rem;
  font-size: 1rem;
  line-height: 1.6;
}

#cookie-consent-modal .modal-intro a {
  color: #416BEB;
  text-decoration: underline;
}

/* Cookie categories */
.cookie-category {
  border: 2px solid #adb5bd;
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  background: #fff;
  transition: all 0.2s ease-in-out;
}

.cookie-category.active {
  background: #e7f3ff;
  border-color: #416BEB;
}

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

.cookie-category h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #0b2a4a;
  margin: 0;
}

.cookie-category p {
  margin: 0;
  font-size: 0.9rem;
  color: #6c757d;
  line-height: 1.5;
}

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

.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-color: #6c757d;
  transition: 0.3s;
  border-radius: 26px;
}

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

.cookie-toggle input:checked + .cookie-toggle-slider {
  background-color: #416BEB;
}

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

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

.cookie-category.always-on {
  background: #e7f3ff;
  border-color: #416BEB;
  border-width: 2px;
}

/* Modal actions */
#cookie-consent-modal .modal-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #e9ecef;
}

#cookie-consent-modal .btn {
  flex: 1;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}

#cookie-consent-modal .btn-primary {
  background: #416BEB;
  color: #fff;
}

#cookie-consent-modal .btn-primary:hover {
  background: #3558d6;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(65, 107, 235, 0.3);
}

#cookie-consent-modal .btn-secondary {
  background: #6c757d;
  color: #fff;
}

#cookie-consent-modal .btn-secondary:hover {
  background: #5a6268;
}

/* Mobile responsive */
@media (max-width: 768px) {
  #cookie-consent-banner .container {
    flex-direction: column;
    align-items: stretch;
  }
  
  #cookie-consent-banner p {
    text-align: center;
  }
  
  #cookie-consent-banner .btn-group {
    flex-direction: column;
    width: 100%;
  }
  
  #cookie-consent-banner .btn {
    width: 100%;
    text-align: center;
  }
  
  #cookie-consent-modal {
    padding: 1rem;
  }
  
  #cookie-consent-modal .modal-dialog {
    padding: 1.5rem;
  }
  
  #cookie-consent-modal h2 {
    font-size: 1.5rem;
  }
  
  #cookie-consent-modal .modal-actions {
    flex-direction: column;
  }
}

@media (max-width: 576px) {
  #cookie-consent-banner {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
  }
  
  .cookie-category {
    padding: 1rem;
  }
}
