/* ==========================================================================
   VoltRide EV - Cookie Consent Banner & Preferences Modal Styling
   ========================================================================== */

/* 1. Floating Cookie Consent Banner */
.cookie-banner-wrap {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 99998;
  max-width: 440px;
  width: calc(100% - 48px);
  background: #1C1F23;
  background: linear-gradient(145deg, #22262B, #16181B);
  color: #FFFFFF;
  border-radius: 22px;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.05);
  padding: 26px 26px 22px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(30px) scale(0.96);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.cookie-banner-wrap.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.cookie-banner-icon {
  font-size: 2.2rem;
  line-height: 1;
  margin-bottom: 14px;
  display: inline-block;
  animation: cookieWiggle 3s ease-in-out infinite;
}

@keyframes cookieWiggle {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(-8deg); }
  40% { transform: rotate(8deg); }
  60% { transform: rotate(-4deg); }
  80% { transform: rotate(4deg); }
}

.cookie-banner-text {
  font-size: 0.95rem;
  line-height: 1.55;
  color: #E2E8F0;
  font-weight: 500;
  margin-bottom: 22px;
}

.cookie-banner-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.cookie-btn-accept {
  flex: 1;
  min-width: 120px;
  background: #FFFFFF;
  color: #0F172A;
  font-weight: 800;
  font-size: 0.95rem;
  padding: 12px 22px;
  border-radius: 9999px;
  border: none;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(255, 255, 255, 0.25);
}

.cookie-btn-accept:hover {
  background: #F1F5F9;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(255, 255, 255, 0.35);
}

.cookie-btn-accept:active {
  transform: translateY(0);
}

.cookie-btn-customize {
  flex: 1;
  min-width: 120px;
  background: transparent;
  color: #FFFFFF;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 11px 22px;
  border-radius: 9999px;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}

.cookie-btn-customize:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #FFFFFF;
  transform: translateY(-2px);
}

.cookie-btn-customize:active {
  transform: translateY(0);
}

.cookie-banner-footer {
  text-align: center;
}

.cookie-privacy-link {
  color: #FFFFFF;
  font-weight: 700;
  font-size: 0.88rem;
  text-decoration: underline;
  text-underline-offset: 4px;
  opacity: 0.9;
  transition: opacity 0.2s;
}

.cookie-privacy-link:hover {
  opacity: 1;
  color: #34D399;
}

/* 2. Floating Reopen Cookie Preferences Button (Bottom-Left) */
.cookie-reopen-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 9990;
  background: #1E293B;
  color: #F8FAFC;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 7px 13px;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}

.cookie-reopen-btn:hover {
  background: #0F172A;
  transform: translateY(-2px);
  border-color: #34D399;
  color: #34D399;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

/* 3. Customize Preferences Modal */
.cookie-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: cookieFadeIn 0.2s ease-out;
}

@keyframes cookieFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.cookie-modal-card {
  background: #FFFFFF;
  color: #0F172A;
  border-radius: 24px;
  max-width: 580px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  border: 1px solid #E2E8F0;
  position: relative;
  animation: cookiePop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 28px;
}

@keyframes cookiePop {
  from { transform: scale(0.94); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.cookie-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #F1F5F9;
}

.cookie-modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0F172A;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px 0;
}

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

.cookie-modal-close {
  background: #F1F5F9;
  border: none;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #64748B;
  cursor: pointer;
  transition: all 0.15s;
}

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

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

.cookie-category-item {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  padding: 16px 18px;
  transition: border-color 0.15s;
}

.cookie-category-item:hover {
  border-color: #CBD5E1;
}

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

.cookie-category-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0F172A;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cookie-category-badge {
  font-size: 0.72rem;
  font-weight: 800;
  color: #059669;
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  padding: 2px 8px;
  border-radius: 9999px;
}

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

/* Custom Toggle Switch */
.cookie-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

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

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

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

.cookie-switch input:checked + .cookie-slider {
  background-color: #059669;
}

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

/* Modal Actions */
.cookie-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
  border-top: 1px solid #F1F5F9;
  padding-top: 16px;
}

.cookie-modal-btn {
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
}

.cookie-modal-btn-primary {
  background: #059669;
  color: #FFFFFF;
}

.cookie-modal-btn-primary:hover {
  background: #047857;
}

.cookie-modal-btn-secondary {
  background: #F1F5F9;
  color: #475569;
  border: 1px solid #E2E8F0;
}

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

.cookie-modal-btn-outline {
  background: transparent;
  color: #0F172A;
  border: 1.5px solid #0F172A;
}

.cookie-modal-btn-outline:hover {
  background: #0F172A;
  color: #FFFFFF;
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
  .cookie-banner-wrap {
    bottom: 12px;
    left: 12px;
    right: 12px;
    width: auto;
    max-width: none;
    padding: 20px 18px 16px;
    border-radius: 18px;
  }

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

  .cookie-btn-accept,
  .cookie-btn-customize {
    width: 100%;
  }

  .cookie-reopen-btn {
    bottom: 74px; /* avoid mobile bottom nav overlap */
    left: 12px;
  }
}
