/* ==========================================================================
   Cookiebot Style Cookie Consent Banner, Inline Toggles, Modal & Trigger
   Rookie Racing (rookieracing.ca) - Compliant with PIPEDA, GDPR, CCPA
   Strict Rule: No Emojis, Clean Vector SVGs, Rectangular 4px Radius
   ========================================================================== */

.cookie-banner-wrapper {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  max-width: 960px;
  margin: 0 auto;
  z-index: 99990;
  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;
  color: #22262E;
  border-radius: 4px;
  border-top: 3px solid #E31E24;
  box-shadow: 0 16px 40px rgba(14, 18, 26, 0.24), 0 0 0 1px rgba(14, 18, 26, 0.08);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

[data-theme="dark"] .cookie-banner-card {
  background: #161B26;
  color: #F2F2F7;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

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

.cookie-banner-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

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

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

.cookie-banner-title {
  font-family: 'Kanit', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: #22262E;
  letter-spacing: 0.01em;
  margin: 0;
}

[data-theme="dark"] .cookie-banner-title {
  color: #FFFFFF;
}

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

[data-theme="dark"] .cookie-banner-text {
  color: #CBD5E1;
}

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

.cookiebot-inline-categories {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 12px 14px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 4px;
}

[data-theme="dark"] .cookiebot-inline-categories {
  background: #0E121A;
  border-color: rgba(255, 255, 255, 0.1);
}

@media (max-width: 680px) {
  .cookiebot-inline-categories {
    grid-template-columns: repeat(2, 1fr);
  }
}

.cookiebot-inline-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 8px 12px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #22262E;
  cursor: pointer;
  user-select: none;
}

[data-theme="dark"] .cookiebot-inline-item {
  background: #1C2230;
  border-color: rgba(255, 255, 255, 0.1);
  color: #F2F2F7;
}

.cookiebot-inline-item.disabled {
  cursor: default;
  color: #64748B;
}

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

.btn-cookie {
  padding: 10px 18px;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: all 150ms ease;
  cursor: pointer;
  white-space: nowrap !important;
  font-family: 'Mulish', sans-serif;
}

.btn-cookie-accept {
  background: #E31E24;
  color: #FFFFFF !important;
  border: 1px solid #E31E24;
}

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

.btn-cookie-allow-selected {
  background-color: #FEF2F2;
  color: #E31E24;
  border: 1px solid #FECACA;
}

[data-theme="dark"] .btn-cookie-allow-selected {
  background-color: rgba(227, 30, 36, 0.15);
  color: #FF6B70;
  border-color: rgba(227, 30, 36, 0.35);
}

.btn-cookie-allow-selected:hover {
  background-color: #FEE2E2;
}

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

[data-theme="dark"] .btn-cookie-decline {
  background-color: #252D3D;
  color: #F2F2F7;
  border-color: rgba(255, 255, 255, 0.15);
}

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

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

[data-theme="dark"] .btn-cookie-settings {
  color: #94A3B8;
}

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

[data-theme="dark"] .btn-cookie-settings:hover {
  color: #FFFFFF;
  background-color: #1C2230;
  border-color: rgba(255, 255, 255, 0.12);
}

/* Unobtrusive Bottom-Left Cookiebot Floating Trigger Icon */
.cookie-floating-trigger {
  position: fixed;
  bottom: 16px;
  left: 16px;
  z-index: 9980;
  width: 38px;
  height: 38px;
  border-radius: 4px;
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  box-shadow: 0 4px 12px rgba(14, 18, 26, 0.14);
  color: #E31E24;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

[data-theme="dark"] .cookie-floating-trigger {
  background: #161B26;
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}

.cookie-floating-trigger:hover {
  transform: translateY(-2px);
  border-color: #E31E24;
  box-shadow: 0 6px 16px rgba(227, 30, 36, 0.25);
}

/* Settings Modal Dialog */
.cookie-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(14, 18, 26, 0.72);
  backdrop-filter: blur(4px);
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.cookie-modal-dialog {
  background: #FFFFFF;
  color: #22262E;
  border-radius: 4px;
  border-top: 4px solid #E31E24;
  max-width: 620px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  padding: 28px;
  position: relative;
}

[data-theme="dark"] .cookie-modal-dialog {
  background: #161B26;
  color: #F2F2F7;
}

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

[data-theme="dark"] .cookie-modal-close {
  background: #252D3D;
  color: #CBD5E1;
}

.cookie-modal-close:hover {
  background: #E2E8F0;
  color: #22262E;
}

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

.cookie-modal-title {
  font-family: 'Kanit', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: #22262E;
  margin: 0 0 6px 0;
}

[data-theme="dark"] .cookie-modal-title {
  color: #FFFFFF;
}

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

[data-theme="dark"] .cookie-modal-subtitle {
  color: #94A3B8;
}

.cookie-category-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

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

[data-theme="dark"] .cookie-category-card {
  background: #0E121A;
  border-color: rgba(255, 255, 255, 0.1);
}

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

.cookie-category-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #22262E;
}

[data-theme="dark"] .cookie-category-name {
  color: #FFFFFF;
}

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

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

[data-theme="dark"] .cookie-category-desc {
  color: #94A3B8;
}

/* Custom Rectangular Switch Toggle (4px radius) */
.cookie-toggle-label {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.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: 4px;
}

[data-theme="dark"] .cookie-toggle-slider {
  background-color: #334155;
}

.cookie-toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: #FFFFFF;
  transition: 0.2s ease;
  border-radius: 2px;
}

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

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

.cookie-toggle-label input:disabled + .cookie-toggle-slider {
  opacity: 0.65;
  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;
}

[data-theme="dark"] .cookie-modal-footer {
  border-top-color: rgba(255, 255, 255, 0.1);
}
