/* CSS Variables for theming */
:root {
  --background: oklch(0.985 0 0);
  --foreground: oklch(0.205 0 0);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.205 0 0);
  --primary: oklch(0.269 0 0);
  --primary-foreground: oklch(0.985 0 0);
  --secondary: oklch(0.922 0 0);
  --secondary-foreground: oklch(0.205 0 0);
  --muted: oklch(0.97 0 0);
  --muted-foreground: oklch(0.556 0 0);
  --accent: oklch(0.922 0 0);
  --accent-foreground: oklch(0.205 0 0);
  --border: oklch(0.878 0 0);
  --ring: oklch(0.269 0 0);
  --radius: 0.625rem;
}

.dark {
  --background: oklch(0.145 0 0);
  --foreground: oklch(0.985 0 0);
  --card: oklch(0.205 0 0);
  --card-foreground: oklch(0.985 0 0);
  --primary: oklch(0.985 0 0);
  --primary-foreground: oklch(0.205 0 0);
  --secondary: oklch(0.269 0 0);
  --secondary-foreground: oklch(0.985 0 0);
  --muted: oklch(0.269 0 0);
  --muted-foreground: oklch(0.708 0 0);
  --accent: oklch(0.269 0 0);
  --accent-foreground: oklch(0.985 0 0);
  --border: oklch(0.269 0 0);
  --ring: oklch(0.708 0 0);
}

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", sans-serif;
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s, color 0.3s;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Navigation */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: all 0.3s;
}

.nav.scrolled {
  background-color: color-mix(in srgb, var(--background) 55%, transparent);
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
}

.nav-logo {
  font-size: 1.25rem;
  font-weight: bold;
  color: var(--foreground);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.3s;
}

.nav-logo:hover {
  color: var(--primary);
}

.nav-links {
  display: none;
  gap: 1.5rem;
}

.nav-links button {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.3s;
}

.nav-links button:hover {
  color: var(--foreground);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-btn {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--foreground);
  transition: background-color 0.3s;
}

.icon-btn:hover {
  background-color: var(--accent);
}

.icon {
  width: 1.25rem;
  height: 1.25rem;
}

.hidden {
  display: none;
}

/* Dropdown */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  min-width: 110px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s;
}

.dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu button {
  display: block;
  width: 100%;
  padding: 0.5rem 1rem;
  text-align: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--foreground);
  transition: background-color 0.2s;
}

.dropdown-menu button:hover {
  background-color: var(--accent);
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 4rem 1rem;
  overflow: hidden;
}

.hero-background {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.gradient-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--primary) 5%, transparent),
    var(--background),
    color-mix(in srgb, var(--accent) 5%, transparent)
  );
}

.waves {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.3;
  color: var(--primary);
}

.wave {
  animation: wave-horizontal 15s linear infinite;
}

.wave-2 {
  animation-delay: -5s;
}

.wave-3 {
  animation-duration: 20s;
  animation-delay: -10s;
}

@keyframes wave-horizontal {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-500px);
  }
}

.particles {
  position: absolute;
  inset: 0;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background-color: color-mix(in srgb, var(--primary) 20%, transparent);
  border-radius: 50%;
  animation: float 15s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0) translateX(0);
    opacity: 0;
  }
  10% {
    opacity: 0.3;
  }
  50% {
    transform: translateY(-100px) translateX(20px);
    opacity: 0.5;
  }
  90% {
    opacity: 0.3;
  }
}

.hero-content {
  text-align: center;
  position: relative;
  z-index: 10;
  max-width: 56rem;
}

.hero-greeting {
  color: var(--muted-foreground);
  font-size: 1.125rem;
  margin-bottom: 1rem;
}

.hero-name {
  font-size: 3rem;
  font-weight: bold;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 1.5rem;
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--muted-foreground);
  max-width: 42rem;
  margin: 0 auto;
}

.scroll-down {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted-foreground);
  animation: bounce 2s infinite;
  z-index: 10;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(-10px);
  }
}

/* Sections */
.section {
  padding: 6rem 1rem;
}

.section-alt {
  background-color: color-mix(in srgb, var(--muted) 30%, transparent);
}

.section-title {
  font-size: 2.5rem;
  font-weight: bold;
  text-align: center;
  margin-bottom: 4rem;
}

/* About Section */
.about-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3rem;
}

.about-photo {
  position: relative;
  flex-shrink: 0;
}

.photo-glow {
  position: absolute;
  inset: 0;
  background-color: color-mix(in srgb, var(--primary) 10%, transparent);
  border-radius: 50%;
  filter: blur(3rem);
}

.photo-wrapper {
  position: relative;
  width: 16rem;
  height: 16rem;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid color-mix(in srgb, var(--primary) 20%, transparent);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.photo-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-text {
  flex: 1;
}

.about-text p {
  font-size: 1.125rem;
  color: var(--muted-foreground);
  line-height: 1.75;
  text-align: center;
}

/* Skills Section */
.skills-carousel {
    position: relative;
    overflow: hidden;
    width: 100%;
}

.skills-track {
    display: flex;
    gap: 1.5rem;
    will-change: transform;
}

.skill-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--card);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    min-width: 10rem;
    flex-shrink: 0;
    margin: 1rem 0;
    transition: all 0.3s ease;
}

.skill-icon {
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 0.5rem;
  }

  .skill-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: none;
}

.dark .skill-icon img {
    filter: drop-shadow(0 0 1.5px rgba(255, 255, 255, 0.4));
}

.skill-name {
    font-weight: 500;
}

/* Skill Tooltip */
.skill-tooltip {
  display: none; 
  position: fixed;
  z-index: 1000;
  max-width: 250px;
  pointer-events: auto;
}

.skill-tooltip-content {
  background-color: var(--card);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  text-align: center;
  font-size: 0.9rem;
  position: relative;
}

.skill-tooltip-content h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
  font-weight: 600;
}

.skill-tooltip-content p {
  margin: 0;
  line-height: 1.4;
}

.skill-tooltip-arrow {
  position: absolute;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid var(--card);
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
}

.skill-tooltip-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text);
  line-height: 1;
}

.skill-tooltip-close:hover {
  color: var(--accent);
}

/* Posición alternativa (si está arriba) */
.skill-tooltip.top .skill-tooltip-arrow {
  border-top: none;
  border-bottom: 8px solid var(--card);
  top: -8px;
  bottom: auto;
}

/* Dark theme adjustments */
.dark .skill-tooltip-content {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.skill-card-active {
  border: 2px solid var(--accent); /* Usa variable de acento para que se adapte al tema */
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); /* Sombra sutil para resaltado */
  transform: scale(1.05); /* Ligero zoom para énfasis */
}

/* Ajustes para tema oscuro */
.dark .skill-card-active {
  box-shadow: 0 0 10px var(--accent);
}

/* Projects Section */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 3rem;
}

.filter-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: transparent;
  color: var(--foreground);
  cursor: pointer;
  transition: all 0.3s;
  font-size: 0.875rem;
}

.filter-btn:hover {
  background-color: var(--accent);
}

.filter-btn.active {
  background-color: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  background-color: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.3s;
}

.project-card:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.project-image {
  width: 100%;
  height: 12rem;
  object-fit: cover;
}

.project-header {
  padding: 1.5rem;
}

.project-title-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.project-title {
  font-size: 1.25rem;
  font-weight: bold;
}

.badge {
  padding: 0.25rem 0.75rem;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.75rem;
  font-weight: 500;
  background-color: var(--secondary);
  color: var(--secondary-foreground);
  flex-shrink: 0;
}

.badge-outline {
  background-color: transparent;
  border: 1px solid var(--border);
}

.project-description {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.5;
}

.project-content {
  padding: 0 1.5rem 1.5rem;
  flex: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.project-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  border: none;
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--border);
  color: var(--foreground);
}

.btn-outline:hover {
  background-color: var(--accent);
}

/* Timeline (Education) */
.timeline {
  position: relative;
  max-width: 56rem;
  margin: 0 auto;
}

.timeline-line {
  position: absolute;
  left: 2rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: var(--border);
}

.timeline-item {
  position: relative;
  margin-bottom: 3rem;
  padding-left: 4rem;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-icon {
  position: absolute;
  left: 0;
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background-color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-foreground);
  z-index: 10;
}

.timeline-content {
  background-color: var(--card);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.timeline-year {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-bottom: 0.5rem;
}

.timeline-degree {
  font-size: 1.25rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.timeline-institution {
  color: var(--primary);
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.timeline-description {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.5;
}

/* Experience Section */
.experience-list {
  max-width: 56rem;
  margin: 0 auto;
}

.experience-item {
  position: relative;
  padding-left: 4rem;
  padding-bottom: 2rem;
  border-left: 2px solid var(--border);
}

.experience-item:last-child {
  border-left: none;
  padding-bottom: 0;
}

.experience-icon {
  position: absolute;
  left: -1.5rem;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background-color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-foreground);
}

.experience-content {
  background-color: var(--card);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.experience-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.experience-position {
  font-size: 1.25rem;
  font-weight: bold;
}

.experience-company {
  color: var(--primary);
  font-weight: 500;
}

.experience-meta {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.experience-description {
  color: var(--muted-foreground);
  line-height: 1.75;
}

/* Contact Section */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  max-width: 64rem;
  margin: 0 auto;
}

.contact-card {
  background-color: var(--card);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.3s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

.contact-card:hover {
  box-shadow: 0 0 15px -1px rgba(0, 0, 0, 0.1);
}

/* hover estilo oscuro */
.dark .contact-card:hover {
  box-shadow: 0 0 15px -1px rgba(255, 255, 255, 0.2);
}

.contact-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.contact-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background-color: color-mix(in srgb, var(--primary) 10%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.contact-title {
  font-size: 1.125rem;
  font-weight: bold;
}

.contact-value {
  color: var(--muted-foreground);
}

/* Footer */
.footer {
  padding: 3rem 1rem;
  border-top: 1px solid var(--border);
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

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

/* Responsive Design */
@media (min-width: 1000px) {
  .nav-links {
    display: flex;
  }

  .hero-name {
    font-size: 4.5rem;
  }

  .hero-title {
    font-size: 1.875rem;
  }

  .hero-subtitle {
    font-size: 1.25rem;
  }

  .section-title {
    font-size: 3rem;
  }

  .about-content {
    flex-direction: row;
    gap: 4rem;
  }

  .photo-wrapper {
    width: 20rem;
    height: 20rem;
  }

  .about-text p {
    text-align: left;
  }

  .mobile-only {
    display: none;
  }

  .desktop-only {
    display: block;
  }

  .timeline-line {
    left: 50%;
  }

  .timeline-item {
    padding-left: 0;
  }

  .timeline-item:nth-child(odd) {
    padding-right: calc(50% + 3rem);
  }

  .timeline-item:nth-child(even) {
    padding-left: calc(50% + 3rem);
    text-align: right;
  }

  .timeline-icon {
    left: 50%;
    transform: translateX(-50%);
  }

  .experience-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: start;
  }

  .experience-meta {
    text-align: right;
  }

  .footer-content {
    flex-direction: row;
  }

  .footer-text {
    text-align: left;
  }
}

@media (max-width: 767px) {
    .skill-card {
        min-width: 8rem; /* Más pequeño en mobile para caber más */
        padding: 1.5rem;
    }
}
