/**
 * Unilise Consent Banner Styles
 * Modern, responsive, accessible design
 */

/* Backdrop - Used for modal */
.consent-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.consent-backdrop.visible {
  opacity: 1;
  visibility: visible;
}

/* Banner Container - Bottom positioned */
.consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 100vw;
  max-height: auto;
  background: #ffffff;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(100%);
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.consent-banner.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  .consent-banner {
    background: #1a1a1a;
    border: 1px solid #333;
  }
}

/* Content Area */
.consent-content {
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (min-width: 768px) {
  .consent-content {
    flex-direction: row;
    align-items: center;
    gap: 32px;
  }
  
  .consent-header {
    flex: 1;
  }
  
  .consent-actions {
    flex-shrink: 0;
    margin-bottom: 0 !important;
  }
}

/* Header */
.consent-header h3 {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 8px 0;
  line-height: 1.3;
}

.consent-header p {
  font-size: 14px;
  color: #666;
  margin: 0;
  line-height: 1.4;
}

@media (prefers-color-scheme: dark) {
  .consent-header h3 {
    color: #ffffff;
  }
  
  .consent-header p {
    color: #b3b3b3;
  }
}

/* Toggle Options - Hidden in bottom banner */
.consent-options {
  display: none;
}

.consent-toggle {
  margin-bottom: 20px;
  padding: 16px;
  background: #f8f9fa;
  border-radius: 12px;
  border: 1px solid #e9ecef;
  transition: all 0.2s ease;
}

.consent-toggle:hover {
  background: #e9ecef;
  transform: translateY(-1px);
}

@media (prefers-color-scheme: dark) {
  .consent-toggle {
    background: #2a2a2a;
    border-color: #404040;
  }
  
  .consent-toggle:hover {
    background: #333333;
  }
}

/* Toggle Label */
.toggle-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  margin-bottom: 8px;
}

.toggle-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* Toggle Slider */
.toggle-slider {
  position: relative;
  width: 48px;
  height: 24px;
  background: #ddd;
  border-radius: 12px;
  margin-right: 12px;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Checked State */
input[type="checkbox"]:checked + .toggle-slider {
  background: #0066cc;
}

input[type="checkbox"]:checked + .toggle-slider::before {
  transform: translateX(24px);
}

/* Disabled State */
input[type="checkbox"]:disabled + .toggle-slider {
  background: #0066cc;
  opacity: 0.6;
  cursor: not-allowed;
}

.toggle-label:has(input:disabled) {
  cursor: not-allowed;
}

/* Toggle Text */
.toggle-text {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
  flex-grow: 1;
}

.required {
  font-size: 12px;
  font-weight: 400;
  color: #666;
  font-style: italic;
}

@media (prefers-color-scheme: dark) {
  .toggle-text {
    color: #ffffff;
  }
  
  .required {
    color: #999;
  }
}

/* Toggle Description */
.toggle-description {
  font-size: 14px;
  color: #666;
  margin: 0;
  padding-left: 60px;
  line-height: 1.4;
}

@media (prefers-color-scheme: dark) {
  .toggle-description {
    color: #b3b3b3;
  }
}

/* Action Buttons */
.consent-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 0;
  flex-wrap: wrap;
}

.consent-actions .btn,
.consent-modal-actions .btn {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  display: inline-block;
  font-family: inherit;
}

.consent-actions .btn-primary,
.consent-modal-actions .btn-primary {
  background: #0066cc !important;
  color: white !important;
  border: 2px solid #0066cc !important;
}

.consent-actions .btn-primary:hover,
.consent-modal-actions .btn-primary:hover {
  background: #0052a3 !important;
  border-color: #0052a3 !important;
  transform: translateY(-1px);
}

.consent-actions .btn-secondary,
.consent-modal-actions .btn-secondary {
  background: #6c757d !important;
  color: white !important;
  border: 2px solid #6c757d !important;
}

.consent-actions .btn-secondary:hover,
.consent-modal-actions .btn-secondary:hover {
  background: #5a6268 !important;
  border-color: #5a6268 !important;
  transform: translateY(-1px);
}

.consent-actions .btn-outline,
.consent-modal-actions .btn-outline {
  background: transparent !important;
  color: #6c757d !important;
  border: 2px solid #6c757d !important;
}

.consent-actions .btn-outline:hover,
.consent-modal-actions .btn-outline:hover {
  background: #6c757d !important;
  color: white !important;
  transform: translateY(-1px);
}

@media (prefers-color-scheme: dark) {
  .consent-actions .btn-outline,
  .consent-modal-actions .btn-outline {
    color: #b3b3b3 !important;
    border-color: #666 !important;
  }
  
  .consent-actions .btn-outline:hover,
  .consent-modal-actions .btn-outline:hover {
    background: #666 !important;
    color: white !important;
  }
}

/* Footer - Hidden in bottom banner */
.consent-footer {
  display: none;
}

.consent-footer p {
  font-size: 12px;
  color: #666;
  margin: 0;
  text-align: center;
  line-height: 1.4;
}

.consent-footer a {
  color: #0066cc;
  text-decoration: none;
}

.consent-footer a:hover {
  text-decoration: underline;
}

@media (prefers-color-scheme: dark) {
  .consent-footer {
    border-top-color: #404040;
  }
  
  .consent-footer p {
    color: #b3b3b3;
  }
}

/* Close Button */
.consent-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 24px;
  color: #666;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  line-height: 1;
}

.consent-close:hover {
  background: #f0f0f0;
  color: #333;
}

@media (prefers-color-scheme: dark) {
  .consent-close {
    color: #b3b3b3;
  }
  
  .consent-close:hover {
    background: #333;
    color: #ffffff;
  }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .consent-content {
    padding: 16px 20px;
    flex-direction: column;
    gap: 16px;
  }
  
  .consent-header h3 {
    font-size: 18px;
  }
  
  .consent-header p {
    font-size: 13px;
  }
  
  .consent-actions {
    flex-direction: row;
    justify-content: center;
  }
  
  .consent-actions .btn {
    font-size: 12px;
    padding: 6px 12px;
  }
}

/* Animation for toggle switches */
@keyframes toggleOn {
  0% { transform: translateX(0); }
  100% { transform: translateX(24px); }
}

@keyframes toggleOff {
  0% { transform: translateX(24px); }
  100% { transform: translateX(0); }
}

/* Focus states for accessibility */
.toggle-label:focus-within .toggle-slider {
  outline: 2px solid #0066cc;
  outline-offset: 2px;
}

.consent-actions .btn:focus {
  outline: 2px solid #0066cc;
  outline-offset: 2px;
}

.consent-close:focus {
  outline: 2px solid #0066cc;
  outline-offset: 2px;
}

/* Modal Styles */
.consent-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  max-width: 90vw;
  width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.consent-modal.visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.consent-modal-content {
  padding: 32px;
}

.consent-modal-header h3 {
  font-size: 24px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 12px 0;
  line-height: 1.3;
}

.consent-modal-header p {
  font-size: 16px;
  color: #666;
  margin: 0 0 24px 0;
  line-height: 1.5;
}

.consent-modal .consent-options {
  display: block;
  margin-bottom: 24px;
}

.consent-modal .consent-footer {
  display: block;
  padding-top: 16px;
  border-top: 1px solid #e9ecef;
}

.consent-modal-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.consent-modal .consent-modal-actions .btn {
  flex: 1;
  min-width: 120px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  line-height: 1;
  text-decoration: none;
  display: inline-block;
  font-family: inherit;
}

@media (prefers-color-scheme: dark) {
  .consent-modal {
    background: #1a1a1a;
    border: 1px solid #333;
  }
  
  .consent-modal-header h3 {
    color: #ffffff;
  }
  
  .consent-modal-header p {
    color: #b3b3b3;
  }
  
  .consent-modal .consent-footer {
    border-top-color: #404040;
  }
  
  .consent-modal .consent-footer p {
    color: #b3b3b3;
  }
}

@media (max-width: 768px) {
  .consent-modal {
    width: 95vw;
    max-height: 85vh;
  }
  
  .consent-modal-content {
    padding: 24px;
  }
  
  .consent-modal-header h3 {
    font-size: 20px;
  }
  
  .consent-modal-actions {
    flex-direction: column;
  }
  
  .consent-modal-actions .btn {
    width: 100%;
    margin: 0;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .consent-banner,
  .consent-modal,
  .consent-backdrop,
  .toggle-slider,
  .toggle-slider::before,
  .consent-actions .btn,
  .consent-modal-actions .btn,
  .consent-close {
    transition: none;
  }
} 