/*
 * cookie-banner.css — Nottworks Cookie Consent System
 * KVKK & GDPR Compliant Banner & Preferences Modal
 */

.nw-cookie-consent {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 99999;
  font-family: var(--font-body, 'Manrope', -apple-system, sans-serif);
}

/* Floating Banner */
.nw-cookie-banner {
  background-color: #ffffff;
  border-top: 1px solid rgba(17, 24, 39, 0.08);
  box-shadow: 0 -8px 30px rgba(17, 24, 39, 0.08);
  padding: 1.25rem 0;
  animation: nwCookieSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes nwCookieSlideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.nw-cookie-banner__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

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

.nw-cookie-banner__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.nw-cookie-banner__icon {
  display: flex;
  align-items: center;
  color: var(--color-ink-navy, #111827);
}

.nw-cookie-banner__title {
  font-family: var(--font-heading, 'Manrope', sans-serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-ink-navy, #111827);
  margin: 0;
  line-height: 1.3;
}

.nw-cookie-banner__desc {
  font-size: 0.84375rem;
  line-height: 1.55;
  color: #475569;
  margin: 0;
}

.nw-cookie-banner__desc a {
  color: var(--color-ink-navy, #111827);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.18s ease;
}

.nw-cookie-banner__desc a:hover {
  color: var(--color-accent-blue, #4D9BE8);
}

/* Action Buttons */
.nw-cookie-banner__actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.nw-cookie-btn {
  font-family: var(--font-body, 'Manrope', sans-serif);
  font-size: 0.8125rem;
  font-weight: 600;
  height: 38px;
  padding: 0 1.15rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  outline: none;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nw-cookie-btn--accept {
  background-color: var(--color-ink-navy, #111827) !important;
  color: #ffffff !important;
  border-color: var(--color-ink-navy, #111827) !important;
}

.nw-cookie-btn--accept:hover,
.nw-cookie-btn--accept:focus-visible {
  background-color: #1e293b !important;
  color: #ffffff !important;
  border-color: #1e293b !important;
  transform: translateY(-1px);
}

.nw-cookie-btn--reject {
  background-color: #ffffff !important;
  color: var(--color-ink-navy, #111827) !important;
  border-color: rgba(17, 24, 39, 0.18) !important;
}

.nw-cookie-btn--reject:hover,
.nw-cookie-btn--reject:focus-visible {
  background-color: var(--color-ink-navy, #111827) !important;
  color: #ffffff !important;
  border-color: var(--color-ink-navy, #111827) !important;
  transform: translateY(-1px);
}

.nw-cookie-btn--customize {
  background-color: transparent !important;
  color: #334155 !important;
  border-color: rgba(17, 24, 39, 0.14) !important;
}

.nw-cookie-btn--customize:hover,
.nw-cookie-btn--customize:focus-visible {
  background-color: #f1f5f9 !important;
  color: var(--color-ink-navy, #111827) !important;
  border-color: rgba(17, 24, 39, 0.3) !important;
  transform: translateY(-1px);
}

/* Detailed Preferences Modal */
.nw-cookie-modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(17, 24, 39, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  box-sizing: border-box;
  animation: nwCookieFadeIn 0.2s ease forwards;
}

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

.nw-cookie-modal {
  background-color: #ffffff;
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  border-radius: 20px;
  box-shadow: 0 20px 45px rgba(17, 24, 39, 0.16);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: nwCookieZoomIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes nwCookieZoomIn {
  from {
    transform: scale(0.96);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.nw-cookie-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
}

.nw-cookie-modal__title {
  font-family: var(--font-heading, 'Manrope', sans-serif);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-ink-navy, #111827);
  margin: 0;
}

.nw-cookie-modal__close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.18s ease;
}

.nw-cookie-modal__close:hover {
  color: var(--color-ink-navy, #111827);
}

.nw-cookie-modal__body {
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.nw-cookie-modal__intro {
  font-size: 0.875rem;
  line-height: 1.6;
  color: #475569;
  margin: 0 0 0.5rem 0;
}

/* Category Item */
.nw-cookie-cat {
  padding: 1rem;
  border-radius: 12px;
  background-color: #f8fafc;
  border: 1px solid rgba(17, 24, 39, 0.06);
}

.nw-cookie-cat__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.35rem;
}

.nw-cookie-cat__info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.nw-cookie-cat__name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--color-ink-navy, #111827);
  margin: 0;
}

.nw-cookie-cat__badge {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 4px;
  background-color: rgba(16, 185, 129, 0.12);
  color: #059669;
}

.nw-cookie-cat__desc {
  font-size: 0.8125rem;
  line-height: 1.55;
  color: #64748b;
  margin: 0;
}

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

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

.nw-switch__slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #cbd5e1;
  transition: 0.25s ease;
  border-radius: 24px;
}

.nw-switch__slider::before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.25s ease;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.nw-switch input:checked + .nw-switch__slider {
  background-color: var(--color-ink-navy, #111827);
}

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

.nw-switch--disabled .nw-switch__slider {
  background-color: #94a3b8;
  cursor: not-allowed;
}

.nw-cookie-modal__footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(17, 24, 39, 0.08);
  display: flex;
  justify-content: flex-end;
}

.nw-cookie-btn--save {
  background-color: var(--color-ink-navy, #111827) !important;
  color: #ffffff !important;
  border-color: var(--color-ink-navy, #111827) !important;
  padding: 0 1.5rem;
}

.nw-cookie-btn--save:hover,
.nw-cookie-btn--save:focus-visible {
  background-color: #1e293b !important;
  color: #ffffff !important;
  border-color: #1e293b !important;
}

/* Footer trigger button */
.nw-cookie-preferences-trigger {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

.nw-cookie-preferences-trigger:hover {
  color: var(--color-accent-blue, #4D9BE8);
}

/* Responsive (Mobile <= 768px) */
@media (max-width: 768px) {
  .nw-cookie-banner__inner {
    flex-direction: column;
    align-items: stretch;
    gap: 1.15rem;
  }

  .nw-cookie-banner__actions {
    flex-direction: column;
    width: 100%;
    gap: 0.5rem;
  }

  .nw-cookie-btn {
    width: 100%;
    height: 40px;
    font-size: 0.875rem;
  }

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