/* ==========================================================================
   Dvojka Studio — GDPR cookie consent banner
   Používá tematické proměnné webu (--bg, --text, --accent, ...), takže
   automaticky sleduje přepínač světlého/tmavého motivu.
   ========================================================================== */

.cc-banner,
.cc-prefs {
  position: fixed;
  z-index: 10000;
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  box-shadow: var(--shadow-md), 0 12px 40px rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-family: 'Manrope', sans-serif;
  max-width: 440px;
  width: calc(100% - 24px);
}

.cc-banner {
  left: 12px;
  bottom: 12px;
  padding: 20px 22px 18px;
  animation: cc-rise 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cc-rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .cc-banner { animation: none; }
}

.cc-banner h2 {
  font-family: 'Syne', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-strong);
  margin: 0 0 8px;
  line-height: 1.3;
}

.cc-banner p {
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0 0 14px;
}

.cc-banner p a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cc-banner p a:hover { color: var(--accent-hover); }

/* Button row */
.cc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.cc-btn {
  font-family: 'Manrope', sans-serif;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 0.18s ease, color 0.18s ease,
              border-color 0.18s ease, transform 0.18s ease;
  white-space: nowrap;
}

.cc-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.cc-btn-primary {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}
.cc-btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-1px);
}

.cc-btn-secondary {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border-strong);
}
.cc-btn-secondary:hover {
  color: var(--text);
  border-color: var(--text-muted);
  background: var(--bg-overlay);
}

.cc-btn-link {
  background: transparent;
  color: var(--text-muted);
  border: none;
  padding: 10px 8px;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
}
.cc-btn-link:hover { color: var(--text); }

/* ---------- Preferences modal ---------- */
.cc-prefs {
  /* hidden by default via JS */
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: 480px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 24px 24px 20px;
  animation: cc-rise 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

.cc-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: cc-fade 0.2s ease;
}
:root[data-theme="light"] .cc-backdrop {
  background: rgba(15, 15, 20, 0.4);
}

@keyframes cc-fade { from { opacity: 0; } to { opacity: 1; } }

.cc-prefs h2 {
  font-family: 'Syne', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-strong);
  margin: 0 0 6px;
}

.cc-prefs .cc-intro {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 18px;
  line-height: 1.5;
}

.cc-category {
  border-top: 1px solid var(--border);
  padding: 14px 0;
}

.cc-cat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cc-cat-head strong {
  font-size: 0.92rem;
  color: var(--text-strong);
  font-weight: 600;
}

.cc-cat-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 4px 0 0;
}

/* Toggle switch */
.cc-toggle {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}
.cc-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.cc-toggle .cc-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--bg-overlay);
  border: 1px solid var(--border-strong);
  border-radius: 9999px;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.cc-toggle .cc-slider::before {
  content: '';
  position: absolute;
  height: 14px;
  width: 14px;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform 0.2s ease, background-color 0.2s ease;
}
.cc-toggle input:checked + .cc-slider {
  background: var(--accent);
  border-color: var(--accent);
}
.cc-toggle input:checked + .cc-slider::before {
  transform: translate(18px, -50%);
  background: #ffffff;
}
.cc-toggle input:checked + .cc-slider { background: var(--accent); }
.cc-toggle input:focus-visible + .cc-slider {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
/* "Always on" variant — disabled, locked to on */
.cc-toggle.cc-locked .cc-slider {
  background: var(--accent);
  border-color: var(--accent);
  cursor: not-allowed;
  opacity: 0.55;
}
.cc-toggle.cc-locked .cc-slider::before {
  transform: translate(18px, -50%);
  background: #ffffff;
}

.cc-prefs-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.cc-prefs-actions .cc-btn-primary { flex: 1; min-width: 140px; }

/* ---------- Floating "cookie settings" reopen link ---------- */
.cc-reopen {
  position: fixed;
  left: 12px;
  bottom: 12px;
  z-index: 9998;
  font-family: 'Manrope', sans-serif;
  font-size: 0.74rem;
  color: var(--text-muted);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.cc-reopen:hover {
  opacity: 1;
  color: var(--text);
  border-color: var(--border-strong);
}

/* ---------- Mobile ---------- */
@media (max-width: 520px) {
  .cc-banner {
    left: 0;
    right: 0;
    bottom: 0;
    max-width: none;
    width: 100%;
    border-radius: 16px 16px 0 0;
    padding: 18px 16px 16px;
  }
  .cc-actions .cc-btn { flex: 1 1 auto; }
  .cc-btn-link { flex-basis: 100% !important; text-align: center; }
  .cc-prefs {
    left: 8px;
    right: 8px;
    top: 8px;
    bottom: 8px;
    transform: none;
    max-width: none;
    width: auto;
    max-height: none;
  }
}

/* Hidden state — JS toggles these */
.cc-hidden { display: none !important; }
