/*===== GOOGLE FONTS =====*/
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap');

/*===== VARIABLES CSS =====*/
:root {
  --header-height: 3rem;
  
  /*========== Colors ==========*/
  --first-color: #3B7DD8; /* Professional Blue Accent for Fill/Text - Light Mode */
  --title-color: #0B0A0A;
  --text-color: #403A3A;
  --text-color-light: #707070;
  --container-color: #FAFAFA;
  --container-color-alt: #F0EFEF;
  --body-color: #FCFCFC;

  /*========== Font and typography ==========*/
  --body-font: 'Poppins', sans-serif;
  --h1-font-size: 1.5rem;
  --h2-font-size: 1.25rem;
  --h3-font-size: 1rem;
  --normal-font-size: .938rem;
  --small-font-size: .875rem;
  --smaller-font-size: .813rem;

  /*========== Font weight ==========*/
  --font-medium: 500;
  --font-semi-bold: 600;

  /*========== Margenes ==========*/
  --mb-1: .5rem;
  --mb-2: 1rem;
  --mb-3: 1.5rem;

  /*========== z index ==========*/
  --z-tooltip: 10;
  --z-fixed: 100;
}

/*========== BASE ==========*/
*,::before,::after{
  box-sizing: border-box;
}

html{
  scroll-behavior: smooth;
}

/*========== Variables Dark theme ==========*/
body.dark-theme{
  --title-color: #F2F2F2;
  --text-color: #BFBFBF;
  --container-color: #212121;
  --container-color-alt: #181616;
  --body-color: #2B2B2B;
  --first-color: #5D9CEC; /* Lighter blue for dark mode visibility */
}

/*========== Button Dark/Light ==========*/
.change-theme{
  position: absolute;
  right: 0;
  top: 2.2rem;
  display: flex;
  color: var(--text-color);
  font-size: 1.2rem;
  cursor: pointer;
}

.change-theme:hover{
  color: var(--title-color);
}

/*========== Font size variables to scale cv ==========*/
body.scale-cv{
  --h1-font-size: .938rem;
  --h2-font-size: .938rem;
  --h3-font-size: .875rem;
  --normal-font-size: .813rem;
  --small-font-size: .75rem;
  --smaller-font-size: .688rem;
}

/*========== Generate PDF button ==========*/
.generate-pdf{
  display: none;
  position: absolute;
  top: 2.2rem;
  left: 0;
  font-size: 1.2rem;
  color: var(--text-color);
  cursor: pointer;
}

.generate-pdf:hover{
  color: var(--title-color);
}

/*========== GLOBAL CSS ==========*/
body{
  margin: 0 0 var(--header-height) 0;
  padding: 0;
  font-family: var(--body-font);
  font-size: var(--normal-font-size);
  background-color: var(--body-color);
  color: var(--text-color);
}

h1,h2,h3,ul,p{
  margin: 0;
}

h1,h2,h3{
  color: var(--title-color);
  font-weight: var(--font-medium);
}

ul{
  padding: 0;
  list-style: none;
}

a{
  text-decoration: none;
}

img{
  max-width: 100%;
  height: auto;
}

/*========== CLASS CSS ==========*/
.section{
  padding: 1.5rem 0;
}

.section-title{
  font-size: var(--h2-font-size);
  color: var(--title-color);
  font-weight: var(--font-semi-bold);
  text-transform: uppercase;
  letter-spacing: .35rem;
  text-align: center;
  margin-bottom: var(--mb-3);
}

/*========== LAYOUT ==========*/
.bd-container{
  max-width: 968px;
  width: calc(100% - 3rem);
  margin-left: var(--mb-3);
  margin-right: var(--mb-3);
}

.bd-grid{
  display: grid;
  gap: 1.5rem;
}

.l-header{
  width: 100%;
  position: fixed;
  bottom: 0;
  left: 0;
  z-index: var(--z-fixed);
  background-color: var(--body-color);
  box-shadow: 0 -1px 4px rgba(0,0,0,.1);
  transition: .3s;
}

/*========== NAV ==========*/
.nav{
  height: var(--header-height);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

@media screen and (max-width: 968px){
  .nav__menu{
    position: fixed;
    bottom: -100%;
    left: 0;
    width: 100%;
    padding: 2rem 1.5rem;
    background-color: var(--body-color);
    box-shadow: 0 1px 4px rgba(0,0,0,.1);
    border-radius: 1rem 1rem 0 0;
    z-index: var(--z-fixed);
    transition: .3s;
  }
}

.nav__logo,
.nav__toggle{
  color: var(--title-color);
  font-weight: var(--font-medium);
}

.nav__toggle{
  font-size: 1.2rem;
  cursor: pointer;
}

.nav__item{
  text-align: center;
}

.nav__list{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.nav__link{
  display: flex;
  flex-direction: column;
  font-size: var(--smaller-font-size);
  color: var(--text-color-light);
  font-weight: var(--font-medium);
}

.nav__link:hover{
  color: var(--title-color);
}

.nav__icon{
  font-size: 1.2rem;
  margin-bottom: var(--mb-1);
}

/* Show menu */
.show-menu{
  bottom: var(--header-height);
}

/* Active menu link */
.active-link{
  color: var(--title-color);
}

/*========== HOME ==========*/
.home{
  position: relative;
}

.home__container{
  gap: 3rem;
}

.home__data{
  gap: .5rem;
  text-align: center;
}

.home__img{
  width: 120px;
  height: 120px;
  border-radius: 50%;
  justify-self: center;
  margin-bottom: var(--mb-1);
}

.home__title{
  font-size: var(--h1-font-size);
}

.home__profession{
  font-size: var(--normal-font-size);
  margin-bottom: var(--mb-1);
}

.home__address{
  gap: 1rem;
}

.home__information{
  display: flex;
  align-items: center;
  font-size: var(--small-font-size);
}

.home__icon{
  font-size: 1.2rem;
  margin-right: .25rem;
}

.home__button-movil{
  display: inline-block;
  border: 2px solid var(--text-color);
  color: var(--title-color);
  padding: 1rem 2rem;
  border-radius: .25rem;
  transition: .3s;
  font-weight: var(--font-medium);
  margin-top: var(--mb-3);
}

.home__button-movil:hover{
  background-color: var(--text-color);
  color: var(--container-color);
}

/*========== SOCIAL ==========*/
.social__container{
  grid-template-columns: max-content;
  gap: 1rem;
}

.social__link{
  display: inline-flex;
  align-items: center;
  font-size: var(--small-font-size);
  color: var(--text-color);
}

.social__link:hover{
  color: var(--title-color);
}

.social__icon{
  font-size: 1.2rem;
  margin-right: .25rem;
}

/*========== PROFILE ==========*/
.profile__description{
  text-align: center;
}

/*========== EDUCATION AND EXPERIENCE ==========*/
.education__content,
.experience__content{
  display: flex;
}

.education__time,
.experience__time{
  padding-right: 1rem;
}

.education__rounder,
.experience__rounder{
  position: relative;
  display: block;
  width: 16px;
  height: 16px;
  background-color: var(--text-color-light);
  border-radius: 50%;
  margin-top: .25rem;
}

.education__line,
.experience__line{
  display: block;
  width: 2px;
  height: 110%;
  background-color: var(--text-color-light);
  transform: translate(7px, 0);
}

.education__data,
.experience__data{
  gap: .5rem;
}

.education__title,
.experience__title{
  font-size: var(--h3-font-size);
}

.education__studies,
.experience__company{
  font-size: var(--small-font-size);
  color: var(--title-color);
}

.education__year{
  font-size: var(--smaller-font-size);
}

/*========== SKILLS AND LANGUAGES ==========*/
.skills__content,
.languages__content{
  grid-template-columns: repeat(2, 1fr);
}

.languages__content{
  gap: 0;
}

.skills__name,
.languages__name{
  display: flex;
  align-items: center;
  margin-bottom: var(--mb-3);
}

.skills__circle,
.languages__circle{
  display: inline-block;
  width: 5px;
  height: 5px;
  background-color: var(--text-color);
  border-radius: 50%;
  margin-right: .75rem;
}

/*========== CERTIFICATES ==========*/
.certificate__title{
  font-size: var(--h3-font-size);
  margin-bottom: var(--mb-1);
}

/*========== REFERENCES ==========*/
.references__content{
  gap: .25rem;
}

.references__subtitle{
  color: var(--text-color-light);
}

.references__subtitle,
.references__contact{
  font-size: var(--smaller-font-size);
}

.references__title{
  font-size: var(--h3-font-size);
}

/*========== INTERESTS ==========*/
.interests__container{
  grid-template-columns: repeat(3, 1fr);
  margin-top: var(--mb-2);
}

.interests__content{
  display: flex;
  flex-direction: column;
  align-items: center;
}

.interests__icon{
  font-size: 1.5rem;
  color: var(--text-color-light);
  margin-bottom: .25rem;
}

/* Scroll top */
.scrolltop{
  position: fixed;
  right: 1rem;
  bottom: -20%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: .3rem;
  background-color: var(--container-color-alt);
  border-radius: .4rem;
  z-index: var(--z-tooltip);
  transition: .4s;
  visibility: hidden;
}

.scrolltop__icon{
  font-size: 1.2rem;
  color: var(--text-color);
}

.show-scroll{
  visibility: visible;
  bottom: 5rem;
}

/*========== MEDIA QUERIES ==========*/
/* For small devices, menu two columns */
@media screen and (max-width: 320px){
  .nav__list{
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem .5rem;
  }
}

/* Classes modified for large screen size */
@media screen and (min-width: 968px){
  body{
    margin: 3rem 0;
  }

  .bd-container{
    margin-left: auto;
    margin-right: auto;
  }

  .l-header,
  .scrolltop{
    display: none;
  }

  .resume{
    display: grid;
    grid-template-columns: .5fr 1fr;
    background-color: var(--container-color);
    box-shadow: 0 0 8px rgba(13,12,12,.15);
  }

  .resume__left{
    background-color: var(--container-color-alt);
  }

  .resume__left,
  .resume__right{
    padding: 0 1.5rem;
  }

  .generate-pdf{
    display: inline-block;
  }

  .section-title,
  .profile__description{
    text-align: initial;
  }

  .home__container{
    gap: 1.5rem;
  }

  .home__button-movil{
    display: none;
  }

  .references__container{
    grid-template-columns: repeat(2, 1fr);
  }

  .languages__content{
    grid-template-columns: repeat(3, max-content);
    column-gap: 3.5rem;
  }

  .interests__container{
    grid-template-columns: repeat(4, max-content);
    column-gap: 3.5rem;
  }
}
.certificate__item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.certificate__item img {
  flex-shrink: 0;
}

.certificate__content {
  flex: 1;
}
.certificate__button {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.5rem 1.25rem;
  background-color: #004aad; /* Darker blue */
  color: white;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.25rem;
  text-decoration: none;
  transition: background-color 0.3s ease;
}

.certificate__button:hover {
  background-color: #003a8c; /* Slightly darker on hover */
}

/* Two-column grid layout for the skill bar section */
.skills__container {
    /* Ensures the inner content flows down the column correctly */
    display: grid;
    grid-template-columns: 1fr; /* Default to single column for mobile */
    gap: 1.5rem;
}

/* Define the two-column grid for large screens */
@media screen and (min-width: 968px){
    .skills__container {
        grid-template-columns: repeat(2, 1fr); /* Two equal columns on desktop */
        gap: 1.5rem 3rem; /* Vertical and horizontal spacing */
    }
}

/* Individual skill item spacing and structure */
.skill {
    /* Increased margin for better separation between skill items */
    margin-bottom: 2rem; 
    /* The main skill container doesn't need to be relative anymore */
    /* as we will position the elements using flex/grid. */
}

/* Individual skill name styling and new layout container */
.skill span:first-child { 
    font-weight: var(--font-semi-bold);
    font-size: var(--normal-font-size);
    /* Change to inline-flex to align with the percentage label */
    display: inline-flex; 
    /* Set the parent container to justify content */
    width: 100%;
    justify-content: space-between; 
    align-items: center; /* Vertically center the text */
    
    /* Reduced bottom margin as the bar is immediately below this line */
    margin-bottom: 0.5rem; 
    color: var(--title-color);
}

/* Bar Structure (The 'Empty' Bar) */
.bar {
    background-color: #EBECEF; /* Professional light gray background */
    height: 10px; 
    border-radius: 5px; 
    overflow: hidden; 
    position: relative;
}
body.dark-theme .bar {
    background-color: #404040; /* Darker background in dark mode */
}

/* Progress Bar Fill (The Skill Level) */
.fill {
    height: 100%;
    background-color: var(--first-color); /* Uses the accent color */
    border-radius: 5px;
    transition: width 1s ease-in-out; /* Smooth animation on load */
    position: relative;
}

/* Percentage Label (Now integrated into the skill name line) */
.percent {
    /* Remove absolute positioning now that it's inline */
    position: static; 
    right: unset; 
    top: unset; 
    
    font-size: var(--small-font-size);
    font-weight: var(--font-semi-bold);
    color: var(--first-color); /* Matches the fill color for cohesion */
    z-index: 10;
    
    /* Ensure no unwanted left padding/margin */
    margin-left: auto;
}

/* Clean up old/conflicting styles */
.skills__name,
.skills__circle {
    display: none; /* Hide the old bullet point/circle list elements */
}

/* --- TECHNICAL SKILLS (REPLACING OLD BARS) --- */
.skills__container {
    display: grid;
    grid-template-columns: 1fr; /* Mobile default */
    gap: 1.5rem;
}

@media screen and (min-width: 968px) {
    .skills__container {
        grid-template-columns: 1fr; /* Kept as single column within the right sidebar */
    }
}

.skills__list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* Individual Skill Card */
.skill__data {
    background-color: var(--container-color-alt);
    border: 1px solid rgba(0,0,0,0.05);
    border-left: 4px solid var(--first-color); /* Professional accent bar */
    padding: 0.6rem 0.8rem;
    border-radius: 0.25rem;
    display: flex;
    flex-direction: column;
    min-width: 130px;
    flex-grow: 1;
    transition: 0.3s;
}

.skill__name {
    font-size: var(--small-font-size);
    font-weight: var(--font-semi-bold);
    color: var(--title-color);
}

.skill__level {
    font-size: var(--smaller-font-size);
    color: var(--first-color);
    font-style: italic;
    font-weight: var(--font-medium);
}

/* --- CERTIFICATES --- */
.certificate__item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.certificate__title {
    font-size: var(--h3-font-size);
    font-weight: var(--font-semi-bold);
    margin-bottom: 0.25rem;
}

.certificate__description {
    font-size: var(--smaller-font-size);
    margin-bottom: 0.5rem;
}

.certificate__button {
    display: inline-block;
    padding: 0.4rem 1rem;
    background-color: var(--first-color);
    color: #FFF;
    font-size: var(--smaller-font-size);
    border-radius: 0.25rem;
    transition: 0.3s;
}

.scale-cv .certificate__button {
    display: none; /* Hide buttons on PDF to save professional space */
}

/* --- CLEAN UP OLD STYLES --- */
/* Hide old bar and circle elements that were in the previous version */
.bar, .fill, .percent, .skills__circle {
    display: none !important;
}

/* --- MOBILE RESPONSIVENESS --- */
@media screen and (max-width: 768px) {
    .skill__data {
        width: 100%; /* Stacks skills on small phones */
    }
}


/*========== Classes modified for A4 Page Filling & Continuous Backgrounds ==========*/
.scale-cv .change-theme,
.scale-cv .generate-pdf {
    display: none;
}

.scale-cv .bd-container {
    max-width: 595px; /* A4 width at 72 DPI */
}

/* FORCE FULL HEIGHT & CONTINUOUS SIDEBAR */
.scale-cv .resume {
    display: grid;
    grid-template-columns: .5fr 1fr;
    min-height: 297mm; /* Exact A4 height */
    background-color: var(--body-color);
    align-items: stretch; /* Forces left and right columns to equal height */
}

.scale-cv .resume__left {
    background-color: var(--container-color-alt); /* Continuous gray background */
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
}

.scale-cv .resume__right {
    padding: 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* SPREADS SECTIONS to fill the A4 page height */
    background-color: var(--body-color);
}

/* RELAXED PADDING (Prevents content from bunching at the top) */
.scale-cv .section {
    padding: 1rem 0; 
}

.scale-cv .section-title {
    margin-bottom: 0.75rem;
}

/* HOME & IMAGES */
.scale-cv .home__img {
    width: 90px;
    height: 90px;
}

.scale-cv .home__container {
    gap: 1.25rem;
}

/* NEW SKILL TAGS SCALING */
.scale-cv .skills__list {
    gap: 0.6rem;
}

.scale-cv .skill__data {
    padding: 0.5rem 0.6rem;
    min-width: 110px;
    border-left: 3px solid var(--first-color);
}

.scale-cv .skill__name {
    font-size: var(--small-font-size);
}

.scale-cv .skill__level {
    font-size: 0.7rem;
}

/* EDUCATION & EXPERIENCE SCALING */
.scale-cv .education__container,
.scale-cv .experience__container,
.scale-cv .certificate__container {
    gap: 0.75rem;
}

.scale-cv .education__rounder,
.scale-cv .experience__rounder {
    width: 12px;
    height: 12px;
}

.scale-cv .education__line,
.scale-cv .experience__line {
    width: 1.5px;
    transform: translate(5px, 0);
}