/* Reset y configuración inicial */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Colores inspirados en el escudo UABC */
  --primary-color: #1B5E20;
  /* Verde oscuro del escudo */
  --secondary-color: #388E3C;
  /* Verde medio */
  --accent-color: #4CAF50;
  /* Verde claro */
  --gold-color: #FFB300;
  /* Dorado del escudo */
  --gold-light: #FFCA28;
  /* Dorado claro */
  --gold-dark: #FF8F00;
  /* Dorado oscuro */
  --blue-color: #1565C0;
  /* Azul del escudo */
  --blue-light: #42A5F5;
  /* Azul claro */
  --dark-green: #0D4F14;
  /* Verde muy oscuro */
  --light-green: #E8F5E8;
  --white: #ffffff;
  --gray-100: #f8f9fa;
  --gray-200: #e9ecef;
  --gray-800: #343a40;
  --shadow-light: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-medium: 0 10px 25px rgba(0, 0, 0, 0.1);
  --shadow-heavy: 0 20px 40px rgba(0, 0, 0, 0.15);
  /* Gradiente inspirado en los colores UABC */
  --gradient-bg: linear-gradient(135deg, #1565C0 0%, #1B5E20 50%, #FFB300 100%);
  --gradient-card: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
  --gradient-gold: linear-gradient(145deg, #FFB300 0%, #FFCA28 100%);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
  background: var(--gradient-bg);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Fondo animado con partículas en colores UABC */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 20% 50%, rgba(27, 94, 32, 0.3) 0%, transparent 50%), radial-gradient(circle at 80% 20%, rgba(255, 179, 0, 0.3) 0%, transparent 50%), radial-gradient(circle at 40% 80%, rgba(21, 101, 192, 0.3) 0%, transparent 50%);
  animation: float 20s ease-in-out infinite;
  z-index: -1;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }

  50% {
    transform: translateY(-20px) rotate(180deg);
  }
}

/* Header */
.header {
  text-align: center;
  padding: 60px 20px 40px;
  position: relative;
}

.header h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  color: var(--white);
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  letter-spacing: 2px;
  animation: slideDown 1s ease-out;
}

.header .subtitle {
  font-size: 1.2rem;
  color: var(--gold-light);
  font-weight: 300;
  animation: slideUp 1s ease-out 0.3s both;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Container */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px 60px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  place-items: center;
}

/* Cards */
.card {
  background: var(--gradient-card);
  border-radius: 24px;
  padding: 40px 30px;
  width: 100%;
  max-width: 350px;
  min-height: 280px;
  box-shadow: var(--shadow-medium);
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  animation: cardFadeIn 0.8s ease-out;
  animation-fill-mode: both;
}

.card:nth-child(1) {
  animation-delay: 0.1s;
}

.card:nth-child(2) {
  animation-delay: 0.2s;
}

.card:nth-child(3) {
  animation-delay: 0.3s;
}

.card:nth-child(4) {
  animation-delay: 0.4s;
}

.card:nth-child(5) {
  animation-delay: 0.5s;
}

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.9);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Efecto glassmorphism con colores UABC */
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  /* background: var(--gradient-gold); */
}

.card:hover {
  transform: translateY(-15px) scale(1.02);
  box-shadow: var(--shadow-heavy);
  border-color: var(--gold-dark);
}

/* Efecto glow en hover con colores UABC */
.card::after {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  /* background: linear-gradient(45deg, var(--primary-color), var(--gold-color), var(--blue-color)); */
  border-radius: 27px;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover::after {
  opacity: 0.8;
}

/* Contenedor de imagen */
.card-image {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 120px;
  margin-bottom: 20px;
  position: relative;
}

.card img {
  max-width: 100px;
  max-height: 100px;
  object-fit: contain;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  filter: drop-shadow(0 4px 8px rgba(27, 94, 32, 0.2));
}

.card:hover img {
  transform: scale(1.1) rotateY(5deg);
  /* filter: drop-shadow(0 8px 16px rgba(255, 179, 0, 0.3)); */
}

/* Icono para tarjetas sin imagen */
.card-icon {
  font-size: 4rem;
  color: var(--primary-color);
  margin-bottom: 20px;
  transition: all 0.4s ease;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.card:hover .card-icon {
  /* color: var(--gold-color); */
  transform: scale(1.1) rotateY(10deg);
  /* text-shadow: 2px 2px 8px rgba(255, 179, 0, 0.4); */
}

/* Texto */
.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-color);
  margin: 0;
  line-height: 1.4;
  text-align: center;
  transition: color 0.3s ease;
}

.card:hover .card-title {
  color: var(--blue-color);
}

/* Enlaces */
.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  height: 100%;
  position: relative;
}

.card-link:focus {
  outline: 3px solid var(--gold-color);
  outline-offset: 4px;
  border-radius: 24px;
}

/* Indicadores de estado con colores UABC */
.status-indicator {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--secondary-color);
  box-shadow: 0 0 0 3px rgba(56, 142, 60, 0.3);
  animation: pulse 2s infinite;
}

.status-indicator.inactive {
  background: var(--gold-color);
  box-shadow: 0 0 0 3px rgba(255, 179, 0, 0.3);
}

.status-indicator.warning {
  background: var(--blue-color);
  box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.3);
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(56, 142, 60, 0.7);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(56, 142, 60, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(56, 142, 60, 0);
  }
}

/* Diseño Responsivo */
@media (max-width: 768px) {
  .container {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 0 15px 40px;
  }

  .card {
    max-width: 100%;
    padding: 30px 25px;
    min-height: 250px;
  }

  .header {
    padding: 40px 15px 30px;
  }

  .header h1 {
    font-size: 2.5rem;
  }
}

@media (max-width: 480px) {
  .card {
    padding: 25px 20px;
    border-radius: 20px;
  }

  .card img {
    max-width: 80px;
    max-height: 80px;
  }

  .card-image {
    height: 100px;
  }

  .card-title {
    font-size: 1.1rem;
  }
}

/* Animación de carga */
.loading {
  opacity: 0;
  animation: fadeInUp 0.6s ease-out forwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scroll suave */
html {
  scroll-behavior: smooth;
}

/* Estilos de foco para accesibilidad */
*:focus {
  outline: 2px solid var(--gold-color);
  outline-offset: 2px;
}

/* Clases adicionales para elementos específicos */
.primary-text {
  color: var(--primary-color);
}

.gold-text {
  color: var(--gold-color);
}

.blue-text {
  color: var(--blue-color);
}

.gold-background {
  background: var(--gradient-gold);
}

.primary-background {
  background: var(--primary-color);
}

.blue-background {
  background: var(--blue-color);
}