/* ==========================================================================
   OINVO KIDS - Cookie Consent & Preference System Styles
   Clean, Accessible, Non-Intrusive, Child-Safe & Family-Friendly
   ========================================================================== */

/* Consent Banner (Floating Bottom) */
.cookie-banner {
  position: fixed;
  bottom: 24px;
  left: 24px;
  right: 24px;
  max-width: 960px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 20px;
  box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(15, 23, 42, 0.05);
  padding: 24px 28px;
  z-index: 99999;
  transform: translateY(120%);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease, visibility 0.35s;
}

.cookie-banner.show {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.cookie-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.cookie-banner-content {
  flex: 1;
}

.cookie-banner-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 8px;
}

.cookie-banner-text {
  font-size: 0.92rem;
  line-height: 1.55;
  color: #475569;
  margin: 0;
}

.cookie-banner-text a {
  color: #2563eb;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
}

.cookie-banner-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* Button Variants for Consent */
.btn-consent {
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-consent-primary {
  background-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-consent-primary:hover {
  background-color: #1d4ed8;
  transform: translateY(-1px);
}

.btn-consent-secondary {
  background-color: #f1f5f9;
  color: #0f172a;
  border-color: #e2e8f0;
}

.btn-consent-secondary:hover {
  background-color: #e2e8f0;
  color: #0f172a;
  transform: translateY(-1px);
}

.btn-consent-outline {
  background: transparent;
  color: #475569;
  border-color: #cbd5e1;
}

.btn-consent-outline:hover {
  background: #f8fafc;
  color: #0f172a;
  border-color: #94a3b8;
}

/* Preferences Modal Overlay */
.cookie-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cookie-modal-backdrop.show {
  opacity: 1;
  visibility: visible;
}

.cookie-modal-dialog {
  background: #ffffff;
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  border-radius: 24px;
  box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cookie-modal-backdrop.show .cookie-modal-dialog {
  transform: scale(1) translateY(0);
}

.cookie-modal-header {
  padding: 24px 28px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f1f5f9;
}

.cookie-modal-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 10px;
}

.cookie-modal-close {
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: #64748b;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.cookie-modal-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.cookie-modal-body {
  padding: 24px 28px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cookie-modal-desc {
  font-size: 0.95rem;
  color: #475569;
  line-height: 1.6;
}

/* Category Cards */
.cookie-category-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 20px;
  transition: border-color 0.2s ease;
}

.cookie-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.cookie-category-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cookie-category-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
}

.cookie-badge-required {
  font-size: 0.75rem;
  font-weight: 700;
  background: #e2e8f0;
  color: #475569;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
}

.cookie-category-desc {
  font-size: 0.88rem;
  color: #64748b;
  line-height: 1.5;
  margin: 0;
}

/* Modern Toggle Switch */
.cookie-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.cookie-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.cookie-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: 0.3s;
  border-radius: 34px;
}

.cookie-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

input:checked + .cookie-slider {
  background-color: #2563eb;
}

input:focus + .cookie-slider {
  box-shadow: 0 0 1px #2563eb;
}

input:checked + .cookie-slider:before {
  transform: translateX(22px);
}

input:disabled + .cookie-slider {
  background-color: #94a3b8;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Modal Footer */
.cookie-modal-footer {
  padding: 18px 28px 24px;
  border-top: 1px solid #f1f5f9;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

/* Footer Trigger Button */
.cookie-footer-link {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 0.85rem;
  color: #94a3b8;
  cursor: pointer;
  transition: color 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cookie-footer-link:hover {
  color: #ffffff;
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
  .cookie-banner {
    bottom: 12px;
    left: 12px;
    right: 12px;
    padding: 20px;
  }

  .cookie-banner-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .cookie-banner-actions {
    width: 100%;
    flex-direction: column;
  }

  .cookie-banner-actions .btn-consent {
    width: 100%;
    text-align: center;
  }

  .cookie-modal-dialog {
    border-radius: 20px;
    margin: 10px;
  }

  .cookie-modal-footer {
    flex-direction: column-reverse;
  }

  .cookie-modal-footer .btn-consent {
    width: 100%;
  }
}
