/* ==========================================================================
   Cookiebot / Usercentrics Style Cookie Consent Banner & Modal
   Sim Racing Nation - Compliant with GDPR, ePrivacy, CCPA
   Strict Rule: No Emojis, Clean Vector SVGs
   ========================================================================== */

/* Floating Bottom Banner */
.cookie-banner-wrapper {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  max-width: 980px;
  margin: 0 auto;
  z-index: 9999;
  display: none;
  animation: cookieSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cookieSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cookie-banner-card {
  background: #FFFFFF;
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(15, 23, 42, 0.08);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (min-width: 840px) {
  .cookie-banner-card {
    padding: 28px 32px;
  }
}

.cookie-banner-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cookie-shield-icon {
  width: 28px;
  height: 28px;
  color: #FF0000;
  flex-shrink: 0;
}

.cookie-banner-title {
  font-size: 1.125rem;
  font-weight: 800;
  color: #0F172A;
  letter-spacing: -0.01em;
}

.cookie-banner-text {
  font-size: 0.875rem;
  line-height: 1.55;
  color: #475569;
}

.cookie-banner-text a {
  color: #FF0000;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cookie-banner-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 8px;
}

.btn-cookie {
  padding: 10px 20px;
  font-size: 0.8125rem;
  font-weight: 800;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: all 150ms ease;
  cursor: pointer;
}

.btn-cookie-accept {
  background-color: #FF0000;
  color: #FFFFFF;
  border: none;
  box-shadow: 0 2px 8px rgba(255, 0, 0, 0.3);
}

.btn-cookie-accept:hover {
  background-color: #CC0000;
}

.btn-cookie-decline {
  background-color: #F1F5F9;
  color: #0F172A;
  border: 1px solid #CBD5E1;
}

.btn-cookie-decline:hover {
  background-color: #E2E8F0;
}

.btn-cookie-settings {
  background-color: transparent;
  color: #64748B;
  border: 1px solid transparent;
}

.btn-cookie-settings:hover {
  color: #0F172A;
  background-color: #F8FAFC;
  border-color: #E2E8F0;
}

/* Settings Modal Dialog */
.cookie-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.cookie-modal-dialog {
  background: #FFFFFF;
  border-radius: 20px;
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  padding: 28px;
  position: relative;
}

.cookie-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748B;
  background: #F1F5F9;
  cursor: pointer;
  transition: all 150ms ease;
}

.cookie-modal-close:hover {
  background: #E2E8F0;
  color: #0F172A;
}

.cookie-modal-header {
  margin-bottom: 20px;
  padding-right: 36px;
}

.cookie-modal-title {
  font-size: 1.25rem;
  font-weight: 900;
  color: #0F172A;
  margin-bottom: 6px;
}

.cookie-modal-subtitle {
  font-size: 0.875rem;
  color: #64748B;
  line-height: 1.5;
}

/* Category Checkbox Cards */
.cookie-category-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.cookie-category-card {
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 16px;
  background: #F8FAFC;
}

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

.cookie-category-name {
  font-size: 0.9375rem;
  font-weight: 800;
  color: #0F172A;
}

.cookie-category-status {
  font-size: 0.75rem;
  font-weight: 700;
  color: #16A34A;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cookie-category-desc {
  font-size: 0.8125rem;
  color: #64748B;
  line-height: 1.45;
}

/* Custom Switch Toggle */
.cookie-toggle-label {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

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

.cookie-toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #CBD5E1;
  transition: 0.2s ease;
  border-radius: 24px;
}

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

.cookie-toggle-label input:checked + .cookie-toggle-slider {
  background-color: #FF0000;
}

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

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

.cookie-modal-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid #E2E8F0;
}

/* ==========================================================================
   Dark Mode Styles for Cookie Consent
   ========================================================================== */
body.dark-mode .cookie-banner-card {
  background: #151A22;
  border: 1px solid #232936;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
}
body.dark-mode .cookie-banner-title {
  color: #F3F4F6;
}
body.dark-mode .cookie-banner-text {
  color: #94A3B8;
}
body.dark-mode .btn-cookie-decline {
  background-color: #1B212D;
  color: #F3F4F6;
  border-color: #232936;
}
body.dark-mode .btn-cookie-decline:hover {
  background-color: #232A38;
}
body.dark-mode .btn-cookie-settings {
  color: #94A3B8;
}
body.dark-mode .btn-cookie-settings:hover {
  color: #F3F4F6;
  background-color: #1B212D;
  border-color: #232936;
}
body.dark-mode .cookie-modal-dialog {
  background: #151A22;
  border: 1px solid #232936;
}
body.dark-mode .cookie-modal-close {
  background: #1B212D;
  color: #94A3B8;
}
body.dark-mode .cookie-modal-close:hover {
  background: #232A38;
  color: #F3F4F6;
}
body.dark-mode .cookie-modal-title {
  color: #F3F4F6;
}
body.dark-mode .cookie-modal-subtitle {
  color: #94A3B8;
}
body.dark-mode .cookie-category-card {
  border-color: #232936;
  background: #1B212D;
}
body.dark-mode .cookie-category-name {
  color: #F3F4F6;
}
body.dark-mode .cookie-category-desc {
  color: #94A3B8;
}
body.dark-mode .cookie-toggle-slider {
  background-color: #334155;
}
body.dark-mode .cookie-modal-footer {
  border-color: #232936;
}
