/* This file was made by Pol Cañadas Costa */

/* ====== GOOGLE FONTS IMPORT (I checked the link from the CSS slides and it's actually really useful) ====== */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700;800&family=Lato:wght@300;400;700;900&family=Roboto:wght@300;400;500;700&display=swap');

/* ====== GLOBAL RESET ====== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Lato", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: #2c3e50;
  line-height: 1.6;
}

/* ====== HEADER (blue banner) ====== */
.cv-header {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(90deg, #33c3ff 0%, #003399 100%);
  color: white;
  padding: 40px 20px;
  border-bottom: 5px solid #001f4d;
}

.header-left {
  margin-right: 40px;
}

.portrait {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  border: 6px solid #003366;
  object-fit: cover;
}

.header-right {
  text-align: center;
}

.header-right h1 {
  font-family: "Montserrat", sans-serif;
  font-size: 3em;
  font-weight: 800;
  letter-spacing: 4px;
  line-height: 1.1;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.header-right h2 {
  font-family: "Montserrat", sans-serif;
  margin-top: 18px;
  font-size: 1.2em;
  font-weight: 500;
  letter-spacing: 2px;
  color: #e8f4f8;
  text-transform: uppercase;
}

/* ====== MAIN BODY SPLIT ====== */
.cv-body {
  display: flex;
  align-items: flex-start;
  margin-bottom: 20px;
}

.left-side {
  width: 50%;
  background-color: #f5f5f5;
  padding: 20px 20px;
}

.right-side {
  width: 50%;
  background-color: #ffffff;
  padding: 30px 20px;
}

/* Remove bottom margin from last section in each side, so there are no weird problems again */
.left-side section:last-of-type,
.right-side section:last-of-type {
  margin-bottom: 0;
}

/* ====== GLOBAL SECTION STYLES ====== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #e6e6e6;
  border-bottom: 1px solid #ccc;
  padding: 10px 15px;
  text-align: center;
}

.section-header h2 {
  font-family: "Montserrat", sans-serif;
  font-size: 1.15em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #003366;
}

.section-icon {
  width: 25px;
  height: 25px;
  margin-right: 10px;
}

.section-content {
  padding: 15px 20px;
  font-size: 0.98em;
  line-height: 1.7;
  color: #34495e;
  font-family: "Lato", sans-serif;
}

.section-content p {
  margin-bottom: 10px;
  text-rendering: optimizeLegibility;
}

/* ====== ABOUT ME SECTION ====== */
.about-section {
  background-color: #f1f1f1;
  border: 1px solid #ccc;
  border-radius: 5px;
  margin-bottom: 30px;
  box-shadow: 2px 2px 5px rgba(0,0,0,0.1);
}

.about-section p {
  text-align: justify;
  line-height: 1.8;
  font-size: 1em;
  color: #2c3e50;
}

/* ====== CONTACT SECTION ====== */
.contact-section {
  margin-bottom: 30px;
}

.contact-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.contact-text {
  flex: 1;
}

.contact-info p {
  margin-bottom: 10px;
  text-align: left;
  font-size: 0.95em;
  font-weight: 400;
  display: flex;
  align-items: flex-start;
  line-height: 1.6;
}

.contact-info strong {
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
  color: #003366;
  min-width: 120px;
  display: inline-block;
}

.contact-github {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  margin-right: 50px;
}

.contact-github a {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.contact-github a:hover {
  transform: scale(1.1);
  opacity: 0.8;
}

.contact-github img {
  width: 110px;
  height: 110px;
  object-fit: contain;
  filter: grayscale(0%);
  margin-bottom: 8px;
}

.contact-github p {
  font-family: "Montserrat", sans-serif;
  font-size: 0.85em;
  font-weight: 600;
  color: #003366;
  text-align: center;
  margin: 0;
}

.contact-info a {
  color: #003366;
  text-decoration: none;
  font-weight: 600;
}

.contact-info a:hover {
  text-decoration: underline;
  color: #0077b6;
}

/* ====== LANGUAGE SKILLS SECTION ====== */
.language-section {
  margin-bottom: 30px;
}

.languages {
  padding: 15px 20px;
}

.language-item {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  font-size: 0.95em;
  color: #333;
}

.language-item strong {
  width: 120px;
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
  text-align: right;
  margin-right: 10px;
  color: #2c3e50;
}

.stars {
  display: flex;
  gap: 2px;
  justify-content: center;
  margin-right: 10px;
}

.stars img {
  width: 18px;
  height: 18px;
}

.language-item span {
  width: 120px;
  text-align: left;
  font-size: 0.9em;
  color: #5a6c7d;
  font-style: italic;
}

/* ====== TECH ABILITIES SECTION ====== */
.tech-section {
  margin-bottom: 30px;
}

.tech-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px;
  padding: 20px;
}

.tech-group {
  width: 48%;
}

.tech-content dt {
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  font-size: 1.05em;
  color: #003366;
  margin-top: 10px;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tech-content ul {
  list-style-type: disc;
  padding-left: 25px;
  margin-bottom: 10px;
}

.tech-content li {
  font-size: 0.95em;
  color: #34495e;
  line-height: 1.8;
  font-weight: 400;
}

/* ====== EDUCATION SECTION ====== */
.education-section {
  margin-bottom: 40px;
}

.education {
  padding: 20px;
  text-align: center;
}

.edu-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #ddd;
  padding: 15px 0;
}

.edu-item:last-child {
  border-bottom: none;
}

.edu-text {
  width: 75%;
  text-align: left;
}

.edu-text h3 {
  font-family: "Montserrat", sans-serif;
  font-size: 1.15em;
  font-weight: 700;
  color: #003366;
  margin-bottom: 8px;
  letter-spacing: 0.3px;
}

.edu-text p {
  font-family: "Lato", sans-serif;
  font-size: 0.95em;
  color: #34495e;
  line-height: 1.6;
}

.edu-text p strong {
  font-weight: 600;
  color: #2c3e50;
}

.edu-logo img {
  width: 110px;
  height: auto;
  object-fit: contain; 
  border: 1px solid #000000;      
  border-radius: 6px;           
  box-shadow: 0 0 4px rgba(0,0,0,0.08);
  padding: 4px;                 
  background-color: #fff;       
}

/* ====== EXPERIENCE SECTION ====== */
.experience-section {
  margin-bottom: 40px;
  text-align: center;
}

.experience {
  padding: 20px;
}

.exp-item {
  margin-bottom: 35px;
  border-bottom: 1px solid #ddd;
  padding-bottom: 20px;
}

.exp-item:last-child {
  border-bottom: none;
}

.exp-item h3 {
  font-family: "Montserrat", sans-serif;
  font-size: 1.15em;
  font-weight: 700;
  color: #003366;
  margin-bottom: 10px;
  text-align: center;
  letter-spacing: 0.3px;
  line-height: 1.4;
}

.exp-year {
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
  font-size: 1em;
  color: #0077b6;
  margin: 8px 0 15px 0;
  text-align: center;
  width: 100%;
  font-style: italic;
}

.exp-item p {
  font-family: "Lato", sans-serif;
  font-size: 0.96em;
  color: #34495e;
  line-height: 1.7;
  max-width: 90%;
  margin: 0 auto;
  text-align: justify;
}

/* ====== FOOTER BAR ====== */
.cv-footer {
  background: linear-gradient(to right, #0077b6, #00b4d8);
  height: 60px;
  margin-top: 10px;
  border-top: 3px solid #004b8d;
}

/* ====== RESPONSIVE DESIGN ====== */

/* Tablet and smaller laptops (900px and below) */
@media (max-width: 900px) {
  .cv-body {
    flex-direction: column;
  }

  .left-side, 
  .right-side {
    width: 100%;
  }

  .right-side {
    padding-top: 10px;
  }

  /* Adjust tech abilities to single column */
  .tech-group {
    width: 100%;
  }
}

/* Tablets (768px and below) */
@media (max-width: 768px) {
  /* Header adjustments */
  .cv-header {
    flex-direction: column;
    padding: 30px 15px;
  }

  .header-left {
    margin-right: 0;
    margin-bottom: 20px;
  }

  .portrait {
    width: 150px;
    height: 150px;
    border: 4px solid #003366;
  }

  .header-right h1 {
    font-size: 2em;
  }

  .header-right h2 {
    font-size: 1em;
  }

  /* Section content padding */
  .section-content {
    padding: 12px 15px;
  }

  /* Education layout adjustments */
  .edu-item {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 0;
  }

  .edu-text {
    width: 100%;
    margin-bottom: 15px;
  }

  .edu-logo {
    align-self: center;
  }

  .edu-logo img {
    width: 60px;
  }

  /* Language items stack better */
  .language-item strong {
    width: 100px;
  }

  .language-item span {
    width: 100px;
  }
}

/* Mobile devices (480px and below) */
@media (max-width: 480px) {
  /* Header */
  .cv-header {
    padding: 20px 10px;
  }

  .portrait {
    width: 120px;
    height: 120px;
    border: 3px solid #003366;
  }

  .header-right h1 {
    font-size: 1.6em;
    letter-spacing: 1px;
  }

  .header-right h2 {
    font-size: 0.9em;
    margin-top: 10px;
  }

  /* Body padding */
  .left-side,
  .right-side {
    padding: 15px 10px;
  }

  /* Section headers */
  .section-header {
    padding: 8px 10px;
  }

  .section-header h2 {
    font-size: 0.95em;
  }

  .section-icon {
    width: 20px;
    height: 20px;
    margin-right: 8px;
  }

  /* Section content */
  .section-content {
    padding: 10px 12px;
    font-size: 0.9em;
  }

  /* Language skills - stack vertically */
  .language-item {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 15px;
    padding: 10px;
    background-color: #fafafa;
    border-radius: 5px;
  }

  .language-item strong {
    width: 100%;
    text-align: left;
    margin-bottom: 8px;
  }

  .stars {
    margin: 0 0 8px 0;
  }

  .language-item span {
    width: 100%;
    text-align: left;
  }

  /* Tech abilities */
  .tech-content {
    padding: 10px;
    gap: 15px;
  }

  .tech-content dt {
    font-size: 0.95em;
  }

  .tech-content li {
    font-size: 0.85em;
  }

  /* Education */
  .education {
    padding: 15px 10px;
  }

  .edu-text h3 {
    font-size: 1em;
  }

  .edu-text p {
    font-size: 0.85em;
  }

  .edu-logo img {
    width: 50px;
  }

  /* Experience */
  .experience {
    padding: 15px 10px;
  }

  .exp-item {
    margin-bottom: 25px;
    padding-bottom: 15px;
  }

  .exp-item h3 {
    font-size: 1em;
    line-height: 1.4;
  }

  .exp-year {
    font-size: 0.95em;
    margin: 5px 0 10px 0;
  }

  .exp-item p {
    font-size: 0.85em;
    max-width: 100%;
  }

  /* Footer */
  .cv-footer {
    height: 40px;
    margin-top: 5px;
  }

  /* Contact info */
  .contact-info p {
    font-size: 0.9em;
    word-break: break-word;
  }

  .contact-info {
    flex-direction: column;
  }

  .contact-github {
    margin-top: 15px;
  }

  .contact-github img {
    width: 60px;
    height: 60px;
  }
}

/* Very small devices (360px and below) */
@media (max-width: 360px) {
  .header-right h1 {
    font-size: 1.4em;
  }

  .header-right h2 {
    font-size: 0.8em;
  }

  .portrait {
    width: 100px;
    height: 100px;
  }

  .section-header h2 {
    font-size: 0.85em;
  }

  .section-content {
    font-size: 0.85em;
  }
}
