/**
 * Cookie Consent Styles for VRMCheck
 * Blocking modal popup - users must interact before continuing
 */

/* Overlay that blocks the page */
.cookie-consent-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.cookie-consent-overlay.visible {
  opacity: 1;
  visibility: visible;
}

/* Banner - now a centered modal popup */
.cookie-consent-banner {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  background: #1a1a2e;
  color: #fff;
  padding: 2rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  border-radius: 16px;
  z-index: 9999;
  max-width: 520px;
  width: calc(100% - 2rem);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
}

.cookie-consent-banner.visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.cookie-banner-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  text-align: center;
}

.cookie-banner-icon {
  width: 64px;
  height: 64px;
  background: rgba(67, 97, 238, 0.2);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cookie-banner-icon svg {
  width: 36px;
  height: 36px;
  color: #4361ee;
}

.cookie-banner-text {
  flex: 1;
}

.cookie-banner-text h3 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 0.75rem 0;
  color: #fff;
}

.cookie-banner-text p {
  font-size: 0.95rem;
  color: #b0b0b0;
  margin: 0;
  line-height: 1.6;
}

.cookie-banner-text a {
  color: #4361ee;
  text-decoration: none;
}

.cookie-banner-text a:hover {
  text-decoration: underline;
}

.cookie-banner-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  width: 100%;
  justify-content: center;
}

.cookie-btn {
  padding: 0.85rem 1.5rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  white-space: nowrap;
}

.cookie-btn-primary {
  background: linear-gradient(135deg, #4361ee 0%, #3651d4 100%);
  color: #fff;
  flex: 1;
  min-width: 140px;
}

.cookie-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(67, 97, 238, 0.4);
}

.cookie-btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  flex: 1;
  min-width: 140px;
}

.cookie-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.cookie-btn-link {
  background: transparent;
  color: #4361ee;
  padding: 0.85rem 0.5rem;
  width: 100%;
}

.cookie-btn-link:hover {
  text-decoration: underline;
}

/* Preferences Modal */
.cookie-preferences-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

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

.cookie-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  /* No pointer events - can't click to close */
  pointer-events: none;
}

.cookie-modal-container {
  position: relative;
  background: #fff;
  border-radius: 16px;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.cookie-modal-header {
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cookie-modal-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0;
}

/* X button - hidden by default */
.cookie-modal-close {
  display: none;
}

.cookie-modal-body {
  padding: 1.5rem;
}

.cookie-modal-intro {
  font-size: 0.95rem;
  color: #555;
  line-height: 1.6;
  margin: 0 0 1.5rem 0;
}

/* Rejection mode intro text */
.cookie-modal-intro.rejection-mode {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 8px;
  padding: 1rem;
  color: #856404;
}

.cookie-category {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.cookie-category:last-child {
  margin-bottom: 0;
}

.cookie-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.cookie-category-info {
  flex: 1;
}

.cookie-category-info h4 {
  font-size: 1rem;
  font-weight: 600;
  color: #1a1a2e;
  margin: 0 0 0.25rem 0;
}

.cookie-category-info p {
  font-size: 0.85rem;
  color: #666;
  margin: 0;
  line-height: 1.5;
}

/* Toggle Switch */
.cookie-toggle {
  position: relative;
  width: 48px;
  height: 28px;
  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-color: #9ca3af; /* GREY when unselected (neutral) */
  transition: 0.3s;
  border-radius: 28px;
}

.cookie-toggle-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Green when ON (accepting) - normal mode */
.cookie-toggle input:checked + .cookie-toggle-slider {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

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

/* RED when ON in rejection mode (rejecting) - only for enabled toggles */
.rejection-mode-active .cookie-toggle input:checked:not(:disabled) + .cookie-toggle-slider {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

/* Necessary cookies - ALWAYS green, disabled (overrides everything including rejection mode) */
.cookie-toggle input:disabled + .cookie-toggle-slider,
.rejection-mode-active .cookie-toggle input:disabled + .cookie-toggle-slider {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
  cursor: not-allowed;
}

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

.cookie-category-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  margin-left: 0.5rem;
  vertical-align: middle;
}

.cookie-category-badge.required {
  background: #d4edda;
  color: #155724;
}

.cookie-category-badge.rejecting {
  background: #f8d7da;
  color: #721c24;
}

.cookie-modal-footer {
  padding: 1rem 1.5rem 1.5rem;
  border-top: 1px solid #e9ecef;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.cookie-modal-footer .cookie-btn {
  flex: 1;
  min-width: 120px;
  text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
  .cookie-consent-banner {
    padding: 1.5rem;
    max-width: calc(100% - 1rem);
  }

  .cookie-banner-icon {
    width: 56px;
    height: 56px;
  }

  .cookie-banner-icon svg {
    width: 32px;
    height: 32px;
  }

  .cookie-banner-text h3 {
    font-size: 1.2rem;
  }

  .cookie-banner-actions {
    flex-direction: column;
  }

  .cookie-banner-actions .cookie-btn {
    width: 100%;
  }

  .cookie-modal-container {
    max-height: 100vh;
    border-radius: 16px 16px 0 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 100%;
  }

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

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

/* Footer link for managing cookies */
.cookie-settings-link {
  cursor: pointer;
  color: #4361ee;
}

.cookie-settings-link:hover {
  text-decoration: underline;
}
