:root {
  --bg-dark: #0a192f;
  --bg-light: #112240;
  --bg-card: #233554;
  --text-primary: #ccd6f6;
  --text-secondary: #8892b0;
  --accent: #64ffda;
  --accent-rgb: 100, 255, 218;
  --white: #e6f1ff;
  --font-main: 'Inter', sans-serif;
  --font-mono: 'Poppins', sans-serif;
  --transition: all 0.25s cubic-bezier(0.645, 0.045, 0.355, 1);
  --shadow: 0 10px 30px -10px rgba(2, 12, 27, 0.7);
  --nav-height: 80px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-main);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
  display: inline-block;
  position: relative;
}

ul {
  list-style: none;
}

/* Background Animation */
.background-globes {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.globe {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  animation: floatGlobe 20s infinite alternate;
}

.globe-1 {
  width: 400px;
  height: 400px;
  background: var(--accent);
  top: -100px;
  left: -100px;
}

.globe-2 {
  width: 500px;
  height: 500px;
  background: #7928ca;
  bottom: -150px;
  right: -150px;
  animation-duration: 25s;
}

@keyframes floatGlobe {
  0% { transform: translate(0, 0); }
  100% { transform: translate(50px, 50px); }
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  height: var(--nav-height);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 50px;
  background: rgba(10, 25, 47, 0.85);
  backdrop-filter: blur(10px);
  z-index: 1000;
  box-shadow: 0 10px 30px -10px rgba(2,12,27,0.7);
}

.logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.8rem;
  color: var(--accent);
  cursor: pointer;
}

.logo .dot {
  color: var(--white);
}

.nav-links {
  display: flex;
  gap: 30px;
  align-items: center;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-primary);
}

.nav-links a:hover, .nav-links a.active {
  color: var(--accent);
}

.nav-links a::after {
  content: '';
  display: block;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s;
}

.nav-links a:hover::after {
  width: 100%;
}

.btn-small {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 8px 16px;
  border-radius: 4px;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: var(--transition);
}

.btn-small:hover {
  background: rgba(100, 255, 218, 0.1);
}

.translate-btn {
  padding: 4px 8px;
  font-size: 0.8rem;
}

.nav-toggle {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--accent);
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 50px;
}

/* Section Common */
.section {
  padding: 100px 0;
  min-height: 80vh; /* Para que cada sección tenga altura considerable */
  display: flex; /* Para centrar contenido si es necesario */
  flex-direction: column;
  justify-content: center;
}

.section-header {
  margin-bottom: 50px;
  text-align: center;
}

.section-title {
  font-family: var(--font-mono);
  font-size: 2rem;
  color: var(--white);
  position: relative;
  display: inline-block;
  margin-bottom: 10px;
}

/* 
.section-title::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  background: var(--accent);
  margin: 10px auto 0;
}
*/

.section-subtitle {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 1rem;
}

/* Hero */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--nav-height);
}

.hero-content {
  flex: 1;
}

.greeting {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 1.1rem;
  margin-bottom: 20px;
  display: block;
}

.hero h1 {
  font-size: 4rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1.1;
  margin-bottom: 10px;
}

.hero h2 {
  font-size: 3rem;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.1;
  margin-bottom: 20px;
}

.hero .highlight {
  color: var(--accent);
}

.hero-text {
  max-width: 500px;
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 40px;
}

/* Code Card Visual */
.hero-visual {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.code-card {
  background: var(--bg-light);
  border-radius: 10px;
  width: 100%;
  max-width: 450px;
  box-shadow: var(--shadow);
  border: 1px solid #333;
  overflow: hidden;
  transform: rotate(3deg);
  transition: transform 0.3s;
}

.code-card:hover {
  transform: rotate(0deg) scale(1.02);
}

.card-header {
  background: #1d2d50;
  padding: 10px 15px;
  display: flex;
  gap: 8px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.red { background: #ff5f56; }
.yellow { background: #ffbd2e; }
.green { background: #27c93f; }

.card-body {
  padding: 25px;
  color: var(--text-secondary);
  font-family: 'Fira Code', monospace;
  font-size: 0.9rem;
  line-height: 1.6;
}

.keyword { color: #c792ea; }
.class-name { color: #ffcb6b; }
.string { color: #c3e88d; }
.boolean { color: #f78c6c; }
.this { color: #7fdbca; }

/* Buttons */
.buttons {
  display: flex;
  gap: 20px;
  margin-bottom: 40px;
}

.btn {
  padding: 14px 28px;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-mono);
  text-decoration: none;
}

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

.btn.primary:hover {
  background-color: rgba(100, 255, 218, 0.1);
}

.btn.secondary {
  color: var(--white);
  border: 1px solid transparent; /* Para mantener alineación */
}

.btn.secondary:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}

/* Social Hero */
.social-hero {
  display: flex;
  gap: 20px;
}

.social-hero a {
  color: var(--text-secondary);
  font-size: 1.5rem;
}

.social-hero a:hover {
  color: var(--accent);
  transform: translateY(-3px);
}

/* About Grid */
.about-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 50px;
  align-items: center;
}

.about-text p {
  margin-bottom: 20px;
  font-size: 1.1rem;
}

.stats {
  display: flex;
  gap: 40px;
  margin-top: 30px;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--font-mono);
}

.stat-label {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.about-cards {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.info-card {
  background: var(--bg-light);
  padding: 20px;
  border-radius: 8px;
  border-left: 4px solid var(--accent);
  transition: var(--transition);
}

.info-card:hover {
  transform: translateX(5px);
  background: var(--bg-card);
}

.info-card i {
  color: var(--accent);
  font-size: 1.5rem;
  margin-bottom: 10px;
}

.info-card h4 {
  color: var(--white);
  margin-bottom: 5px;
}

/* Skills */
.skills-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

.skill-category {
  background: var(--bg-light);
  padding: 30px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.skill-category:hover {
  transform: translateY(-5px);
}

.skill-category h4 {
  color: var(--accent);
  font-family: var(--font-mono);
  margin-bottom: 20px;
  font-size: 1.2rem;
  position: relative;
  display: inline-block;
}

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.skill-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.skill-item i {
  color: var(--accent);
}

/* Projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 25px;
}

.project-card {
  background: var(--bg-light);
  border-radius: 8px;
  padding: 2rem 1.75rem;
  transition: var(--transition);
  cursor: default;
  box-shadow: 0 10px 30px -15px rgba(2,12,27,0.7);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-7px);
}

.card-content header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.folder-icon {
  color: var(--accent);
  font-size: 40px;
}

.project-links a {
  color: var(--text-primary);
  font-size: 20px;
  margin-left: 10px;
}

.project-links a:hover {
  color: var(--accent);
}

.project-card h4 {
  color: var(--white);
  font-size: 1.4rem;
  margin-bottom: 10px;
  font-family: var(--font-mono);
}

.project-card p {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 20px;
  flex-grow: 1; /* Para empujar el footer hacia abajo */
}

.project-card footer {
  margin-top: auto;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Contact */
.contact-container {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.contact-text {
  font-size: 1.2rem;
  margin-bottom: 40px;
  color: var(--text-secondary);
}

.big-btn {
  padding: 1.25rem 1.75rem;
  font-size: 1.1rem;
}

.footer-socials {
  margin-top: 50px;
  display: flex;
  justify-content: center;
  gap: 30px;
}

.footer-icon {
  font-size: 1.5rem;
  color: var(--text-secondary);
}

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

/* Footer */
footer {
  text-align: center;
  padding: 25px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

footer .highlight {
  color: var(--accent);
}

/* PDF Template Hidden */
#cv-hidden {
  position: fixed;
  left: -9999px;
  top: 0;
}

.cv-page {
  width: 8.5in;
  height: 11in;
  background: white;
  color: #333;
  display: flex;
  font-family: 'Arial', sans-serif;
  overflow: hidden;
}

.cv-sidebar {
  width: 30%;
  background: #2c3e50;
  color: white;
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.cv-profile-pic {
  width: 100px;
  height: 100px;
  background: #ecf0f1;
  color: #2c3e50;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: bold;
  margin: 0 auto;
}

.cv-sidebar-title {
  font-size: 1.1rem;
  border-bottom: 2px solid #ecf0f1;
  padding-bottom: 5px;
  margin-bottom: 10px;
  color: #ecf0f1;
}

.cv-text-light {
  font-size: 0.85rem;
  color: #bdc3c7;
  line-height: 1.4;
}

.cv-main {
  width: 70%;
  padding: 40px;
}

.cv-header {
  margin-bottom: 40px;
  border-bottom: 3px solid #3498db;
  padding-bottom: 20px;
}

.cv-name {
  font-size: 2.5rem;
  color: #2c3e50;
  line-height: 1;
  margin-bottom: 10px;
}

.cv-role {
  font-size: 1.2rem;
  color: #3498db;
  font-weight: 400;
}

.cv-main-title {
  font-size: 1.2rem;
  color: #2c3e50;
  border-bottom: 1px solid #ccc;
  padding-bottom: 5px;
  margin-bottom: 15px;
  text-transform: uppercase;
}

.cv-item {
  margin-bottom: 15px;
  font-size: 0.95rem;
}

.cv-skills-list span {
  display: inline-block;
  background: #ecf0f1;
  padding: 4px 8px;
  border-radius: 4px;
  margin: 2px;
  font-size: 0.85rem;
  color: #2c3e50;
}

/* Responsive */
@media (max-width: 768px) {
  .navbar {
    padding: 0 25px;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 70%;
    background: #112240;
    flex-direction: column;
    justify-content: center;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    box-shadow: -10px 0px 30px -15px rgba(2,12,27,0.7);
  }

  .nav-links.active {
    transform: translateX(0);
  }
  
  .nav-toggle {
    display: block;
    z-index: 1001;
  }

  .hero {
    flex-direction: column-reverse;
    justify-content: center;
    text-align: center;
    padding-top: 100px;
  }

  .hero h1 { font-size: 3rem; }
  .hero h2 { font-size: 2rem; }

  .hero-visual {
    margin-bottom: 50px;
    width: 100%;
  }

  .buttons {
    justify-content: center;
  }

  .social-hero {
    justify-content: center;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .container {
    padding: 0 25px;
  }
}
