/* ======================================
   FOOTER ROOT
====================================== */
.app-footer {
  position: sticky;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(25, 118, 210, 0.1);
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
  z-index: 50;
  height: var(--footer-height);
  display: flex;
  align-items: center;
  margin-top: auto;
}

.footer-content {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 var(--spacing-4);
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
  width: 100%;
  min-height: var(--footer-height);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
  flex-shrink: 0;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
  flex-shrink: 0;
}

.footer-copyright {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Footer Link - Estilo de botón real */
.footer-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  border-radius: 8px;
  border: 1.5px solid #2563eb;
  background: #ffffff;
  color: #1e40af;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  min-height: 32px;
  position: relative;
  white-space: nowrap;
}

.footer-link:hover {
  background: #eff6ff;
  border-color: #1d4ed8;
  color: #1e3a8a;
  box-shadow: 0 4px 6px rgba(37, 99, 235, 0.15),
    0 2px 4px rgba(37, 99, 235, 0.08);
  transform: translateY(-1px);
}

.footer-link:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
  background: #dbeafe;
}

.footer-link:focus {
  outline: 3px solid #60a5fa;
  outline-offset: 2px;
}

.footer-link:focus:not(:focus-visible) {
  outline: none;
}

/* Footer Link Brand - Botón primario coherente con el diseño */
.footer-link.brand {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  border-color: #2563eb;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}

.footer-link.brand:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
  border-color: #1d4ed8;
  color: #ffffff;
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.3);
  transform: translateY(-1px);
}

.footer-link.brand:active {
  background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 100%);
  border-color: #1e40af;
  transform: translateY(0);
}

.footer-link strong {
  font-weight: 500;
  color: inherit;
}

/* Responsive */
@media (max-width: 768px) {
  .footer-content {
    padding: 0 1rem;
    flex-direction: row;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 0.5rem;
  }

  .footer-brand {
    flex-direction: row;
    gap: 0.375rem;
    flex-shrink: 1;
    min-width: 0;
  }

  .footer-links {
    gap: 0.375rem;
    flex-shrink: 0;
  }

  .footer-copyright {
    font-size: 0.75rem;
  }

  .footer-link {
    font-size: 0.75rem;
    padding: 0.4375rem 0.75rem;
    min-height: 34px;
    border-radius: 8px;
    gap: 0.25rem;
  }
}

@media (max-width: 640px) {
  .footer-content {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    justify-content: space-between;
  }

  .footer-brand {
    flex-shrink: 1;
    min-width: 0;
  }

  .footer-copyright {
    font-size: 0.7rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .footer-links {
    justify-content: flex-end;
    flex-shrink: 0;
    gap: 0.25rem;
  }

  .footer-link {
    font-size: 0.7rem;
    padding: 0.375rem 0.625rem;
    min-height: 32px;
    border-radius: 6px;
  }
}

@media (max-width: 480px) {
  .app-footer {
    height: auto;
    min-height: var(--footer-height);
    padding: 0.5rem 0;
  }

  .footer-content {
    padding: 0 0.75rem;
    flex-direction: row;
    gap: 0.5rem;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
  }

  .footer-brand {
    order: 1;
    justify-content: flex-start;
    width: auto;
    flex-direction: row;
    gap: 0.5rem;
    flex-shrink: 0;
  }

  .footer-links {
    order: 2;
    justify-content: flex-end;
    width: auto;
    flex-direction: row;
    gap: 0.5rem;
    flex-shrink: 0;
  }

  .footer-copyright {
    font-size: 0.65rem;
    order: 0;
    margin-bottom: 0;
    margin-right: 0.5rem;
  }

  .footer-link {
    font-size: 0.75rem;
    padding: 0.5rem 1.25rem;
    min-height: 36px;
    border-radius: 8px;
    width: auto;
    max-width: none;
  }
}

/* Extra small devices */
@media (max-width: 360px) {
  .footer-content {
    padding: 0 0.5rem;
    gap: 0.5rem;
  }

  .footer-link {
    font-size: 0.65rem;
    padding: 0.375rem 0.75rem;
    min-height: 32px;
    border-radius: 6px;
    max-width: 120px;
  }

  .footer-copyright {
    font-size: 0.6rem;
  }
}

/* Dark Theme */
[data-theme="dark"] .app-footer {
  background: rgba(17, 24, 39, 0.95);
  border-top-color: rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .footer-link {
  background: rgba(30, 58, 138, 0.1);
  border-color: #3b82f6;
  color: #93c5fd;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .footer-link:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: #60a5fa;
  color: #dbeafe;
  box-shadow: 0 4px 6px rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .footer-link.brand {
  background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
  border-color: #3b82f6;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}

[data-theme="dark"] .footer-link.brand:hover {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  border-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 3px 8px rgba(59, 130, 246, 0.4);
}

/* High Contrast */
[data-theme="contrast"] .footer-link {
  background: #ffffff;
  border: 3px solid #000000;
  color: #000000;
  font-weight: 700;
  box-shadow: none;
}

[data-theme="contrast"] .footer-link:hover {
  background: #000000;
  color: #ffffff;
}

[data-theme="contrast"] .footer-link:focus {
  outline: 4px solid #2563eb;
  outline-offset: 3px;
}

[data-theme="contrast"] .footer-link.brand {
  background: #000000;
  color: #ffffff;
  border: 3px solid #000000;
}

[data-theme="contrast"] .footer-link.brand:hover {
  background: #ffffff;
  color: #000000;
}

/* Reducción de movimiento */
@media (prefers-reduced-motion: reduce) {
  .footer-link {
    transition: none;
  }

  .footer-link:hover,
  .footer-link:active {
    transform: none;
  }
}
