/**
 * Lunar Creations Cookie Consent System Styles
 * Modern, accessible cookie banner and settings modal
 */

/* Cookie Banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 50%, #991b1b 100%);
  backdrop-filter: blur(20px);
  border-top: 3px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 -8px 32px rgba(220, 38, 38, 0.4), 0 -4px 16px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: none;
  position: relative;
  overflow: hidden;
}

.cookie-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

.cookie-banner.show {
  transform: translateY(0);
}

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

.cookie-banner-text {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.cookie-icon {
  font-size: 2.5rem;
  animation: bounce 2s infinite;
  filter: drop-shadow(0 2px 8px rgba(255, 255, 255, 0.3));
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  40% {
    transform: translateY(-12px) rotate(-5deg);
  }
  60% {
    transform: translateY(-6px) rotate(3deg);
  }
}

.cookie-text h3 {
  color: #fff;
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0 0 8px 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.5px;
}

.cookie-text p {
  color: rgba(255, 255, 255, 0.95);
  font-size: 1rem;
  line-height: 1.6;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.cookie-banner-actions {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

/* Cookie Buttons */
.cookie-btn {
  padding: 14px 28px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cookie-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.cookie-btn:hover::before {
  left: 100%;
}

.cookie-btn-primary {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  color: #dc2626;
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.8);
}

.cookie-btn-primary:hover {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(255, 255, 255, 0.4);
  border-color: rgba(255, 255, 255, 1);
}

.cookie-btn-secondary {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
}

.cookie-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.2);
}

.cookie-btn-outline {
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.4);
}

.cookie-btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.7);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.15);
}

/* Cookie Settings Modal */
.cookie-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10001;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cookie-modal.show {
  opacity: 1;
}

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

.cookie-modal-content {
  position: relative;
  background: #fff;
  border-radius: 16px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.cookie-modal.show .cookie-modal-content {
  transform: scale(1);
}

.cookie-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  border-bottom: 1px solid #f1f3f4;
  background: linear-gradient(135deg, #FF3B30, #ff6b5a);
}

.cookie-modal-header h2 {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.cookie-modal-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  font-size: 1.5rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
}

.cookie-modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.cookie-modal-body {
  padding: 24px;
  max-height: 400px;
  overflow-y: auto;
}

.cookie-modal-body > p {
  color: #666;
  line-height: 1.6;
  margin-bottom: 24px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Cookie Categories */
.cookie-category {
  margin-bottom: 24px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 12px;
  border-left: 4px solid #FF3B30;
}

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

.cookie-category h4 {
  color: #1a1a1a;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.cookie-category p {
  color: #666;
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Cookie Toggle Switch */
.cookie-toggle {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.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: #ccc;
  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 2px 4px rgba(0, 0, 0, 0.2);
}

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

.cookie-toggle input:focus + .cookie-slider {
  box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.2);
}

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

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

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

/* Modal Footer */
.cookie-modal-footer {
  padding: 24px;
  border-top: 1px solid #f1f3f4;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  background: #f8f9fa;
}

/* Toast Notification */
.cookie-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #28a745;
  color: #fff;
  padding: 16px 24px;
  border-radius: 8px;
  box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3);
  z-index: 10002;
  transform: translateX(400px);
  transition: transform 0.3s ease;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 500;
}

.cookie-toast.show {
  transform: translateX(0);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .cookie-banner-content {
    padding: 20px;
    gap: 20px;
  }
  
  .cookie-btn {
    padding: 12px 24px;
    font-size: 0.9rem;
  }
}

@media (max-width: 768px) {
  .cookie-banner-content {
    flex-direction: column;
    gap: 24px;
    padding: 24px 20px;
    text-align: center;
  }
  
  .cookie-banner-text {
    text-align: center;
    gap: 20px;
  }
  
  .cookie-icon {
    font-size: 3rem;
  }
  
  .cookie-text h3 {
    font-size: 1.3rem;
  }
  
  .cookie-text p {
    font-size: 0.95rem;
  }
  
  .cookie-banner-actions {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
  }
  
  .cookie-btn {
    flex: 1;
    min-width: 140px;
    padding: 16px 24px;
  }
  
  .cookie-modal-content {
    width: 95%;
    margin: 20px;
  }
  
  .cookie-modal-header {
    padding: 20px;
  }
  
  .cookie-modal-body {
    padding: 20px;
  }
  
  .cookie-modal-footer {
    padding: 20px;
    flex-direction: column;
    gap: 12px;
  }
  
  .cookie-category-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .cookie-banner {
    border-top-width: 2px;
  }
  
  .cookie-banner-content {
    padding: 20px 16px;
    gap: 20px;
  }
  
  .cookie-banner-text {
    flex-direction: column;
    gap: 16px;
  }
  
  .cookie-icon {
    font-size: 2.5rem;
  }
  
  .cookie-banner-actions {
    flex-direction: column;
    gap: 12px;
  }
  
  .cookie-btn {
    width: 100%;
    padding: 16px 20px;
    font-size: 0.95rem;
    min-width: unset;
  }
  
  .cookie-text h3 {
    font-size: 1.2rem;
  }
  
  .cookie-text p {
    font-size: 0.9rem;
    line-height: 1.5;
  }
  
  .cookie-toast {
    right: 10px;
    left: 10px;
    transform: translateY(-100px);
  }
  
  .cookie-toast.show {
    transform: translateY(0);
  }
}

@media (max-width: 360px) {
  .cookie-banner-content {
    padding: 16px 12px;
  }
  
  .cookie-text h3 {
    font-size: 1.1rem;
  }
  
  .cookie-text p {
    font-size: 0.85rem;
  }
  
  .cookie-btn {
    padding: 14px 16px;
    font-size: 0.9rem;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  .cookie-banner,
  .cookie-modal,
  .cookie-modal-content,
  .cookie-btn,
  .cookie-slider,
  .cookie-toast {
    transition: none;
  }
  
  .cookie-icon {
    animation: none;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .cookie-banner {
    background: #000;
    border-top: 2px solid #fff;
  }
  
  .cookie-btn-primary {
    background: #000;
    border: 2px solid #fff;
  }
  
  .cookie-btn-secondary,
  .cookie-btn-outline {
    border: 2px solid #fff;
  }
}

/* Focus styles for keyboard navigation */
.cookie-btn:focus,
.cookie-toggle input:focus + .cookie-slider,
.cookie-modal-close:focus {
  outline: 2px solid #FF3B30;
  outline-offset: 2px;
}

/* Print styles */
@media print {
  .cookie-banner,
  .cookie-modal,
  .cookie-toast {
    display: none !important;
  }
}
