/* ============================================================
 * COOKIE CONSENT - Site geneli çerez onay popup'ı
 * Bottom-left konumlu, dark tema, neon-aksanlı card.
 * Mobilde bottom-fixed full-width banner'a dönüşür.
 * ============================================================ */

.cc {
  position: fixed;
  left: 22px;
  bottom: 22px;
  z-index: 9000;
  width: min(440px, calc(100vw - 32px));
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text, #e6ebf5);
  pointer-events: auto;
}
.cc[hidden] { display: none !important; }

.cc__shell {
  position: relative;
  background:
    linear-gradient(180deg, rgba(19,27,48,0.96) 0%, rgba(13,20,40,0.96) 100%);
  border: 1px solid var(--border-strong, rgba(148,163,184,0.22));
  border-radius: 18px;
  padding: 20px 20px 16px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.04) inset,
    0 24px 60px rgba(0,0,0,0.55),
    0 0 0 1px rgba(34,211,238,0.06);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  overflow: hidden;
  animation: ccIn 360ms cubic-bezier(.16,1,.3,1) both;
}

/* Üst neon hairline */
.cc__shell::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(34,211,238,0.55) 30%,
    rgba(56,189,248,0.55) 70%,
    transparent 100%);
  opacity: 0.7;
}
/* Soft glow */
.cc__shell::after {
  content: "";
  position: absolute;
  top: -40%;
  right: -30%;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(34,211,238,0.18), transparent 60%);
  pointer-events: none;
  filter: blur(20px);
}

@keyframes ccIn {
  from { transform: translateY(20px) scale(0.98); opacity: 0; }
  to   { transform: translateY(0)    scale(1);    opacity: 1; }
}
@keyframes ccOut {
  from { transform: translateY(0)    scale(1);    opacity: 1; }
  to   { transform: translateY(20px) scale(0.98); opacity: 0; }
}
.cc.is-closing .cc__shell { animation: ccOut 220ms cubic-bezier(.4,0,.6,1) both; }

/* ===== HEADER ===== */
.cc__head {
  display: grid;
  grid-template-columns: 36px 1fr 24px;
  gap: 12px;
  align-items: start;
  margin-bottom: 14px;
  position: relative;
}
.cc__ico {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(34,211,238,0.18), rgba(2,77,161,0.18));
  border: 1px solid rgba(34,211,238,0.28);
  color: var(--neon, #22d3ee);
  flex-shrink: 0;
}
.cc__head-text { min-width: 0; }
.cc__title {
  margin: 0 0 4px;
  font-family: 'Manrope', 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text, #e6ebf5);
}
.cc__desc {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-muted, #94a3b8);
}
.cc__desc a {
  color: var(--neon, #22d3ee);
  text-decoration: none;
  border-bottom: 1px dashed rgba(34,211,238,0.35);
  transition: border-color .2s, color .2s;
}
.cc__desc a:hover {
  color: #67e8f9;
  border-bottom-color: rgba(34,211,238,0.7);
}
.cc__x {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  background: rgba(148,163,184,0.08);
  border: 1px solid var(--border, rgba(148,163,184,0.10));
  color: var(--text-muted, #94a3b8);
  border-radius: 6px;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
  padding: 0;
}
.cc__x:hover {
  background: rgba(248,113,113,0.12);
  color: #f87171;
  border-color: rgba(248,113,113,0.3);
}

/* ===== PANEL (settings) ===== */
.cc__panel {
  margin-bottom: 14px;
  padding: 14px;
  background: rgba(6,10,22,0.5);
  border: 1px solid var(--border, rgba(148,163,184,0.10));
  border-radius: 12px;
  max-height: 320px;
  overflow-y: auto;
  animation: ccPanelIn 280ms cubic-bezier(.16,1,.3,1) both;
}
.cc__panel[hidden] { display: none; }

@keyframes ccPanelIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.cc__panel::-webkit-scrollbar { width: 6px; }
.cc__panel::-webkit-scrollbar-track { background: transparent; }
.cc__panel::-webkit-scrollbar-thumb {
  background: rgba(148,163,184,0.2);
  border-radius: 3px;
}

.cc__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cc__row {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  align-items: start;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border, rgba(148,163,184,0.08));
}
.cc__row:last-child { border-bottom: none; padding-bottom: 4px; }
.cc__row-text { min-width: 0; }
.cc__row-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #e6ebf5);
  margin-bottom: 3px;
}
.cc__row-desc {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted, #94a3b8);
}
.cc__pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(34,211,238,0.12);
  color: var(--neon, #22d3ee);
  border: 1px solid rgba(34,211,238,0.25);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* ===== SWITCH ===== */
.cc__switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  cursor: pointer;
  margin-top: 1px;
  flex-shrink: 0;
}
.cc__switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 100%;
  height: 100%;
  margin: 0;
}
.cc__track {
  position: absolute;
  inset: 0;
  background: rgba(148,163,184,0.22);
  border-radius: 999px;
  transition: background .25s ease;
  border: 1px solid rgba(148,163,184,0.18);
}
.cc__thumb {
  position: absolute;
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  transition: left .25s cubic-bezier(.4,0,.2,1), background .25s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.cc__switch input:checked ~ .cc__track {
  background: linear-gradient(135deg, var(--neon, #22d3ee), var(--neon-2, #38bdf8));
  border-color: transparent;
  box-shadow: 0 0 12px rgba(34,211,238,0.4);
}
.cc__switch input:checked ~ .cc__track .cc__thumb { left: 18px; }
.cc__switch.is-locked { cursor: not-allowed; opacity: 0.85; }
.cc__switch.is-locked input:checked ~ .cc__track {
  background: linear-gradient(135deg, rgba(34,211,238,0.6), rgba(56,189,248,0.6));
  box-shadow: none;
}

/* ===== ACTIONS ===== */
.cc__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Üst satır: ayarlar link'i (sade, ince) */
.cc__settings-link {
  align-self: flex-start;
  background: transparent;
  border: 0;
  padding: 4px 2px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px dashed transparent;
  transition: color .2s, border-color .2s;
  line-height: 1;
}
.cc__settings-link:hover {
  color: var(--neon, #22d3ee);
  border-bottom-color: rgba(34,211,238,0.4);
}
.cc__settings-link svg { transition: transform .2s; }
.cc__settings-link[aria-expanded="true"] svg { transform: rotate(60deg); }
.cc__settings-link[aria-expanded="true"] {
  color: var(--neon, #22d3ee);
}

/* Alt satır: 2 buton eşit genişlikte */
.cc__actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.cc__btn {
  font-family: inherit;
  font-weight: 600;
  font-size: 13px;
  border-radius: 10px;
  padding: 11px 14px;
  cursor: pointer;
  transition: transform .15s, background .2s, color .2s, border-color .2s, box-shadow .2s, filter .2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  line-height: 1;
  white-space: nowrap;
  width: 100%;
}
.cc__btn:active { transform: translateY(1px); }
.cc__btn[hidden] { display: none; }

.cc__btn--primary {
  background: linear-gradient(135deg, var(--neon, #22d3ee) 0%, var(--neon-2, #38bdf8) 100%);
  color: #0a1020;
  box-shadow: 0 8px 24px rgba(34,211,238,0.25), 0 0 0 1px rgba(34,211,238,0.3);
}
.cc__btn--primary:hover {
  box-shadow: 0 12px 30px rgba(34,211,238,0.4), 0 0 0 1px rgba(34,211,238,0.5);
  filter: brightness(1.05);
}

.cc__btn--soft {
  background: rgba(148,163,184,0.08);
  color: var(--text, #e6ebf5);
  border-color: var(--border-strong, rgba(148,163,184,0.22));
}
.cc__btn--soft:hover {
  background: rgba(148,163,184,0.14);
  border-color: rgba(148,163,184,0.35);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .cc {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
  }
  .cc__shell {
    padding: 16px 16px 14px;
    border-radius: 16px;
  }
  .cc__head {
    grid-template-columns: 32px 1fr 24px;
    gap: 10px;
  }
  .cc__ico { width: 32px; height: 32px; border-radius: 8px; }
  .cc__title { font-size: 14px; }
  .cc__desc { font-size: 12px; }
  .cc__actions { gap: 8px; }
  .cc__btn { padding: 12px 14px; font-size: 13px; }
  .cc__settings-link { font-size: 12px; }
}

/* Back-to-top butonu (bottom-left) ile çakışma yönetimi:
   Cookie consent gösterilirken back-to-top'ı yukarı it. */
body.cc-open .back-to-top {
  bottom: calc(22px + var(--cc-h, 230px));
}

/* Mobil sticky bant ile çakışmasın - m-bant ≤768px'de görünür */
@media (max-width: 768px) {
  body:has(.m-bant) .cc { bottom: calc(12px + 70px); }
  body.cc-open .back-to-top { bottom: calc(96px + var(--cc-h, 230px)); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .cc__shell, .cc__panel, .cc__thumb, .cc__btn, .cc__btn--ghost svg {
    animation: none !important;
    transition: none !important;
  }
}
