/* ===== Nexivium Cookie Consent – Frontend Banner ===== */

:root {
  --ncc-primary: #2563eb;
  --ncc-secondary: #64748b;
  --ncc-text: #111827;
  --ncc-bg: #ffffff;
  --ncc-radius: 8px;
  --ncc-font-size: 14px;
  --ncc-shadow: 0 4px 24px rgba(0,0,0,.15);
  --ncc-z: 999999;
}

/* ===== Banner Wrapper ===== */
.ncc-banner {
  position: fixed;
  left: 0;
  right: 0;
  z-index: var(--ncc-z);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: var(--ncc-font-size);
  color: var(--ncc-text);
  animation: ncc-slide-in .3s ease;
}

.ncc-banner.ncc-pos-bottom { bottom: 0; }
.ncc-banner.ncc-pos-top    { top: 0; }
.ncc-banner.ncc-pos-center {
  top: 50%;
  left: 50%;
  right: auto;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 32px));
}

/* ===== Inner Layout ===== */
.ncc-banner-inner {
  background: var(--ncc-bg);
  border-radius: var(--ncc-radius);
  box-shadow: var(--ncc-shadow);
  padding: 20px 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

/* Bar layout: single horizontal row */
.ncc-layout-bar .ncc-banner-inner {
  flex-direction: row;
  align-items: center;
  border-radius: 0;
}

/* Box layout */
.ncc-layout-box .ncc-banner-inner {
  max-width: 480px;
  margin: 16px auto;
  flex-direction: column;
}

/* Popup layout */
.ncc-layout-popup .ncc-banner-inner {
  max-width: 520px;
  margin: 16px auto;
  flex-direction: column;
}

/* ===== Parts ===== */
.ncc-banner-logo img {
  max-height: 36px;
  max-width: 120px;
  width: auto;
  display: block;
}

.ncc-banner-body {
  flex: 1;
  min-width: 0;
}

.ncc-banner-title {
  margin: 0 0 4px;
  font-size: calc(var(--ncc-font-size) + 2px);
  font-weight: 700;
  color: var(--ncc-text);
  line-height: 1.3;
}

.ncc-banner-text {
  margin: 0 0 8px;
  opacity: .8;
  line-height: 1.5;
}

.ncc-banner-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ncc-banner-links a {
  font-size: calc(var(--ncc-font-size) - 1px);
  color: var(--ncc-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ncc-banner-links a:hover {
  opacity: .75;
}

/* ===== Buttons ===== */
.ncc-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.ncc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 18px;
  border-radius: calc(var(--ncc-radius) - 2px);
  font-size: var(--ncc-font-size);
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: opacity .15s, transform .1s;
  white-space: nowrap;
  line-height: 1;
  font-family: inherit;
}

.ncc-btn:active { transform: scale(.97); }

.ncc-btn-primary {
  background: var(--ncc-primary);
  color: #fff;
  border-color: var(--ncc-primary);
}
.ncc-btn-primary:hover { opacity: .88; }

.ncc-btn-secondary {
  background: transparent;
  color: var(--ncc-text);
  border-color: currentColor;
  opacity: .8;
}
.ncc-btn-secondary:hover { opacity: 1; }

.ncc-btn-ghost {
  background: transparent;
  color: var(--ncc-secondary);
  border-color: transparent;
  padding-left: 8px;
  padding-right: 8px;
}
.ncc-btn-ghost:hover { color: var(--ncc-text); }

/* ===== Re-open Button ===== */
.ncc-reopen-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: var(--ncc-z);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--ncc-primary);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
  transition: transform .15s, opacity .15s;
}
.ncc-reopen-btn:hover { transform: scale(1.08); }

/* ===== Modal Overlay ===== */
.ncc-modal {
  position: fixed;
  inset: 0;
  z-index: calc(var(--ncc-z) + 1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: var(--ncc-font-size);
}

.ncc-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(2px);
}

.ncc-modal-box {
  position: relative;
  background: var(--ncc-bg);
  border-radius: var(--ncc-radius);
  box-shadow: var(--ncc-shadow);
  width: min(600px, calc(100vw - 24px));
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: ncc-modal-in .2s ease;
}

/* ===== Modal Parts ===== */
.ncc-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(0,0,0,.08);
  flex-shrink: 0;
}

.ncc-modal-logo {
  max-height: 28px;
  max-width: 100px;
  width: auto;
}

.ncc-modal-header h2 {
  margin: 0;
  flex: 1;
  font-size: calc(var(--ncc-font-size) + 4px);
  font-weight: 700;
  color: var(--ncc-text);
}

.ncc-modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  color: var(--ncc-secondary);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: inherit;
}
.ncc-modal-close:hover {
  background: rgba(0,0,0,.06);
  color: var(--ncc-text);
}

.ncc-modal-body {
  overflow-y: auto;
  flex: 1;
  padding: 0 24px;
}

/* ===== Category Items ===== */
.ncc-cat-item {
  padding: 16px 0;
  border-bottom: 1px solid rgba(0,0,0,.06);
}
.ncc-cat-item:last-child { border-bottom: none; }

.ncc-cat-header-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  justify-content: space-between;
}

.ncc-cat-info { flex: 1; }

.ncc-cat-info strong {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--ncc-text);
}

.ncc-cat-info p {
  margin: 0;
  font-size: calc(var(--ncc-font-size) - 1px);
  opacity: .7;
  line-height: 1.5;
}

.ncc-cat-toggle { flex-shrink: 0; }

.ncc-always-active {
  font-size: calc(var(--ncc-font-size) - 2px);
  color: #16a34a;
  font-weight: 600;
  background: #dcfce7;
  padding: 3px 8px;
  border-radius: 9999px;
}

/* Toggle Switch (matches admin) */
.ncc-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.ncc-switch input { opacity: 0; width: 0; height: 0; }
.ncc-slider {
  position: absolute;
  inset: 0;
  background: #d1d5db;
  border-radius: 24px;
  cursor: pointer;
  transition: background .2s;
}
.ncc-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.ncc-switch input:checked + .ncc-slider { background: var(--ncc-primary); }
.ncc-switch input:checked + .ncc-slider::before { transform: translateX(20px); }

/* Cookie details table */
.ncc-cookie-details {
  margin-top: 10px;
}
.ncc-cookie-details summary {
  cursor: pointer;
  font-size: calc(var(--ncc-font-size) - 1px);
  color: var(--ncc-primary);
  font-weight: 500;
  padding: 4px 0;
}
.ncc-cookie-list {
  width: 100%;
  border-collapse: collapse;
  font-size: calc(var(--ncc-font-size) - 2px);
  margin-top: 8px;
}
.ncc-cookie-list th,
.ncc-cookie-list td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid rgba(0,0,0,.06);
}
.ncc-cookie-list th {
  font-weight: 600;
  opacity: .6;
  font-size: 11px;
  text-transform: uppercase;
}

/* ===== Modal Footer ===== */
.ncc-modal-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid rgba(0,0,0,.08);
  flex-shrink: 0;
}

.ncc-powered-by {
  text-align: center;
  font-size: 11px;
  opacity: .4;
  margin: 0 0 12px;
  color: var(--ncc-text);
}

/* ===== Animations ===== */
@keyframes ncc-slide-in {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.ncc-pos-top  { animation-name: ncc-slide-down; }
@keyframes ncc-slide-down {
  from { transform: translateY(-20px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}
.ncc-pos-center { animation-name: ncc-fade-in; }
@keyframes ncc-fade-in {
  from { opacity: 0; transform: translate(-50%, calc(-50% + 10px)); }
  to   { opacity: 1; transform: translate(-50%, -50%); }
}

@keyframes ncc-modal-in {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .ncc-banner-inner { flex-direction: column; }
  .ncc-banner-actions { width: 100%; }
  .ncc-btn { flex: 1; justify-content: center; }
  .ncc-modal-box { border-radius: var(--ncc-radius) var(--ncc-radius) 0 0; align-self: flex-end; max-height: 85vh; width: 100%; }
}
