:root {
  --primary: #4a6fa5;
  --secondary: #166088;
  --accent: #4fc3dc;
  --accent-gradient: linear-gradient(135deg, #4fc3dc, #3498db);
  --light: #f9f9f9;
  --dark: #333;
  --success: #28a745;
  --card-shadow: 0 10px 20px rgba(0,0,0,0.1);
  --hover-transform: translateY(-10px);
  --transition: all 0.3s ease-in-out;
  --header-gradient: linear-gradient(135deg, #3a7bd5, #00d2ff);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: var(--light);
  color: var(--dark);
  overflow-x: hidden;
}

header {
  background: var(--header-gradient);
  color: white;
  padding: 3rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.header-content {
  position: relative;
  z-index: 2;
  padding: 0 20px; 
}

header h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
  letter-spacing: 1px;
}

header p {
  font-size: 1.3rem;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

.bubbles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: hidden;
}

.bubble {
  position: absolute;
  bottom: -100px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  animation: rise 8s infinite ease-in;
  backdrop-filter: blur(1px);
}

.bubble:nth-child(1) {
  width: 40px;
  height: 40px;
  left: 10%;
  animation-duration: 8s;
}

.bubble:nth-child(2) {
  width: 20px;
  height: 20px;
  left: 20%;
  animation-duration: 5s;
  animation-delay: 1s;
}

.bubble:nth-child(3) {
  width: 50px;
  height: 50px;
  left: 35%;
  animation-duration: 7s;
  animation-delay: 2s;
}

.bubble:nth-child(4) {
  width: 80px;
  height: 80px;
  left: 50%;
  animation-duration: 11s;
  animation-delay: 0s;
}

.bubble:nth-child(5) {
  width: 35px;
  height: 35px;
  left: 55%;
  animation-duration: 6s;
  animation-delay: 1s;
}

.bubble:nth-child(6) {
  width: 45px;
  height: 45px;
  left: 65%;
  animation-duration: 8s;
  animation-delay: 3s;
}

.bubble:nth-child(7) {
  width: 25px;
  height: 25px;
  left: 75%;
  animation-duration: 7s;
  animation-delay: 2s;
}

.bubble:nth-child(8) {
  width: 80px;
  height: 80px;
  left: 80%;
  animation-duration: 10s;
  animation-delay: 1s;
}

@keyframes rise {
  0% {
    transform: translateY(0) rotate(0);
    opacity: 1;
  }
  100% {
    transform: translateY(-500px) rotate(360deg);
    opacity: 0;
  }
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1rem;
}

.section-title {
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
  padding-bottom: 1rem;
  font-size: 2.2rem;
  color: var(--secondary);
}

.section-title:after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 4px;
  background: var(--accent-gradient);
  border-radius: 20px;
}

.cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  perspective: 1000px;
}

.card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  border: 1px solid rgba(0,0,0,0.05);
  transform-style: preserve-3d;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
              box-shadow 0.4s ease,
              opacity 0.4s ease;
  opacity: 1;
  height: auto;
}

.card:hover {
  transform: var(--hover-transform) rotate(1deg);
  box-shadow: 0 15px 30px rgba(0,0,0,0.2);
}

.card-image {
  width: 100%;
  height: 180px;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
  transition: all 0.5s ease;
}

.card-image:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(74, 111, 165, 0.3);
  transition: var(--transition);
}

.card:hover .card-image {
  transform: scale(1.05);
}

.card:hover .card-image:before {
  background: rgba(74, 111, 165, 0.1);
}

.card-content {
  padding: 1.8rem;
}

.card-title {
  font-size: 1.4rem;
  margin-bottom: 0.8rem;
  color: var(--secondary);
  position: relative;
  display: inline-block;
}

.card-title:after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.card:hover .card-title:after {
  width: 100%;
}

.card-text {
  color: #666;
  margin-bottom: 1.5rem;
  line-height: 1.6;
  font-size: 1.05rem;
}

.card-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--accent);
  color: white;
  padding: 0.3rem 0.9rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: bold;
  box-shadow: 0 3px 6px rgba(0,0,0,0.1);
  z-index: 2;
  transform: translateY(0);
  transition: all 0.3s ease;
}

.card:hover .card-badge {
  transform: translateY(-3px);
  box-shadow: 0 5px 10px rgba(0,0,0,0.2);
}

.card-link {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  background: var(--primary);
  color: white;
  text-decoration: none;
  border-radius: 30px;
  font-weight: 500;
  transition: var(--transition);
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.card-link:before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--secondary);
  transition: all 0.3s ease;
  z-index: -1;
}

.card-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.card-link:hover:before {
  left: 0;
}

.categories {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 3.5rem;
}

.category-btn {
  padding: 0.6rem 1.8rem;
  background: white;
  border: 2px solid var(--primary);
  border-radius: 30px;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  z-index: 1;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.category-btn:before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--primary);
  transition: all 0.3s ease;
  z-index: -1;
}

.category-btn:hover:before, .category-btn.active:before {
  left: 0;
}

.category-btn:hover, .category-btn.active {
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

footer {
  background: linear-gradient(to right, #2c3e50, #1a2533);
  color: white;
  padding: 40px 0 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.footer-content {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
  padding: 0 20px;
}

.footer-content h3 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  color: var(--accent);
}

.footer-content p {
  margin: 1rem 0;
  line-height: 1.6;
}

.social-links {
  display: flex;
  justify-content: center;
  margin: 20px 0;
  gap: 15px;
}

.social-link {
  display: inline-block;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  padding: 12px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.social-link:hover {
  background: var(--accent);
  transform: translateY(-5px) rotate(5deg);
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.social-link svg {
  fill: white;
  transition: all 0.3s ease;
}

/* Parallax effect for header */
.parallax-header {
  transform: translateZ(0);
}

/* Loading animation for cards */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease forwards;
}

/* Responsive improvements */
@media (max-width: 768px) {
  header h1 {
    font-size: 2.2rem;
  }
  
  header p {
    font-size: 1.1rem;
  }
  
  .cards-container {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
  
  .section-title {
    font-size: 1.8rem;
  }
  
  .card-title {
    font-size: 1.25rem;
  }
}

/* Added animations for filtering */

.card.hide {
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
  z-index: -1; /* Asegura que esté por debajo de las tarjetas visibles */
  transition: transform 0s ease, 
              opacity 0s ease, 
              z-index 0s linear 0s; /* Aplica z-index después de la transición */
}

.card.show {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
  z-index: 1;
  transition: transform 0s ease, 
              opacity 0s ease;
}

@keyframes cardAppear {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}