/* =====================================================
   COOKIE CONSENT REDESIGN - Modern Style
   ===================================================== */

:root {
  --cookie-bg-primary: #161b22;
  --cookie-bg-secondary: #21262d;
  --cookie-border: #30363d;
  --cookie-text-primary: #e6edf3;
  --cookie-text-secondary: #8b949e;
  --cookie-accent: #a855f7;
  --cookie-accent-secondary: #ec4899;
  --cookie-success: #3fb950;
  --cookie-shadow: 0 -8px 32px rgba(0, 0, 0, 0.5);
}

/* Cookie Consent Banner */
#cookie-consent-banner {
  position: fixed;
  bottom: -100%;
  left: 0;
  right: 0;
  z-index: 10000;
  background: rgba(22, 27, 34, 0.98);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--cookie-border);
  box-shadow: var(--cookie-shadow);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Inter', 'Space Grotesk', -apple-system, sans-serif;
}

#cookie-consent-banner.show {
  bottom: 0;
}

.cookie-consent-content {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 1.5rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

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

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.cookie-text {
  flex: 1;
}

.cookie-text h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--cookie-text-primary);
  font-family: 'Space Grotesk', sans-serif;
}

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

.cookie-text p a {
  color: var(--cookie-accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.cookie-text p a:hover {
  border-bottom-color: var(--cookie-accent);
}

.cookie-actions {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
}

.cookie-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  white-space: nowrap;
}

.cookie-btn-accept {
  background: linear-gradient(135deg, var(--cookie-accent), var(--cookie-accent-secondary));
  color: white;
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
}

.cookie-btn-accept:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(168, 85, 247, 0.4);
}

.cookie-btn-decline {
  background: var(--cookie-bg-secondary);
  color: var(--cookie-text-secondary);
  border: 1px solid var(--cookie-border);
}

.cookie-btn-decline:hover {
  background: var(--cookie-bg-primary);
  color: var(--cookie-text-primary);
  transform: translateY(-1px);
}

.cookie-btn-settings {
  background: transparent;
  color: var(--cookie-accent);
  border: 1px solid var(--cookie-accent);
}

.cookie-btn-settings:hover {
  background: rgba(168, 85, 247, 0.1);
  transform: translateY(-1px);
}

/* Cookie Settings Modal */
#cookie-settings-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10001;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  font-family: 'Inter', 'Space Grotesk', -apple-system, sans-serif;
}

#cookie-settings-modal.show {
  opacity: 1;
  visibility: visible;
}

.cookie-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
}

.cookie-modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  background: var(--cookie-bg-primary);
  border: 1px solid var(--cookie-border);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  max-width: 600px;
  width: 90%;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
}

#cookie-settings-modal.show .cookie-modal-content {
  transform: translate(-50%, -50%) scale(1);
}

.cookie-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--cookie-border);
  background: var(--cookie-bg-secondary);
}

.cookie-modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--cookie-text-primary);
  font-family: 'Space Grotesk', sans-serif;
}

.cookie-close {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--cookie-border);
  font-size: 1.5rem;
  color: var(--cookie-text-secondary);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.cookie-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--cookie-text-primary);
  border-color: var(--cookie-accent);
}

.cookie-modal-body {
  padding: 2rem;
  overflow-y: auto;
  flex: 1;
}

/* Custom Scrollbar */
.cookie-modal-body::-webkit-scrollbar {
  width: 8px;
}

.cookie-modal-body::-webkit-scrollbar-track {
  background: var(--cookie-bg-primary);
}

.cookie-modal-body::-webkit-scrollbar-thumb {
  background: var(--cookie-bg-secondary);
  border-radius: 4px;
}

.cookie-modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--cookie-border);
}

.cookie-category {
  padding: 1.5rem;
  background: var(--cookie-bg-secondary);
  border: 1px solid var(--cookie-border);
  border-radius: 12px;
  margin-bottom: 1rem;
  transition: all 0.2s ease;
}

.cookie-category:hover {
  border-color: var(--cookie-accent);
}

.cookie-category:last-child {
  margin-bottom: 0;
}

.cookie-category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.cookie-category h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--cookie-text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cookie-category-icon {
  font-size: 1.2rem;
}

.cookie-category p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--cookie-text-secondary);
  line-height: 1.6;
}

/* Toggle Switch */
.cookie-toggle {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
}

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

.cookie-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--cookie-border);
  transition: 0.3s;
  border-radius: 28px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cookie-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cookie-toggle input:checked + .cookie-slider {
  background: linear-gradient(135deg, var(--cookie-accent), var(--cookie-accent-secondary));
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.4);
}

.cookie-toggle input:checked + .cookie-slider:before {
  transform: translateX(24px);
}

.cookie-slider.essential {
  background: linear-gradient(135deg, var(--cookie-success), #2d8a3e);
  cursor: not-allowed;
  box-shadow: 0 0 12px rgba(63, 185, 80, 0.4);
}

.cookie-slider.essential:before {
  transform: translateX(24px);
}

.cookie-modal-footer {
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--cookie-border);
  background: var(--cookie-bg-secondary);
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .cookie-consent-content {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
    padding: 1.5rem 1rem;
  }

  .cookie-icon {
    font-size: 2rem;
  }

  .cookie-actions {
    flex-direction: column;
    width: 100%;
  }

  .cookie-btn {
    width: 100%;
  }

  .cookie-modal-content {
    width: 95%;
    max-height: 90vh;
  }

  .cookie-modal-header,
  .cookie-modal-body,
  .cookie-modal-footer {
    padding: 1.5rem;
  }

  .cookie-category {
    padding: 1.25rem;
  }

  .cookie-category-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .cookie-modal-footer {
    flex-direction: column;
  }

  .cookie-modal-footer .cookie-btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .cookie-text h3 {
    font-size: 1.1rem;
  }

  .cookie-text p {
    font-size: 0.85rem;
  }

  .cookie-btn {
    padding: 0.65rem 1.25rem;
    font-size: 0.9rem;
  }

  .cookie-modal-header h2 {
    font-size: 1.25rem;
  }
}

/* Light theme support (if needed) */
@media (prefers-color-scheme: light) {
  body.light-theme #cookie-consent-banner {
    background: rgba(255, 255, 255, 0.98);
    border-top-color: rgba(0, 0, 0, 0.1);
  }

  body.light-theme .cookie-text h3 {
    color: #1a1a1a;
  }

  body.light-theme .cookie-text p {
    color: #666;
  }

  body.light-theme .cookie-btn-decline {
    background: #f5f5f5;
    color: #666;
    border-color: #ddd;
  }

  body.light-theme .cookie-btn-decline:hover {
    background: #e5e5e5;
  }

  body.light-theme .cookie-modal-content {
    background: #ffffff;
  }

  body.light-theme .cookie-modal-header {
    background: #f8f9fa;
    border-bottom-color: #e5e5e5;
  }

  body.light-theme .cookie-modal-header h2 {
    color: #1a1a1a;
  }

  body.light-theme .cookie-close {
    background: #f5f5f5;
    color: #666;
  }

  body.light-theme .cookie-category {
    background: #f8f9fa;
    border-color: #e5e5e5;
  }

  body.light-theme .cookie-category h3 {
    color: #1a1a1a;
  }

  body.light-theme .cookie-category p {
    color: #666;
  }

  body.light-theme .cookie-modal-footer {
    background: #f8f9fa;
    border-top-color: #e5e5e5;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  #cookie-consent-banner,
  .cookie-modal-content,
  .cookie-btn,
  .cookie-slider,
  .cookie-slider:before {
    transition: none !important;
    animation: none !important;
  }
}

/* Focus styles */
.cookie-btn:focus-visible,
.cookie-close:focus-visible,
.cookie-toggle input:focus-visible + .cookie-slider {
  outline: 2px solid var(--cookie-accent);
  outline-offset: 2px;
}
