/* ============================================
   VALORYS — Cookie Consent System (GDPR)
   ============================================ */

/* ═══ COOKIE BANNER ═══ */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 99999;
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.4s ease;
  pointer-events: none;
}

.cookie-banner.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.cookie-banner__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(3px);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.cookie-banner.is-visible .cookie-banner__backdrop {
  opacity: 1;
}

.cookie-banner__card {
  position: relative;
  max-width: 720px;
  margin: 0 auto 24px;
  padding: 28px 32px 24px;
  background: rgba(5, 10, 8, 0.97);
  border: 1px solid rgba(0, 255, 163, 0.2);
  border-radius: 20px;
  backdrop-filter: blur(20px);
  box-shadow:
    0 -8px 40px rgba(0, 0, 0, 0.5),
    0 0 60px rgba(0, 255, 163, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* Glow accent line on top */
.cookie-banner__card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #00ffa3, transparent);
  border-radius: 0 0 2px 2px;
  opacity: 0.7;
}

.cookie-banner__header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.cookie-banner__icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(0, 255, 163, 0.1);
  border: 1px solid rgba(0, 255, 163, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.cookie-banner__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  line-height: 1.2;
}

.cookie-banner__text {
  color: #94a3b8;
  font-size: 0.88rem;
  line-height: 1.65;
  margin: 0 0 20px;
}

.cookie-banner__text a {
  color: #00ffa3;
  text-decoration: underline;
  text-decoration-color: rgba(0, 255, 163, 0.3);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.3s ease;
}

.cookie-banner__text a:hover {
  text-decoration-color: #00ffa3;
}

.cookie-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* ═══ CONSENT BUTTONS ═══ */
.cookie-btn {
  border: none;
  border-radius: 10px;
  padding: 12px 22px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.cookie-btn--accept {
  background: #00ffa3;
  color: #000;
  box-shadow: 0 4px 20px rgba(0, 255, 163, 0.25);
}

.cookie-btn--accept:hover {
  background: #4df9c5;
  box-shadow: 0 6px 28px rgba(0, 255, 163, 0.4);
  transform: translateY(-1px);
}

.cookie-btn--reject {
  background: rgba(255, 255, 255, 0.05);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.cookie-btn--reject:hover {
  background: rgba(255, 71, 87, 0.08);
  border-color: rgba(255, 71, 87, 0.3);
  color: #ff8c8c;
}

.cookie-btn--settings {
  background: transparent;
  color: #00ffa3;
  border: 1px solid rgba(0, 255, 163, 0.25);
}

.cookie-btn--settings:hover {
  background: rgba(0, 255, 163, 0.08);
  border-color: rgba(0, 255, 163, 0.5);
  box-shadow: 0 0 15px rgba(0, 255, 163, 0.1);
}

.cookie-btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}


/* ═══ SETTINGS MODAL ═══ */
.cookie-settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
  padding: 20px;
}

.cookie-settings-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

.cookie-settings {
  background: rgba(5, 10, 8, 0.98);
  border: 1px solid rgba(0, 255, 163, 0.2);
  border-radius: 20px;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.92) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.6),
    0 0 80px rgba(0, 255, 163, 0.05);
}

.cookie-settings-overlay.is-visible .cookie-settings {
  transform: scale(1) translateY(0);
}

/* Scrollbar inside modal */
.cookie-settings::-webkit-scrollbar { width: 5px; }
.cookie-settings::-webkit-scrollbar-thumb { background: rgba(0, 255, 163, 0.2); border-radius: 3px; }
.cookie-settings::-webkit-scrollbar-track { background: transparent; }

.cookie-settings__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.cookie-settings__header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cookie-settings__header-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(0, 255, 163, 0.1);
  border: 1px solid rgba(0, 255, 163, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.cookie-settings__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.cookie-settings__close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 71, 87, 0.08);
  border: 1px solid rgba(255, 71, 87, 0.15);
  color: #ff4757;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
  flex-shrink: 0;
}

.cookie-settings__close:hover {
  background: rgba(255, 71, 87, 0.18);
  border-color: rgba(255, 71, 87, 0.35);
}

.cookie-settings__close svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cookie-settings__body {
  padding: 20px 28px;
}

.cookie-settings__desc {
  color: #94a3b8;
  font-size: 0.85rem;
  line-height: 1.6;
  margin: 0 0 24px;
}


/* ═══ CATEGORY CARD ═══ */
.cookie-category {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 12px;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.cookie-category:hover {
  border-color: rgba(0, 255, 163, 0.15);
}

.cookie-category--active {
  border-color: rgba(0, 255, 163, 0.25);
  background: rgba(0, 255, 163, 0.02);
}

.cookie-category__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cookie-category__info {
  flex: 1;
  min-width: 0;
}

.cookie-category__name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cookie-category__badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 6px;
  line-height: 1;
}

.cookie-category__badge--required {
  background: rgba(0, 255, 163, 0.12);
  color: #00ffa3;
  border: 1px solid rgba(0, 255, 163, 0.2);
}

.cookie-category__badge--optional {
  background: rgba(255, 255, 255, 0.05);
  color: #64748b;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.cookie-category__desc {
  color: #64748b;
  font-size: 0.8rem;
  line-height: 1.5;
  margin: 0;
}


/* ═══ TOGGLE SWITCH ═══ */
.cookie-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

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

.cookie-toggle__track {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.cookie-toggle__track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #64748b;
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.cookie-toggle input:checked + .cookie-toggle__track {
  background: rgba(0, 255, 163, 0.15);
  border-color: rgba(0, 255, 163, 0.4);
}

.cookie-toggle input:checked + .cookie-toggle__track::after {
  background: #00ffa3;
  transform: translateX(20px);
  box-shadow: 0 0 10px rgba(0, 255, 163, 0.4);
}

/* Disabled state for required cookies */
.cookie-toggle input:disabled + .cookie-toggle__track {
  opacity: 0.5;
  cursor: not-allowed;
}

.cookie-toggle input:disabled:checked + .cookie-toggle__track {
  opacity: 0.7;
}


/* ═══ SETTINGS FOOTER ═══ */
.cookie-settings__footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 18px 28px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.cookie-settings__footer .cookie-btn {
  flex: 1;
  min-width: 120px;
  justify-content: center;
}


/* ═══ FLOATING COOKIE SETTINGS BUTTON ═══ */
.cookie-settings-trigger {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 99998;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(5, 10, 8, 0.92);
  border: 1px solid rgba(0, 255, 163, 0.2);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
}

.cookie-settings-trigger.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.cookie-settings-trigger:hover {
  background: rgba(0, 255, 163, 0.08);
  border-color: rgba(0, 255, 163, 0.4);
  box-shadow: 0 0 20px rgba(0, 255, 163, 0.15);
  transform: translateY(-2px);
}

.cookie-settings-trigger span {
  font-size: 20px;
  line-height: 1;
}


/* ═══ CONSENT TIMESTAMP BADGE ═══ */
.cookie-category__timestamp {
  display: block;
  margin-top: 8px;
  font-size: 0.72rem;
  color: #475569;
  font-family: 'JetBrains Mono', monospace;
}


/* ═══ ANIMATIONS ═══ */
@keyframes cookiePulse {
  0%, 100% { box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4); }
  50% { box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4), 0 0 15px rgba(0, 255, 163, 0.15); }
}

.cookie-settings-trigger.is-visible {
  animation: cookiePulse 3s ease-in-out infinite;
}

.cookie-settings-trigger.is-visible:hover {
  animation: none;
}


/* ═══ RESPONSIVE ═══ */
@media (max-width: 600px) {
  .cookie-banner__card {
    margin: 0 12px 12px;
    padding: 22px 20px 20px;
    border-radius: 16px;
  }

  .cookie-banner__actions {
    flex-direction: column;
  }

  .cookie-banner__actions .cookie-btn {
    width: 100%;
    justify-content: center;
  }

  .cookie-settings {
    max-height: 85vh;
    border-radius: 16px;
  }

  .cookie-settings__header {
    padding: 20px 20px 16px;
  }

  .cookie-settings__body {
    padding: 16px 20px;
  }

  .cookie-settings__footer {
    padding: 16px 20px 20px;
    flex-direction: column;
  }

  .cookie-settings__footer .cookie-btn {
    width: 100%;
    justify-content: center;
  }

  .cookie-settings-trigger {
    bottom: 14px;
    left: 14px;
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }
}

@media (max-width: 400px) {
  .cookie-banner__header {
    gap: 10px;
  }

  .cookie-banner__title {
    font-size: 1rem;
  }

  .cookie-banner__text {
    font-size: 0.82rem;
  }

  .cookie-category {
    padding: 14px 16px;
  }
}
