/**
 * Cookie Management System Styles
 * GDPR compliant cookie banner and preferences modal
 */

/* Cookie Banner */
#cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(55, 65, 81, 0.3);
  z-index: 10000;
  padding: 1rem;
  animation: slideUp 0.3s ease-out;
}

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

.cookie-banner-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.cookie-banner-text h3 {
  color: #fff;
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.cookie-banner-text p {
  color: #d1d5db;
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
}

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

/* Cookie Buttons */
.cookie-btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.cookie-btn-primary {
  background: #3b82f6;
  color: white;
}

.cookie-btn-primary:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

.cookie-btn-secondary {
  background: transparent;
  color: #d1d5db;
  border: 1px solid rgba(55, 65, 81, 0.5);
}

.cookie-btn-secondary:hover {
  background: rgba(55, 65, 81, 0.3);
  border-color: rgba(75, 85, 99, 0.7);
}

/* Cookie Preferences Modal */
#cookie-preferences {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10001;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.cookie-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.cookie-modal {
  background: #fff;
  border-radius: 12px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateY(-20px) scale(0.95);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.cookie-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.cookie-modal-header h2 {
  margin: 0;
  color: #111827;
  font-size: 1.25rem;
  font-weight: 600;
}

.cookie-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #6b7280;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.cookie-close-btn:hover {
  background: #f3f4f6;
  color: #374151;
}

.cookie-modal-content {
  padding: 1.5rem;
  max-height: 60vh;
  overflow-y: auto;
}

.cookie-modal-content > p {
  margin: 0 0 1.5rem 0;
  color: #6b7280;
  line-height: 1.5;
}

/* Cookie Categories */
.cookie-category {
  margin-bottom: 1.5rem;
  padding: 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.cookie-category:hover {
  border-color: #d1d5db;
  background: #f9fafb;
}

.cookie-category-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.cookie-category h4 {
  margin: 0 0 0.5rem 0;
  color: #111827;
  font-size: 1rem;
  font-weight: 600;
}

.cookie-category p {
  margin: 0;
  color: #6b7280;
  font-size: 0.9rem;
  line-height: 1.4;
}

/* Toggle Switch */
.cookie-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  margin-top: 2px;
}

.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: #d1d5db;
  transition: 0.3s;
  border-radius: 24px;
}

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

.cookie-toggle input:checked + .cookie-slider {
  background-color: #3b82f6;
}

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

.cookie-toggle input:disabled + .cookie-slider {
  background-color: #9ca3af;
  cursor: not-allowed;
}

.cookie-toggle input:disabled + .cookie-slider:before {
  background-color: #f3f4f6;
}

/* Modal Actions */
.cookie-modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  padding: 1.5rem;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
}

/* YouTube Consent Placeholder */
.youtube-consent-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  min-height: 200px;
}

.youtube-placeholder-content {
  text-align: center;
  padding: 2rem;
}

.youtube-placeholder-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.youtube-placeholder-content h4 {
  margin: 0 0 0.5rem 0;
  color: #374151;
  font-size: 1.1rem;
}

.youtube-placeholder-content p {
  margin: 0 0 1.5rem 0;
  color: #6b7280;
  font-size: 0.9rem;
}

.youtube-consent-btn {
  background: #3b82f6;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.youtube-consent-btn:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 768px) {
  .cookie-banner-content {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .cookie-banner-actions {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .cookie-modal {
    margin: 0.5rem;
    max-height: 95vh;
  }
  
  .cookie-modal-header,
  .cookie-modal-content,
  .cookie-modal-actions {
    padding: 1rem;
  }
  
  .cookie-category-header {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .cookie-toggle {
    align-self: flex-start;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .cookie-modal {
    background: #1f2937;
    color: #f9fafb;
  }
  
  .cookie-modal-header {
    border-bottom-color: #374151;
  }
  
  .cookie-modal-header h2 {
    color: #f9fafb;
  }
  
  .cookie-close-btn {
    color: #9ca3af;
  }
  
  .cookie-close-btn:hover {
    background: #374151;
    color: #d1d5db;
  }
  
  .cookie-modal-content > p {
    color: #9ca3af;
  }
  
  .cookie-category {
    background: #374151;
    border-color: #4b5563;
  }
  
  .cookie-category:hover {
    border-color: #6b7280;
    background: #4b5563;
  }
  
  .cookie-category h4 {
    color: #f9fafb;
  }
  
  .cookie-category p {
    color: #d1d5db;
  }
  
  .cookie-modal-actions {
    background: #374151;
    border-top-color: #4b5563;
  }
  
  .youtube-consent-placeholder {
    background: #374151;
    border-color: #4b5563;
  }
  
  .youtube-placeholder-content h4 {
    color: #f9fafb;
  }
  
  .youtube-placeholder-content p {
    color: #d1d5db;
  }
}
