/* =========================================
   COOKIE CONSENT BANNER
   ========================================= */

/* ─── Banner główny ─── */
.cookie-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  width: calc(100% - 48px);
  max-width: 960px;
  background: var(--bg-card);
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  z-index: 9500;
  box-shadow: 0 8px 60px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(0, 229, 255, 0.05);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
  opacity: 0;
  pointer-events: none;
}

.cookie-banner::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  opacity: 0.7;
}

.cookie-banner.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: all;
}

.cookie-banner.hidden {
  transform: translateX(-50%) translateY(140px);
  opacity: 0;
  pointer-events: none;
}

/* ─── Layout bannera ─── */
.cookie-inner {
  display: flex;
  align-items: center;
  gap: 24px;
}

.cookie-icon {
  font-size: 2rem;
  flex-shrink: 0;
  animation: cookieBounce 2s ease-in-out infinite;
}

@keyframes cookieBounce {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(5deg); }
}

.cookie-content { flex: 1; min-width: 0; }

.cookie-content h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.cookie-content p {
  font-size: 0.83rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.cookie-content p a {
  color: var(--accent-cyan);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: none;
}

.cookie-content p a:hover { opacity: 0.8; }

.cookie-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* Przyciski bannera */
.cookie-btn {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 8px;
  border: none;
  cursor: none;
  transition: var(--transition);
  white-space: nowrap;
}

.cookie-btn-accept {
  background: var(--accent-cyan);
  color: var(--bg-primary);
}
.cookie-btn-accept:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 229, 255, 0.35);
}

.cookie-btn-reject {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}
.cookie-btn-reject:hover {
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
  background: rgba(255,255,255,0.04);
}

.cookie-btn-settings {
  background: transparent;
  color: var(--text-muted);
  padding: 9px 10px;
  border: 1px solid transparent;
}
.cookie-btn-settings:hover {
  color: var(--accent-cyan);
}

/* ─── Modal ustawień ─── */
.cookie-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 10, 15, 0.85);
  backdrop-filter: blur(6px);
  z-index: 9600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.cookie-modal-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.cookie-modal {
  background: var(--bg-card);
  border: 1px solid rgba(0, 229, 255, 0.18);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,0.7);
  transform: scale(0.94) translateY(20px);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cookie-modal-overlay.visible .cookie-modal {
  transform: scale(1) translateY(0);
}

/* Scrollbar modal */
.cookie-modal::-webkit-scrollbar { width: 4px; }
.cookie-modal::-webkit-scrollbar-track { background: transparent; }
.cookie-modal::-webkit-scrollbar-thumb { background: var(--accent-cyan); border-radius: 2px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 1;
}

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 1rem;
  cursor: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.modal-close:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary);
}

.modal-body { padding: 24px 28px; }

.modal-intro {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 24px;
}

/* ─── Kategorie ciasteczek ─── */
.cookie-category {
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color 0.25s;
}

.cookie-category:has(.cookie-toggle:checked) {
  border-color: rgba(0, 229, 255, 0.25);
}

.category-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  cursor: none;
}

.category-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.cat-required .category-icon { background: rgba(0, 229, 255, 0.08); }
.cat-analytics .category-icon { background: rgba(57, 255, 106, 0.08); }
.cat-marketing .category-icon { background: rgba(255, 107, 53, 0.08); }

.category-info { flex: 1; }

.category-info strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.category-info span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Toggle switch */
.cookie-toggle-wrap {
  position: relative;
  width: 44px; height: 24px;
  flex-shrink: 0;
}

.cookie-toggle {
  opacity: 0;
  width: 0; height: 0;
  position: absolute;
}

.toggle-label {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.1);
  border-radius: 12px;
  cursor: none;
  transition: background 0.25s;
  border: 1px solid var(--border-color);
}

.toggle-label::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.25s;
}

.cookie-toggle:checked + .toggle-label {
  background: rgba(0, 229, 255, 0.2);
  border-color: rgba(0, 229, 255, 0.4);
}

.cookie-toggle:checked + .toggle-label::after {
  transform: translateX(20px);
  background: var(--accent-cyan);
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
}

/* Required (disabled) toggle */
.cookie-toggle:disabled + .toggle-label {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Category details (expand) */
.category-details {
  padding: 0 18px 14px 68px;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.6;
  display: none;
}

.cookie-category.expanded .category-details { display: block; }

.category-header .expand-icon {
  font-size: 0.7rem;
  color: var(--text-muted);
  transition: transform 0.25s;
  margin-left: 2px;
}

.cookie-category.expanded .expand-icon { transform: rotate(180deg); }

/* ─── Modal footer ─── */
.modal-footer {
  padding: 20px 28px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.cookie-btn-save {
  background: var(--accent-cyan);
  color: var(--bg-primary);
}
.cookie-btn-save:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 229, 255, 0.3);
}

.cookie-btn-accept-all {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}
.cookie-btn-accept-all:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* ─── Floating cookie button (po zamknięciu) ─── */
.cookie-reopen {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid rgba(0, 229, 255, 0.2);
  font-size: 1.3rem;
  cursor: none;
  z-index: 9400;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.cookie-reopen.visible {
  opacity: 1;
  pointer-events: all;
  transform: scale(1);
}

.cookie-reopen:hover {
  border-color: var(--accent-cyan);
  transform: scale(1.1);
  box-shadow: 0 4px 24px rgba(0, 229, 255, 0.25);
}

/* ─── Responsive ─── */
@media (max-width: 700px) {
  .cookie-banner {
    bottom: 12px;
    padding: 18px 18px;
    border-radius: var(--radius);
  }

  .cookie-inner { flex-direction: column; align-items: flex-start; gap: 14px; }
  .cookie-icon { display: none; }
  .cookie-actions { width: 100%; }
  .cookie-btn-accept, .cookie-btn-reject { flex: 1; text-align: center; }

  .modal-header, .modal-body, .modal-footer { padding-left: 18px; padding-right: 18px; }
  .category-details { padding-left: 52px; }
}
