:root {
  --primary-color: #00ff9d;
  --secondary-color: #0a192f;
  --accent-color: #64ffda;
  --text-color: #8892b0;
  --card-bg: rgba(17, 34, 64, 0.95);
}

body {
  margin: 0;
  padding: 0;
  background: var(--secondary-color);
  font-family: "Fira Code", monospace;
  color: var(--text-color);
}

/* Navegación */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(10, 25, 47, 0.95);
  z-index: 1000;
}

.nav-home {
  color: var(--primary-color);
  font-size: 1.5rem;
  text-decoration: none;
}

.download-btn {
  display: inline-block;
  background: transparent;
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
  padding: 0.5rem 1rem;
  border-radius: 5px;
  cursor: pointer;
  text-decoration: none;
  font: inherit;
  transition: all 0.3s ease;
}

.download-btn:hover {
  background: var(--primary-color);
  color: var(--secondary-color);
}

/* Contenedor principal */
.portfolio-container {
  max-width: 1200px;
  margin: 80px auto 2rem;
  padding: 0 2rem;
}

/* Secciones generales */
.card-section {
  background: var(--card-bg);
  border-radius: 15px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Perfil */
.profile-section {
  margin-bottom: 3rem;
}

/* Profile header container */
.profile-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  position: relative;
  width: 100%;
}

/* Profile info (texto) */
.profile-info {
  flex: 1;
  padding-right: 160px; /* Espacio para la imagen */
}

.profile-info h1 {
  color: var(--primary-color);
  font-size: 2.5rem;
  margin: 0;
}

.profile-info h2 {
  color: var(--accent-color);
  font-size: 1.5rem;
  margin: 0.5rem 0;
}

/* Profile image container */
.profile-image {
  width: 140px;
  height: 140px;
  position: absolute;
  top: 0;
  right: 40px;
  border-radius: 50%;
  border: 2px solid var(--primary-color);
  overflow: hidden;
  background: var(--card-bg);
  z-index: 10;
}

/* Profile image styling */
.profile-pic {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Timeline */
.timeline {
  position: relative;
  padding: 2rem 0;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 2px;
  background: var(--primary-color);
}

.timeline-item {
  margin-left: 2rem;
  padding: 1rem;
  position: relative;
  margin-bottom: 2rem;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -2.5rem;
  top: 1.5rem;
  width: 1rem;
  height: 1rem;
  background: var(--primary-color);
  border-radius: 50%;
}

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.skill-bar {
  margin-bottom: 1rem;
}

.progress-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.progress {
  height: 100%;
  background: var(--primary-color);
  transition: width 1s ease;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-tag {
  background: rgba(0, 255, 157, 0.1);
  color: var(--primary-color);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
}

.skill-level-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.skill-level-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  border-left: 3px solid var(--primary-color);
}

.skill-level-name {
  font-weight: 600;
  color: var(--text-color, #e6f1ff);
}

.skill-level-badge {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary-color);
  padding: 0.2rem 0.65rem;
  border-radius: 6px;
  background: rgba(0, 255, 157, 0.1);
  white-space: nowrap;
}

.skill-level-badge--high {
  border: 1px solid rgba(0, 255, 157, 0.45);
}

.skill-level-badge--mid {
  border: 1px solid rgba(0, 255, 157, 0.28);
  opacity: 0.95;
}

.skill-level-badge--base {
  border: 1px solid rgba(0, 255, 157, 0.18);
  opacity: 0.88;
}

/* Idiomas */
.language-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.language-card {
  background: rgba(255, 255, 255, 0.05);
  padding: 1rem;
  border-radius: 10px;
}

.level-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  margin-top: 0.5rem;
  position: relative;
}

.level-bar::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: var(--primary-color);
  border-radius: 2px;
  width: var(--level);
}

/* Motivaciones */
.motivations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.motivation-card {
  text-align: center;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.motivation-card i {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

/* Hobbies */
.hobbies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 1rem;
}

.hobby-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  transition: transform 0.3s ease;
}

.hobby-card:hover {
  transform: translateY(-5px);
}

.hobby-card i {
  font-size: 1.5rem;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

/* Media queries para responsividad */
@media screen and (max-width: 768px) {
  .profile-header {
    flex-direction: column;
    align-items: center;
  }

  .profile-info {
    padding-right: 0;
    text-align: center;
    margin-bottom: 20px;
  }

  .profile-image {
    position: relative;
    top: 0;
    right: 0;
    margin: 20px auto;
  }
}

/* Tablets y pantallas medianas */
@media screen and (max-width: 1024px) {
  .profile-image {
    width: 120px;
    height: 120px;
    top: 30px;
    right: 30px;
  }
}

/* Móviles pequeños */
@media screen and (max-width: 480px) {
  .profile-image {
    width: 90px;
    height: 90px;
    margin: 15px auto;
  }
}

/* Asegura la compatibilidad con navegadores antiguos */
@supports not (object-fit: cover) {
  .profile-pic {
    min-height: 100%;
    min-width: 100%;
    width: auto;
    height: auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
}
