/* Cookie Banner Styles - Axion Lab Design System */

/* CSS Variables for Configuration */
:root {
  --cookie-banner-bottom: 1.5rem;
  --cookie-banner-right: 1.5rem;
  --cookie-banner-width: 420px;
  --cookie-banner-z-index: 9999;
  --cookie-modal-z-index: 10000;
  --cookie-border-radius: 1rem;
  --cookie-animation-duration: 0.4s;
}

/* Container Styles */
#cookies-with-stacked-buttons {
  position: fixed;
  bottom: var(--cookie-banner-bottom);
  right: var(--cookie-banner-right);
  z-index: var(--cookie-banner-z-index);
  max-width: var(--cookie-banner-width);
  width: calc(100% - calc(var(--cookie-banner-right) * 2));
  animation: slideUp var(--cookie-animation-duration) ease-out;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Card Container with Glassmorphic Effect */
.cookie-banner-card {
  padding: 1.5rem;
  background: rgba(227, 229, 233, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--cookie-border-radius);
  border: 1px solid rgba(180, 188, 208, 0.3);
  box-shadow: 
    0 20px 25px -5px rgba(12, 30, 63, 0.1),
    0 10px 10px -5px rgba(12, 30, 63, 0.04);
  transition: all 0.3s ease;
}

.cookie-banner-card:hover {
  box-shadow: 
    0 25px 30px -5px rgba(12, 30, 63, 0.15),
    0 15px 15px -5px rgba(12, 30, 63, 0.06);
}

/* Header Section */
.cookie-banner-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.cookie-banner-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--brand-primary);
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Cookie Icon */
.cookie-icon {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--brand-accent);
  flex-shrink: 0;
}

/* Close Button */
.cookie-dismiss-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  color: var(--text-tertiary);
  background: transparent;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  flex-shrink: 0;
}

.cookie-dismiss-btn:hover {
  background: rgba(12, 30, 63, 0.05);
  color: var(--brand-primary);
}

.cookie-dismiss-btn:focus {
  outline: 2px solid var(--brand-accent);
  outline-offset: 2px;
}

/* Description Text */
.cookie-description {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

.cookie-description a {
  color: var(--brand-accent);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
  border-bottom: 1px solid transparent;
}

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

/* Button Container */
.cookie-buttons-container {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.cookie-button-group {
  flex: 1;
}

/* Button Styles */
.cookie-btn {
  width: 100%;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  position: relative;
  overflow: hidden;
}

/* Primary Button - Accept All */
.cookie-btn-primary {
  background: var(--brand-accent);
  color: var(--text-on-dark);
  box-shadow: 0 4px 14px rgba(42, 111, 186, 0.25);
}

.cookie-btn-primary:hover {
  background: var(--brand-accent-hover);
  box-shadow: 0 8px 20px rgba(42, 111, 186, 0.35);
  transform: translateY(-1px);
}

.cookie-btn-primary:active {
  transform: translateY(0);
}

/* Secondary Button - Reject All */
.cookie-btn-secondary {
  background: transparent;
  color: var(--brand-primary);
  border: 2px solid rgba(12, 30, 63, 0.2);
  padding: calc(0.625rem - 2px) calc(1rem - 2px); /* Compensate for border */
  box-shadow: 0 4px 14px rgba(12, 30, 63, 0.15);
}

.cookie-btn-secondary:hover {
  background: rgba(12, 30, 63, 0.05);
  border-color: rgba(12, 30, 63, 0.3);
  box-shadow: 0 8px 20px rgba(12, 30, 63, 0.25);
  transform: translateY(-1px);
}

.cookie-btn-secondary:active {
  transform: translateY(0);
}

/* Tertiary Button - Manage Cookies */
.cookie-btn-tertiary {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(247, 248, 250, 0.8);
  color: var(--text-secondary);
  border: 1px solid rgba(180, 188, 208, 0.2);
  font-size: 0.8125rem;
}

.cookie-btn-tertiary:hover {
  background: rgba(247, 248, 250, 0.5);
  color: var(--text-tertiary);
  border-color: rgba(180, 188, 208, 0.3);
}

/* Focus States for Accessibility */
.cookie-btn:focus {
  outline: 2px solid var(--brand-accent);
  outline-offset: 2px;
}

/* Mobile Responsive */
@media (max-width: 640px) {
  #cookies-with-stacked-buttons {
    bottom: 0;
    right: 0;
    left: 0;
    max-width: 100%;
    width: 100%;
    border-radius: 0;
  }
  
  .cookie-banner-card {
    border-radius: 1rem 1rem 0 0;
    padding: 1.25rem;
  }
  
  .cookie-buttons-container {
    flex-direction: column;
  }
  
  .cookie-button-group {
    width: 100%;
  }
}

/* Dark Mode Support (if needed in future) */
@media (prefers-color-scheme: dark) {
  .cookie-banner-card {
    background: rgba(23, 23, 23, 0.92);
    border-color: rgba(55, 65, 81, 0.3);
  }
  
  .cookie-banner-title {
    color: #F7F8FA;
  }
  
  .cookie-description {
    color: #D1D5DB;
  }
  
  .cookie-btn-secondary {
    color: #F7F8FA;
    border-color: rgba(255, 255, 255, 0.2);
  }
  
  .cookie-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
  }
}

/* Smooth Transitions */
.cookie-banner-card * {
  transition-property: color, background-color, border-color, box-shadow, transform;
  transition-duration: 0.3s;
  transition-timing-function: ease;
}

/* Disabled State */
.cookie-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ===== COOKIE PREFERENCES MODAL STYLES ===== */

/* Modal Overlay */
.cookie-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(12, 30, 63, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: var(--cookie-modal-z-index);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: modalFadeIn var(--cookie-animation-duration) ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    backdrop-filter: blur(0px);
  }
  to {
    opacity: 1;
    backdrop-filter: blur(8px);
  }
}

/* Modal Container */
.cookie-modal-container {
  background: rgba(227, 229, 233, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--cookie-border-radius);
  border: 1px solid rgba(180, 188, 208, 0.3);
  box-shadow: 
    0 25px 50px -12px rgba(12, 30, 63, 0.25),
    0 10px 25px -5px rgba(12, 30, 63, 0.1);
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow: hidden;
  animation: modalSlideUp var(--cookie-animation-duration) ease-out;
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Modal Content */
.cookie-modal-content {
  padding: 2rem;
  overflow-y: auto;
  max-height: 80vh;
}

/* Modal Header */
.cookie-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.cookie-modal-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--brand-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cookie-modal-icon {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--brand-accent);
  flex-shrink: 0;
}

.cookie-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.cookie-modal-close:hover {
  background: rgba(12, 30, 63, 0.05);
  color: var(--brand-primary);
}

.cookie-modal-close:focus {
  outline: 2px solid var(--brand-accent);
  outline-offset: 2px;
}

/* Modal Description */
.cookie-modal-description {
  margin-bottom: 2rem;
}

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

/* Cookie Categories */
.cookie-categories {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.cookie-category {
  background: rgba(255, 255, 255, 0.6);
  border-radius: 0.75rem;
  border: 1px solid rgba(180, 188, 208, 0.2);
  padding: 1.25rem;
  transition: all 0.2s ease;
}

.cookie-category:hover {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(180, 188, 208, 0.3);
}

.cookie-category-header {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cookie-category-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

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

.cookie-category-icon {
  width: 1.125rem;
  height: 1.125rem;
  color: var(--brand-accent);
  flex-shrink: 0;
}

.cookie-category-description {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0;
}

/* Toggle Switch */
.cookie-toggle {
  position: relative;
  display: flex;
  align-items: center;
}

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

.toggle-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.toggle-slider {
  position: relative;
  width: 3rem;
  height: 1.5rem;
  background: rgba(156, 163, 175, 0.3);
  border-radius: 0.75rem;
  transition: all 0.3s ease;
  border: 1px solid rgba(156, 163, 175, 0.2);
}

.toggle-slider::after {
  content: '';
  position: absolute;
  top: 0.125rem;
  left: 0.125rem;
  width: 1.25rem;
  height: 1.25rem;
  background: var(--text-on-dark);
  border-radius: 50%;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Checked state */
input[type="checkbox"]:checked + .toggle-label .toggle-slider {
  background: var(--brand-accent);
  border-color: var(--brand-accent);
}

input[type="checkbox"]:checked + .toggle-label .toggle-slider::after {
  transform: translateX(1.5rem);
}

/* Disabled state */
input[type="checkbox"]:disabled + .toggle-label {
  cursor: not-allowed;
  opacity: 0.6;
}

input[type="checkbox"]:disabled + .toggle-label .toggle-slider {
  background: rgba(156, 163, 175, 0.2);
  border-color: rgba(156, 163, 175, 0.2);
}

input[type="checkbox"]:disabled:checked + .toggle-label .toggle-slider {
  background: rgba(42, 111, 186, 0.5);
  border-color: rgba(42, 111, 186, 0.5);
}

/* Modal Actions */
.cookie-modal-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.cookie-modal-actions .cookie-btn {
  flex: 1;
  min-width: 120px;
  justify-content: center;
}

/* Responsive Design for Modal */
@media (max-width: 640px) {
  .cookie-modal-overlay {
    padding: 0.5rem;
  }
  
  .cookie-modal-container {
    max-height: 90vh;
  }
  
  .cookie-modal-content {
    padding: 1.5rem;
  }
  
  .cookie-modal-title {
    font-size: 1.25rem;
  }
  
  .cookie-category-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  
  .cookie-modal-actions {
    flex-direction: column;
  }
  
  .cookie-modal-actions .cookie-btn {
    width: 100%;
  }
}