/* ================================================================
   MegaMC Cookie Consent — fully custom, no third-party library
   ================================================================ */

:root {
  --mc-bg:       #111827;
  --mc-bg2:      #0d1526;
  --mc-border:   #1e2d48;
  --mc-border2:  #253554;
  --mc-accent:   #4ade80;
  --mc-accent-h: #22c55e;
  --mc-text:     #f1f5f9;
  --mc-muted:    #94a3b8;
  --mc-dim:      #64748b;
  --mc-shadow:   0 8px 40px rgba(0,0,0,.65), 0 0 0 1px rgba(255,255,255,.05);
  --mc-r:        12px;
  --mc-t:        .25s ease;
}

/* ── Banner ────────────────────────────────────────────────────── */

#mc-banner {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  width: 360px;
  max-width: calc(100vw - 32px);
  background: var(--mc-bg);
  border: 1px solid var(--mc-border);
  border-radius: var(--mc-r);
  box-shadow: var(--mc-shadow);
  padding: 18px 18px 18px 16px;
  display: flex;
  align-items: flex-start;
  gap: 13px;
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--mc-text);
  animation: mc-up .38s cubic-bezier(.16,1,.3,1) both;
}

#mc-banner.mc-out {
  animation: mc-down .3s ease forwards;
}

.mc-banner-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: var(--mc-accent);
  color: #0d1526;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mc-banner-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 13px;
  min-width: 0;
}

.mc-banner-text {
  font-size: 13px;
  line-height: 1.55;
  color: var(--mc-muted);
}
.mc-banner-text p { margin: 0; }

.mc-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* ── Buttons ───────────────────────────────────────────────────── */

.mc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  padding: 8px 16px;
  transition: background var(--mc-t), color var(--mc-t), border-color var(--mc-t), transform .12s;
  white-space: nowrap;
}
.mc-btn:active { transform: scale(.97); }
.mc-btn:focus-visible {
  outline: 2px solid var(--mc-accent);
  outline-offset: 2px;
}

.mc-btn-primary {
  background: var(--mc-accent);
  color: #0d1526;
}
.mc-btn-primary:hover { background: var(--mc-accent-h); }

.mc-btn-outline {
  background: transparent;
  color: var(--mc-text);
  border-color: var(--mc-border);
}
.mc-btn-outline:hover {
  border-color: var(--mc-accent);
  color: var(--mc-accent);
}

.mc-btn-ghost {
  background: transparent;
  color: var(--mc-dim);
  padding: 8px 10px;
}
.mc-btn-ghost:hover { color: var(--mc-accent); }

/* ── Modal overlay ─────────────────────────────────────────────── */

#mc-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(0, 0, 0, .68);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: mc-fade-in .22s ease both;
}

#mc-modal-overlay.mc-out {
  animation: mc-fade-out .24s ease forwards;
}

#mc-modal {
  background: var(--mc-bg);
  border: 1px solid var(--mc-border);
  border-radius: 16px;
  box-shadow: var(--mc-shadow);
  width: 100%;
  max-width: 500px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  font-family: 'Inter', system-ui, sans-serif;
  animation: mc-scale-in .3s cubic-bezier(.16,1,.3,1) both;
  overflow: hidden;
}

#mc-modal-overlay.mc-out #mc-modal {
  animation: mc-scale-out .24s ease forwards;
}

/* Modal header */
.mc-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--mc-border);
  flex-shrink: 0;
}
.mc-modal-head h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--mc-text);
  margin: 0;
}

.mc-close {
  background: transparent;
  border: none;
  color: var(--mc-dim);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: color var(--mc-t);
  flex-shrink: 0;
}
.mc-close:hover { color: var(--mc-text); }
.mc-close:focus-visible {
  outline: 2px solid var(--mc-accent);
  outline-offset: 2px;
}

/* Modal body */
.mc-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  scrollbar-width: thin;
  scrollbar-color: var(--mc-border) transparent;
}
.mc-modal-body::-webkit-scrollbar { width: 5px; }
.mc-modal-body::-webkit-scrollbar-track { background: transparent; }
.mc-modal-body::-webkit-scrollbar-thumb { background: var(--mc-border); border-radius: 9px; }

.mc-modal-intro {
  font-size: 13px;
  line-height: 1.6;
  color: var(--mc-muted);
}
.mc-modal-intro p { margin: 0; }

/* Categories */
.mc-cats {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mc-category {
  background: var(--mc-bg2);
  border: 1px solid var(--mc-border);
  border-radius: 10px;
  padding: 14px 16px;
  transition: border-color var(--mc-t);
}

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

.mc-cat-info { flex: 1; min-width: 0; }

.mc-cat-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--mc-text);
  margin-bottom: 4px;
}

.mc-cat-desc {
  font-size: 12px;
  line-height: 1.5;
  color: var(--mc-dim);
}
.mc-cat-desc p { margin: 0; }

/* ── Toggle switch ─────────────────────────────────────────────── */

.mc-toggle {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  user-select: none;
}

.mc-toggle-locked {
  cursor: not-allowed;
  opacity: .5;
}

.mc-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.mc-track {
  position: relative;
  display: block;
  width: 44px;
  height: 24px;
  background: var(--mc-border);
  border-radius: 12px;
  transition: background var(--mc-t);
}

.mc-toggle input:checked ~ .mc-track {
  background: var(--mc-accent);
}

.mc-toggle:not(.mc-toggle-locked):hover .mc-track {
  filter: brightness(1.15);
}

.mc-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--mc-t);
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}

.mc-toggle input:checked ~ .mc-track .mc-thumb {
  transform: translateX(20px);
}

.mc-toggle-state {
  font-size: 10px;
  font-weight: 700;
  color: var(--mc-dim);
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* Modal footer */
.mc-modal-foot {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 22px 20px;
  border-top: 1px solid var(--mc-border);
  flex-shrink: 0;
}

/* ── Cookie icon (floating button) ────────────────────────────── */

#mc-icon {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99998;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--mc-accent);
  color: #0d1526;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(74, 222, 128, .4);
  transition: transform var(--mc-t), box-shadow var(--mc-t);
}
#mc-icon:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(74, 222, 128, .6);
}
#mc-icon:focus-visible {
  outline: 2px solid var(--mc-accent);
  outline-offset: 3px;
}

/* ── Keyframes ─────────────────────────────────────────────────── */

@keyframes mc-up {
  from { opacity: 0; transform: translateY(18px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
@keyframes mc-down {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translateY(18px) scale(.97); }
}
@keyframes mc-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes mc-fade-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}
@keyframes mc-scale-in {
  from { opacity: 0; transform: scale(.94); }
  to   { opacity: 1; transform: none; }
}
@keyframes mc-scale-out {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: scale(.94); }
}

/* ── Mobile ────────────────────────────────────────────────────── */

@media (max-width: 460px) {
  #mc-banner {
    bottom: 0;
    right: 0;
    left: 0;
    max-width: 100%;
    width: 100%;
    border-radius: var(--mc-r) var(--mc-r) 0 0;
    border-bottom: none;
  }
  .mc-banner-actions {
    flex-direction: column;
  }
  .mc-banner-actions .mc-btn {
    width: 100%;
  }
  #mc-icon {
    bottom: 16px;
    right: 16px;
  }
}
