/* =====================================================================
   NoGame.ro — cookie consent component (GDPR / Romanian law compliant).
   Shared, self-contained, no dependencies. Dark neutral theme with gold
   and green accents so it fits the Metin2 / portal / Zombie Plague sites.

   Usage: <link rel="stylesheet" href="assets/cookie/cookie.css">
   Behaviour: assets/cookie/cookie.js
   ===================================================================== */

:root {
  --ng-cookie-bg: #171310;
  --ng-cookie-panel: #1d1813;
  --ng-cookie-border: #6b5836;
  --ng-cookie-text: #d9cfbc;
  --ng-cookie-muted: #9a8f7d;
  --ng-cookie-accent: #e8b44a;
  --ng-cookie-green: #2f6b33;
  --ng-cookie-green-hover: #3d8a43;
}

/* The component is hidden until the JS decides it is needed. */
[hidden] { display: none !important; }

.ng-cookie,
.ng-cookie * { box-sizing: border-box; }

/* ---------------------------------------------------------------------
   1. First layer — bottom bar
   --------------------------------------------------------------------- */
.ng-cookie {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 2147483000;
  padding: 16px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ng-cookie-text);
}

.ng-cookie__inner {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 24px;
  padding: 18px 52px 18px 20px;
  background: var(--ng-cookie-bg);
  border: 2px solid var(--ng-cookie-border);
  border-radius: 8px;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, .65), inset 0 0 0 1px #000;
}

.ng-cookie__text {
  flex: 1 1 420px;
  min-width: 0;
}

.ng-cookie__title {
  margin: 0 0 4px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.1rem;
  color: var(--ng-cookie-accent);
}

.ng-cookie__desc {
  margin: 0;
  font-size: .9rem;
  color: var(--ng-cookie-muted);
}

.ng-cookie__link {
  color: var(--ng-cookie-accent);
  text-decoration: underline;
}
.ng-cookie__link:hover { color: #f5cd75; }

.ng-cookie__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

/* Buttons — Accept / Reject carry the same visual weight on purpose. */
.ng-cookie__btn {
  appearance: none;
  min-height: 42px;
  padding: 10px 18px;
  border: 1px solid #5a5044;
  border-radius: 4px;
  background: #3a332a;
  color: #f4efe4;
  font: inherit;
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.ng-cookie__btn:hover { background: #473f33; }
.ng-cookie__btn:focus-visible {
  outline: 3px solid var(--ng-cookie-accent);
  outline-offset: 2px;
}
.ng-cookie__btn--accept {
  background: var(--ng-cookie-green);
  border-color: #1d4a22;
  color: #eafbe9;
}
.ng-cookie__btn--accept:hover { background: var(--ng-cookie-green-hover); }
.ng-cookie__btn--settings {
  background: transparent;
  border-color: var(--ng-cookie-border);
  color: var(--ng-cookie-accent);
}
.ng-cookie__btn--settings:hover { background: rgba(232, 180, 74, .1); }

.ng-cookie__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--ng-cookie-border);
  border-radius: 4px;
  background: transparent;
  color: var(--ng-cookie-muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}
.ng-cookie__close:hover {
  color: var(--ng-cookie-accent);
  border-color: var(--ng-cookie-accent);
}
.ng-cookie__close:focus-visible {
  outline: 3px solid var(--ng-cookie-accent);
  outline-offset: 2px;
}

/* Keep the page footer reachable while the bar is shown. */
body.ng-cookie-open { padding-bottom: 150px; }

/* ---------------------------------------------------------------------
   2. Second layer — granular settings modal
   --------------------------------------------------------------------- */
.ng-cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.ng-cookie-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .72);
}

.ng-cookie-modal__panel {
  position: relative;
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 26px 24px 22px;
  background: var(--ng-cookie-panel);
  border: 2px solid var(--ng-cookie-border);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .7), inset 0 0 0 1px #000;
  color: var(--ng-cookie-text);
}

.ng-cookie-modal__title {
  margin: 0 0 6px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  color: var(--ng-cookie-accent);
}

.ng-cookie-modal__lead {
  margin: 0 0 16px;
  font-size: .9rem;
  color: var(--ng-cookie-muted);
}

.ng-cookie-cats {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
}

.ng-cookie-cat {
  padding: 14px 0;
  border-bottom: 1px solid rgba(107, 88, 54, .35);
}
.ng-cookie-cat:last-child { border-bottom: 0; }

.ng-cookie-cat__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.ng-cookie-cat__labels {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ng-cookie-cat__name {
  font-weight: 700;
  color: var(--ng-cookie-accent);
}

.ng-cookie-cat__badge {
  padding: 2px 9px;
  border: 1px solid var(--ng-cookie-border);
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ng-cookie-muted);
  white-space: nowrap;
}

.ng-cookie-cat__desc {
  margin: 6px 0 0;
  font-size: .87rem;
  color: var(--ng-cookie-muted);
}

/* Toggle switch */
.ng-cookie-switch {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  width: 46px;
  height: 26px;
}
.ng-cookie-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.ng-cookie-switch__track {
  position: absolute;
  inset: 0;
  border: 1px solid #5a5044;
  border-radius: 999px;
  background: #3a332a;
  transition: background .15s ease, border-color .15s ease;
  pointer-events: none;
}
.ng-cookie-switch__track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #cfc4ad;
  transition: transform .15s ease, background .15s ease;
}
.ng-cookie-switch input:checked + .ng-cookie-switch__track {
  background: var(--ng-cookie-green);
  border-color: #1d4a22;
}
.ng-cookie-switch input:checked + .ng-cookie-switch__track::after {
  transform: translateX(20px);
  background: #fff;
}
.ng-cookie-switch input:focus-visible + .ng-cookie-switch__track {
  outline: 3px solid var(--ng-cookie-accent);
  outline-offset: 2px;
}
.ng-cookie-switch input:disabled { cursor: not-allowed; }
.ng-cookie-switch input:disabled + .ng-cookie-switch__track { opacity: .5; }

.ng-cookie-modal__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

/* ---------------------------------------------------------------------
   3. Responsive
   --------------------------------------------------------------------- */
@media (max-width: 640px) {
  .ng-cookie { padding: 10px; }
  .ng-cookie__inner { padding: 16px 48px 16px 16px; }
  .ng-cookie__actions { flex: 1 1 100%; }
  .ng-cookie__btn { flex: 1 1 auto; text-align: center; }
  .ng-cookie-modal { padding: 12px; }
  .ng-cookie-modal__actions .ng-cookie__btn { flex: 1 1 100%; }
  body.ng-cookie-open { padding-bottom: 300px; }
}
