/* ==========================================
   🍪 PROFESSIONAL COOKIE CONSENT BANNER
   Advanced UI/UX with Animations & Micro-interactions
   GDPR/CCPA Compliant
   ========================================== */

/* === CSS CUSTOM PROPERTIES === */
:root {
  --cookie-bg: rgba(20, 20, 35, 0.98);
  --cookie-bg-blur: rgba(20, 20, 35, 0.85);
  --cookie-border: rgba(255, 109, 90, 0.2);
  --cookie-primary: #ff6d5a;
  --cookie-primary-hover: #ff8a75;
  --cookie-success: #4CAF50;
  --cookie-text: #e0e0e0;
  --cookie-text-muted: #9a9a9a;
  --cookie-shadow: rgba(0, 0, 0, 0.4);
  --cookie-glass: rgba(255, 255, 255, 0.05);
  --cookie-gradient: linear-gradient(135deg, rgba(255, 109, 90, 0.1) 0%, rgba(255, 109, 90, 0.05) 100%);
  --animation-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --animation-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* === MAIN BANNER CONTAINER === */
.cookie-consent-container {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  padding: 20px;
  pointer-events: none;
}

/* === GLASSMORPHISM BANNER === */
.cookie-banner {
  background: var(--cookie-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--cookie-border);
  border-radius: 16px;
  box-shadow:
    0 8px 32px var(--cookie-shadow),
    0 0 0 1px rgba(255, 109, 90, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  padding: 24px 28px;
  max-width: 900px;
  margin: 0 auto;
  pointer-events: all;
  transform: translateY(120%);
  opacity: 0;
  transition: all 0.5s var(--animation-smooth);
  position: relative;
  overflow: hidden;
}

.cookie-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--cookie-gradient);
}

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

.cookie-banner.hide {
  transform: translateY(120%);
  opacity: 0;
}

/* === ANIMATED GRADIENT ORB === */
.cookie-banner::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255, 109, 90, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  animation: orbFloat 8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.3; }
  33% { transform: translate(20px, -20px) scale(1.1); opacity: 0.5; }
  66% { transform: translate(-10px, 10px) scale(0.9); opacity: 0.4; }
}

/* === BANNER HEADER === */
.cookie-banner-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.cookie-banner-icon {
  width: 40px;
  height: 40px;
  background: var(--cookie-gradient);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.cookie-banner-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--cookie-text);
  margin: 0;
  letter-spacing: -0.02em;
}

.cookie-banner-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--cookie-glass);
  border-radius: 20px;
  font-size: 11px;
  color: var(--cookie-primary);
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* === BANNER CONTENT === */
.cookie-banner-content {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
}

.cookie-banner-text {
  color: var(--cookie-text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.cookie-banner-text p {
  margin: 0 0 8px 0;
}

.cookie-banner-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.cookie-banner-link {
  color: var(--cookie-text-muted);
  text-decoration: none;
  font-size: 13px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  position: relative;
}

.cookie-banner-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--cookie-primary);
  transition: width 0.3s ease;
}

.cookie-banner-link:hover {
  color: var(--cookie-primary);
}

.cookie-banner-link:hover::after {
  width: 100%;
}

.cookie-banner-link i {
  font-size: 11px;
  opacity: 0.7;
}

/* === BUTTONS GROUP === */
.cookie-banner-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.cookie-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s var(--animation-smooth);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.cookie-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cookie-btn:hover::before {
  opacity: 1;
}

.cookie-btn i {
  font-size: 14px;
  transition: transform 0.3s ease;
}

.cookie-btn:hover i {
  transform: scale(1.2) rotate(5deg);
}

/* Primary Button */
.cookie-btn-primary {
  background: var(--cookie-primary);
  color: white;
  box-shadow: 0 4px 15px rgba(255, 109, 90, 0.3);
}

.cookie-btn-primary:hover {
  background: var(--cookie-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 109, 90, 0.4);
}

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

/* Secondary Button */
.cookie-btn-secondary {
  background: transparent;
  color: var(--cookie-text);
  border: 1px solid var(--cookie-border);
}

.cookie-btn-secondary:hover {
  background: var(--cookie-glass);
  border-color: var(--cookie-primary);
  color: var(--cookie-primary);
}

/* Tertiary Button */
.cookie-btn-tertiary {
  background: transparent;
  color: var(--cookie-text-muted);
  border: none;
  padding: 12px 16px;
}

.cookie-btn-tertiary:hover {
  color: var(--cookie-text);
  background: var(--cookie-glass);
}

/* === COLLAPSE BUTTON === */
.cookie-collapse-toggle {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  background: var(--cookie-glass);
  border: none;
  border-radius: 8px;
  color: var(--cookie-text-muted);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cookie-collapse-toggle:hover {
  background: rgba(255, 109, 90, 0.1);
  color: var(--cookie-primary);
  transform: rotate(90deg);
}

/* === MINIMIZED STATE === */
.cookie-banner.minimized {
  max-width: 400px;
  padding: 16px 20px;
  cursor: pointer;
}

.cookie-banner.minimized .cookie-banner-content {
  display: none;
}

.cookie-banner.minimized .cookie-banner-header {
  margin-bottom: 0;
  justify-content: center;
}

.cookie-banner.minimized:hover {
  transform: scale(1.02);
  box-shadow: 0 12px 40px var(--cookie-shadow);
}

/* === SETTINGS PANEL OVERLAY === */
.cookie-settings-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

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

/* === SETTINGS PANEL === */
.cookie-settings-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: #1a1a23;
  border: 1px solid var(--cookie-border);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  z-index: 10001;
  width: 90%;
  max-width: 550px;
  max-height: 90vh;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s var(--animation-smooth);
}

.cookie-settings-panel.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

/* === SETTINGS PANEL HEADER === */
.cookie-settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 28px;
  border-bottom: 1px solid var(--cookie-border);
  position: sticky;
  top: 0;
  background: #1a1a23;
  z-index: 10;
}

.cookie-settings-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--cookie-text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.cookie-settings-close {
  width: 36px;
  height: 36px;
  background: var(--cookie-glass);
  border: none;
  border-radius: 10px;
  color: var(--cookie-text-muted);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cookie-settings-close:hover {
  background: rgba(244, 67, 54, 0.1);
  color: #f44336;
  transform: rotate(90deg);
}

/* === COOKIE CATEGORIES === */
.cookie-settings-body {
  padding: 24px 28px;
}

.cookie-category {
  margin-bottom: 20px;
  padding: 20px;
  background: var(--cookie-glass);
  border: 1px solid var(--cookie-border);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.cookie-category:hover {
  border-color: var(--cookie-primary);
  box-shadow: 0 4px 12px rgba(255, 109, 90, 0.1);
}

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

.cookie-category-info {
  flex: 1;
}

.cookie-category-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--cookie-text);
  margin: 0 0 6px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cookie-category-badge {
  padding: 2px 8px;
  background: var(--cookie-gradient);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cookie-category-description {
  font-size: 13px;
  color: var(--cookie-text-muted);
  line-height: 1.5;
  margin: 0;
}

.cookie-category-list {
  margin-top: 12px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: var(--cookie-text-muted);
}

.cookie-category-list code {
  color: var(--cookie-primary);
}

/* === ADVANCED TOGGLE SWITCH === */
.cookie-switch {
  position: relative;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
}

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

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

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

.cookie-switch input:checked + .cookie-slider {
  background: var(--cookie-primary);
}

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

.cookie-switch input:disabled + .cookie-slider {
  opacity: 0.5;
  cursor: not-allowed;
}

.cookie-switch input:disabled + .cookie-slider::before {
  background: #666;
}

/* Toggle animation */
.cookie-slider::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.3s ease;
}

.cookie-switch input:checked + .cookie-slider::after {
  transform: translate(-50%, -50%) scale(1);
}

/* === SETTINGS PANEL FOOTER === */
.cookie-settings-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 28px;
  border-top: 1px solid var(--cookie-border);
  position: sticky;
  bottom: 0;
  background: #1a1a23;
}

.cookie-settings-info {
  font-size: 12px;
  color: var(--cookie-text-muted);
}

.cookie-settings-actions {
  display: flex;
  gap: 12px;
}

/* === PROFESSIONAL FOOTER === */
.footer-professional {
  background: linear-gradient(180deg, #0f0f1a 0%, #1a1a2e 100%);
  border-top: 1px solid var(--cookie-border);
  padding: 60px 20px 30px;
  position: relative;
  overflow: hidden;
}

/* Animated background pattern */
.footer-professional::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--cookie-primary) 50%,
    transparent 100%
  );
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
  0% { opacity: 0; transform: translateX(-100%); }
  50% { opacity: 1; transform: translateX(0); }
  100% { opacity: 0; transform: translateX(100%); }
}

.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}

/* Footer Columns */
.footer-col h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--cookie-text);
  margin: 0 0 20px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.footer-col h4 i {
  color: var(--cookie-primary);
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 12px;
}

.footer-link {
  color: var(--cookie-text-muted);
  text-decoration: none;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  position: relative;
}

.footer-link::before {
  content: '';
  position: absolute;
  left: -16px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 1px;
  background: var(--cookie-primary);
  opacity: 0;
  transition: all 0.2s ease;
}

.footer-link:hover {
  color: var(--cookie-primary);
  padding-left: 8px;
}

.footer-link:hover::before {
  opacity: 1;
  left: 0;
}

.footer-link i {
  font-size: 12px;
  opacity: 0.5;
  transition: all 0.2s ease;
}

.footer-link:hover i {
  opacity: 1;
  color: var(--cookie-primary);
}

/* Footer Brand */
.footer-brand {
  grid-column: 1;
}

.footer-brand .logo {
  font-size: 24px;
  font-weight: 700;
  color: var(--cookie-text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-brand .logo i {
  font-size: 28px;
  color: var(--cookie-primary);
}

.footer-brand p {
  color: var(--cookie-text-muted);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 20px;
  max-width: 300px;
}

/* Social Links */
.footer-social {
  display: flex;
  gap: 12px;
}

.footer-social-link {
  width: 40px;
  height: 40px;
  background: var(--cookie-glass);
  border: 1px solid var(--cookie-border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cookie-text-muted);
  text-decoration: none;
  transition: all 0.3s ease;
}

.footer-social-link:hover {
  background: var(--cookie-gradient);
  border-color: var(--cookie-primary);
  color: white;
  transform: translateY(-3px);
}

/* GDPR Badges */
.footer-gdpr-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.footer-gdpr-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(76, 175, 80, 0.1);
  border: 1px solid rgba(76, 175, 80, 0.3);
  border-radius: 6px;
  font-size: 11px;
  color: #81c784;
  font-weight: 500;
}

/* Footer Bottom */
.footer-bottom {
  max-width: 1200px;
  margin: 40px auto 0;
  padding-top: 30px;
  border-top: 1px solid var(--cookie-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-bottom-left,
.footer-bottom-right {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 13px;
  color: var(--cookie-text-muted);
}

.footer-payment-methods {
  display: flex;
  gap: 8px;
}

.payment-method {
  width: 50px;
  height: 30px;
  background: var(--cookie-glass);
  border: 1px solid var(--cookie-border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--cookie-text-muted);
  font-weight: 600;
  transition: all 0.2s ease;
}

.payment-method:hover {
  border-color: var(--cookie-primary);
  color: var(--cookie-primary);
}

/* === TOAST NOTIFICATIONS === */
.cookie-toast {
  position: fixed;
  bottom: 120px;
  right: 20px;
  background: #1a1a23;
  border: 1px solid var(--cookie-border);
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10002;
  animation: slideInRight 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cookie-toast.success {
  border-color: var(--cookie-success);
}

.cookie-toast-icon {
  width: 24px;
  height: 24px;
  background: var(--cookie-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cookie-toast.success .cookie-toast-icon {
  background: var(--cookie-success);
}

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

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(120%);
    opacity: 0;
  }
}

/* === SCROLLBAR CUSTOMIZATION === */
.cookie-settings-panel::-webkit-scrollbar {
  width: 8px;
}

.cookie-settings-panel::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.cookie-settings-panel::-webkit-scrollbar-thumb {
  background: var(--cookie-border);
  border-radius: 4px;
}

.cookie-settings-panel::-webkit-scrollbar-thumb:hover {
  background: var(--cookie-primary);
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 768px) {
  .cookie-banner {
    padding: 20px;
    margin: 0 10px;
  }

  .cookie-banner-content {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .cookie-banner-actions {
    width: 100%;
    justify-content: stretch;
  }

  .cookie-btn {
    flex: 1;
    justify-content: center;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .cookie-category-header {
    flex-direction: column;
    gap: 12px;
  }

  .cookie-switch {
    width: 100%;
    display: flex;
    justify-content: flex-end;
  }

  .cookie-settings-footer {
    flex-direction: column;
    gap: 16px;
  }

  .cookie-settings-actions {
    width: 100%;
    justify-content: stretch;
  }

  .cookie-settings-actions .cookie-btn {
    flex: 1;
  }
}

/* === ANIMATIONS & TRANSITIONS === */
.cookie-btn,
.cookie-banner-link,
.footer-link,
.footer-social-link,
.payment-method {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === LOADING STATES === */
.cookie-btn.loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.cookie-btn.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* === PULSE ANIMATION FOR CTA === */
@keyframes pulse {
  0%, 100% { box-shadow: 0 4px 15px rgba(255, 109, 90, 0.3); }
  50% { box-shadow: 0 4px 25px rgba(255, 109, 90, 0.5); }
}

.cookie-btn-primary.pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* === PERFORMANCE OPTIMIZATIONS === */
.cookie-banner,
.cookie-settings-panel,
.footer-professional {
  will-change: transform, opacity;
}

.cookie-banner.show,
.cookie-settings-panel.show {
  will-change: auto;
}
