/**
 * Footer Section - Complete
 * Structure + Theme-Specific Styling
 * Colors are defined in colors.css
 */

/* ============================================================================
   BASE STRUCTURE
   ========================================================================= */

.footer {
  padding: var(--space-16) 0 var(--space-8);
  border-top: 1px solid transparent;
  margin-top: var(--space-20);
  position: relative;
  overflow: hidden;
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-12);
  margin-bottom: var(--space-12);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.footer-logo {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  margin-bottom: var(--space-2);
}

.footer-logo img {
  max-height: 50px;
  margin-bottom: var(--space-4);
  display: block;
}

.footer-tagline {
  font-size: var(--text-sm);
  line-height: 1.6;
  opacity: 0.8;
  max-width: 300px;
}

.footer-column {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.footer-column-title {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-2);
  position: relative;
  padding-bottom: var(--space-3);
}

.footer-column-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 2px;
  transition: width 0.3s ease;
}

.footer-column:hover .footer-column-title::after {
  width: 60px;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer-links li {
  font-size: var(--text-sm);
}

.footer-links a {
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-block;
  position: relative;
  padding-left: var(--space-1);
}

.footer-links a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) scaleX(0);
  width: 2px;
  height: 60%;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: left;
}

.footer-links a:hover::before {
  transform: translateY(-50%) scaleX(1);
}

/* Contact Info */
.footer-contact {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.footer-contact li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  transition: all 0.3s ease;
  padding: var(--space-2) 0;
  font-size: var(--text-sm);
  line-height: 1.5;
}

.footer-contact li .icon {
  font-size: var(--text-lg);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.footer-contact li:hover .icon {
  transform: scale(1.2) rotate(-10deg);
}

/* Social Links */
.footer-social {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.social-link {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all var(--transition-base);
  border: 1px solid transparent;
  font-size: var(--text-lg);
  position: relative;
  overflow: hidden;
  font-weight: var(--font-semibold);
}

.social-link::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.social-link:hover::before {
  opacity: 1;
}

.social-link .icon {
  position: relative;
  z-index: 1;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.social-link:hover .icon {
  transform: scale(1.15) rotate(5deg);
}

/* Newsletter */
.footer-newsletter {
  margin-top: var(--space-6);
  max-width: 400px;
}

.newsletter-title {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-3);
}

.newsletter-description {
  font-size: var(--text-sm);
  opacity: 0.8;
  margin-bottom: var(--space-4);
  line-height: 1.5;
}

.newsletter-form {
  display: flex;
  gap: var(--space-2);
}

.newsletter-input {
  flex: 1;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: var(--text-sm);
  transition: all var(--transition-base);
  min-height: 44px;
}

.newsletter-input:focus {
  outline: none;
}

.newsletter-button {
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  border: none;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Footer Bottom */
.footer-bottom {
  padding-top: var(--space-8);
  border-top: 1px solid transparent;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.footer-copyright {
  font-size: var(--text-sm);
  opacity: 0.7;
}

.footer-legal {
  display: flex;
  gap: var(--space-6);
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-legal li {
  font-size: var(--text-sm);
}

.footer-legal a {
  text-decoration: none;
  opacity: 0.7;
  transition: all var(--transition-base);
}

.footer-legal a:hover {
  opacity: 1;
}

/* ============================================================================
   MODERN THEME - Refined Elegance
   ========================================================================= */

.theme-modern .footer {
  background: linear-gradient(
    180deg,
    transparent 0%,
    color-mix(in srgb, var(--color-surface) 30%, transparent 70%) 100%
  );
}

.theme-modern .footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--color-border) 20%,
    var(--color-border) 80%,
    transparent 100%
  );
}

.theme-modern .footer-logo {
  position: relative;
}

.theme-modern .footer-logo::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(
    90deg,
    var(--color-primary) 0%,
    transparent 50%
  );
  opacity: 0.5;
}

.theme-modern .footer-links a::before {
  background: var(--color-primary);
}

.theme-modern .footer-links a:hover {
  padding-left: var(--space-3);
  color: var(--color-primary);
}

.theme-modern .footer-contact li .icon {
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--color-surface) 100%, var(--color-primary) 5%),
    var(--color-surface)
  );
  border: 1px solid color-mix(in srgb, var(--color-border) 70%, var(--color-primary) 30%);
}

.theme-modern .social-link {
  background: linear-gradient(
    135deg,
    var(--color-surface) 0%,
    color-mix(in srgb, var(--color-surface) 95%, var(--color-primary) 5%) 100%
  );
  border-color: var(--color-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.theme-modern .social-link:hover {
  background: linear-gradient(
    135deg,
    var(--color-primary) 0%,
    color-mix(in srgb, var(--color-primary) 90%, var(--color-accent) 10%) 100%
  );
  border-color: var(--color-primary);
  color: var(--color-primary-text);
  box-shadow:
    0 4px 16px var(--color-primary-glow),
    0 2px 8px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.theme-modern .footer-column-title::after {
  background: linear-gradient(
    90deg,
    var(--color-primary) 0%,
    color-mix(in srgb, var(--color-primary) 50%, transparent 50%) 100%
  );
}

.theme-modern .footer::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 200px;
  height: 200px;
  background: radial-gradient(
    circle at bottom right,
    color-mix(in srgb, var(--color-primary) 8%, transparent 92%),
    transparent 70%
  );
  pointer-events: none;
}

/* ============================================================================
   CREATIVE THEME - Vibrant Gradients & Playful Energy
   ========================================================================= */

.theme-creative .footer {
  background: linear-gradient(
    180deg,
    transparent 0%,
    color-mix(in srgb, var(--color-surface) 40%, transparent 60%) 100%
  );
}

.theme-creative .footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--color-primary) 0%,
    var(--color-accent) 33%,
    var(--color-secondary) 66%,
    var(--color-primary) 100%
  );
  background-size: 200% 100%;
  animation: rainbow-slide 8s linear infinite;
}

@keyframes rainbow-slide {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.theme-creative .footer-logo {
  position: relative;
  animation: float-gentle 6s ease-in-out infinite;
}

@keyframes float-gentle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.theme-creative .footer-logo::before {
  content: '';
  position: absolute;
  top: -10px;
  right: -10px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    var(--color-accent),
    var(--color-secondary)
  );
  opacity: 0.6;
  filter: blur(8px);
  animation: pulse-color 3s ease-in-out infinite;
}

@keyframes pulse-color {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.5); opacity: 0.3; }
}

.theme-creative .footer-links a::before {
  background: linear-gradient(
    180deg,
    var(--color-primary),
    var(--color-accent)
  );
  width: 3px;
  height: 100%;
}

.theme-creative .footer-links a:hover {
  padding-left: var(--space-4);
  color: var(--color-primary);
  transform: translateX(3px);
}

.theme-creative .footer-contact li .icon {
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--color-primary) 20%, var(--color-surface) 80%),
    color-mix(in srgb, var(--color-accent) 20%, var(--color-surface) 80%)
  );
  border: 2px solid transparent;
  background-clip: padding-box;
}

.theme-creative .footer-contact li:hover .icon {
  background: linear-gradient(
    135deg,
    var(--color-primary),
    var(--color-accent)
  );
  color: var(--color-primary-text);
  border-color: var(--color-accent);
}

.theme-creative .social-link {
  background: linear-gradient(
    135deg,
    var(--color-surface) 0%,
    color-mix(in srgb, var(--color-surface) 90%, var(--color-primary) 10%) 100%
  );
  border-color: var(--color-border);
}

.theme-creative .social-link::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    120deg,
    transparent 0%,
    rgba(255, 255, 255, 0.15) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  background-position: 200% 0;
  transition: background-position 0.6s ease;
}

.theme-creative .social-link:hover::after {
  background-position: -100% 0;
}

.theme-creative .social-link:hover {
  background: linear-gradient(
    135deg,
    var(--color-primary) 0%,
    var(--color-accent) 50%,
    var(--color-secondary) 100%
  );
  border-color: var(--color-accent);
  color: var(--color-primary-text);
  box-shadow:
    0 4px 20px var(--color-accent-glow),
    0 2px 10px rgba(0, 0, 0, 0.2);
  transform: translateY(-3px) rotate(3deg);
}

.theme-creative .footer-column-title::after {
  background: linear-gradient(
    90deg,
    var(--color-primary) 0%,
    var(--color-accent) 50%,
    var(--color-secondary) 100%
  );
  height: 3px;
}

.theme-creative .footer-content::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -50px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--color-primary) 25%, transparent 75%),
    transparent 70%
  );
  animation: float-orb 12s ease-in-out infinite;
  pointer-events: none;
}

.theme-creative .footer-content::after {
  content: '';
  position: absolute;
  bottom: -80px;
  left: 10%;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--color-accent) 20%, transparent 80%),
    transparent 70%
  );
  animation: float-orb 15s ease-in-out infinite reverse;
  pointer-events: none;
}

@keyframes float-orb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.1); }
  66% { transform: translate(-20px, 10px) scale(0.9); }
}

/* ============================================================================
   3D THEME - Futuristic Glass with Neon
   ========================================================================= */

.theme-threed .footer {
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(var(--color-surface-rgb), 0.3) 100%
  );
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.theme-threed .footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--color-primary) 25%,
    var(--color-accent) 50%,
    var(--color-primary) 75%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: holographic-scan 4s linear infinite;
  box-shadow: 0 0 20px var(--color-accent-glow);
}

@keyframes holographic-scan {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.theme-threed .footer-logo {
  position: relative;
  text-shadow: 0 0 20px var(--color-primary-glow);
  animation: neon-flicker 4s ease-in-out infinite;
}

@keyframes neon-flicker {
  0%, 100% {
    text-shadow:
      0 0 10px var(--color-primary-glow),
      0 0 20px var(--color-primary-glow);
  }
  50% {
    text-shadow:
      0 0 15px var(--color-primary-glow),
      0 0 30px var(--color-primary-glow),
      0 0 40px var(--color-accent-glow);
  }
}

.theme-threed .footer-logo::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 80%;
  height: 2px;
  background: linear-gradient(
    90deg,
    var(--color-primary),
    var(--color-accent),
    transparent
  );
  box-shadow: 0 0 15px var(--color-accent-glow);
}

.theme-threed .footer-links a::before {
  background: linear-gradient(
    180deg,
    var(--color-primary),
    var(--color-accent)
  );
  width: 2px;
  box-shadow: 0 0 10px var(--color-accent-glow);
}

.theme-threed .footer-links a::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(var(--color-accent-rgb, 99, 102, 241), 0.1) 50%,
    transparent 100%
  );
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}

.theme-threed .footer-links a:hover {
  padding-left: var(--space-4);
  color: var(--color-accent);
  text-shadow: 0 0 10px var(--color-accent-glow);
}

.theme-threed .footer-links a:hover::after {
  transform: translateX(100%);
}

.theme-threed .footer-contact li .icon {
  background: linear-gradient(
    135deg,
    rgba(var(--color-surface-rgb), 0.9),
    rgba(var(--color-surface-rgb), 0.6)
  );
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid color-mix(in srgb, var(--color-primary) 30%, transparent 70%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 15px rgba(0, 0, 0, 0.3);
}

.theme-threed .footer-contact li:hover .icon {
  background: linear-gradient(
    135deg,
    rgba(var(--color-primary-rgb, 99, 102, 241), 0.8),
    rgba(var(--color-accent-rgb, 99, 102, 241), 0.6)
  );
  border-color: var(--color-accent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 0 25px var(--color-accent-glow),
    0 4px 15px rgba(0, 0, 0, 0.5);
  color: var(--color-primary-text);
}

.theme-threed .social-link {
  background: linear-gradient(
    135deg,
    rgba(var(--color-surface-rgb), 0.9),
    rgba(var(--color-surface-rgb), 0.7)
  );
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-color: color-mix(in srgb, var(--color-border) 50%, var(--color-primary) 50%);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.theme-threed .social-link::before {
  background: radial-gradient(
    circle at center,
    var(--color-accent-glow),
    transparent 70%
  );
}

.theme-threed .social-link::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: var(--radius-md);
  background: linear-gradient(
    135deg,
    var(--color-primary),
    var(--color-accent)
  );
  opacity: 0;
  filter: blur(8px);
  transition: opacity 0.3s ease;
  z-index: -1;
  animation: neon-pulse-social 2s ease-in-out infinite;
}

@keyframes neon-pulse-social {
  0%, 100% { opacity: 0; }
  50% { opacity: 0.3; }
}

.theme-threed .social-link:hover {
  background: linear-gradient(
    135deg,
    rgba(var(--color-primary-rgb, 99, 102, 241), 0.9),
    rgba(var(--color-accent-rgb, 99, 102, 241), 0.8)
  );
  border-color: var(--color-accent);
  color: var(--color-primary-text);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.4),
    0 0 40px var(--color-accent-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: translateY(-4px);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.theme-threed .social-link:hover::before {
  opacity: 1;
}

.theme-threed .social-link:hover::after {
  animation: neon-pulse-social-hover 1.5s ease-in-out infinite;
}

@keyframes neon-pulse-social-hover {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 0.8; }
}

.theme-threed .footer-column-title {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-shadow: 0 0 10px var(--color-primary-glow);
}

.theme-threed .footer-column-title::after {
  background: linear-gradient(
    90deg,
    var(--color-primary) 0%,
    var(--color-accent) 100%
  );
  height: 2px;
  box-shadow: 0 0 10px var(--color-accent-glow);
}

.theme-threed .footer-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(var(--color-accent-rgb, 99, 102, 241), 0.03) 2px,
    rgba(var(--color-accent-rgb, 99, 102, 241), 0.03) 4px
  );
  pointer-events: none;
  opacity: 0.5;
}

.theme-threed .footer::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 400px;
  height: 400px;
  background: radial-gradient(
    circle at bottom right,
    color-mix(in srgb, var(--color-accent) 15%, transparent 85%),
    transparent 60%
  );
  animation: holographic-pulse 4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes holographic-pulse {
  0%, 100% {
    opacity: 0.5;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.1);
  }
}

.theme-threed .footer-content::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(var(--color-primary-rgb, 99, 102, 241), 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--color-primary-rgb, 99, 102, 241), 0.05) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
  opacity: 0.3;
}

/* ============================================================================
   RESPONSIVE
   ========================================================================= */

@media (max-width: 1024px) {
  .footer-content {
    grid-template-columns: 2fr 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .footer-tagline {
    max-width: 100%;
  }

  .footer-newsletter {
    max-width: 100%;
  }

  .newsletter-form {
    flex-direction: column;
  }

  .newsletter-button {
    width: 100%;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .footer-legal {
    justify-content: center;
  }

  /* Center footer columns on mobile */
  .footer-column {
    text-align: center;
  }

  .footer-column-title::after {
    left: 50%;
    transform: translateX(-50%);
  }

  .footer-social {
    justify-content: center;
  }

  .footer-links {
    align-items: center;
  }

  .footer-contact li {
    justify-content: center;
  }

  /* Hide decorative elements on mobile */
  .theme-modern .footer::after,
  .theme-creative .footer-content::before,
  .theme-creative .footer-content::after,
  .theme-threed .footer::after {
    display: none;
  }
}

/* ============================================================================
   ACCESSIBILITY - Reduced Motion
   ========================================================================= */

@media (prefers-reduced-motion: reduce) {
  .theme-modern .footer::after,
  .theme-creative .footer-logo,
  .theme-creative .footer::before,
  .theme-creative .footer-content::before,
  .theme-creative .footer-content::after,
  .theme-threed .footer::before,
  .theme-threed .footer-logo,
  .social-link,
  .footer-links a,
  .footer-contact li .icon {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}
