:root {
  --primary: #ffffff;
  --secondary: #f5f5f5;
  --accent: #333333;
  --text: #222222;
  --text-secondary: #555555;
  --highlight: #0077cc;
  --btn-bg: #0077cc;
  --btn-text: #ffffff;
  --shadow: rgba(0, 0, 0, 0.1);
}

body.dark-mode {
  --primary: #121212;
  --secondary: #1e1e1e;
  --accent: #ffffff;
  --text: #e0e0e0;
  --text-secondary: #bbbbbb;
  --highlight: #00aaff;
  --btn-bg: #00aaff;
  --btn-text: #ffffff;
  --shadow: rgba(255, 255, 255, 0.05);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Montserrat', sans-serif;
  background-color: var(--primary);
  color: var(--text);
  line-height: 1.7;
  font-size: 1.1rem;
  overflow-x: hidden;
  transition: background-color 0.3s, color 0.3s;
}

/* ===== NAVBAR ===== */
nav {
  position: fixed;
  width: 100%;
  top: 0;
  background-color: var(--secondary);
  padding: 1rem 2rem;
  z-index: 1000;
  transition: box-shadow 0.3s;
}

nav ul {
  display: flex;
  justify-content: center;
  list-style: none;
  flex-wrap: wrap;
}

nav ul li {
  margin: 0 1rem;
}

nav ul li a {
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  transition: color 0.3s;
}

nav ul li a:hover {
  color: var(--highlight);
}

/* ===== SECTIONS ===== */
.section {
  padding: 100px 20px 80px;
  max-width: 1100px;
  margin: auto;
}

.section-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  text-align: center;
  color: var(--accent);
}

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

/* ===== HOME SECTION ===== */
#home {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  text-align: center;
  gap: 2rem;
}

.home-content h1 {
  font-size: 2.5rem;
}

.home-content h2 {
  font-size: 1.4rem;
  margin: 1rem 0;
  color: var(--text-secondary);
}

.home-img img {
  border-radius: 12px;
  box-shadow: 0 4px 20px var(--shadow);
}

/* ===== BUTTONS ===== */
.btn,
.btn-small {
  background-color: var(--btn-bg);
  color: var(--btn-text);
  padding: 0.7rem 1.4rem;
  border: none;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  display: inline-block;
  margin-top: 1rem;
  transition: background-color 0.3s;
}

.btn:hover,
.btn-small:hover {
  background-color: darken(var(--btn-bg), 10%);
}

/* ===== ABOUT SECTION ===== */
.about-content {
  max-width: 800px;
  margin: auto;
  text-align: center;
}

/* ===== SKILLS SECTION ===== */
.skills-container {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
  margin-top: 2rem;
}

.skills-column {
  flex: 1;
  min-width: 250px;
}

.skills-column h3 {
  margin-bottom: 1rem;
  font-size: 1.5rem;
  color: var(--highlight);
}

.skills-column ul {
  list-style: none;
  padding-left: 0;
}

.skills-column li {
  margin-bottom: 0.7rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ===== PROJECTS SECTION ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.project-card {
  background-color: var(--secondary);
  padding: 1rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px var(--shadow);
  text-align: left; /* Mejor alineación del texto */
  transition: transform 0.3s;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 500px;
  margin: auto;
}

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

.project-card img {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.project-card h3 {
  font-size: 1.2rem;
  margin: 0.25rem 0;
}

.project-card p {
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--text-color);
}

.project-links {
  margin-top: 0.5rem;
}

/* ===== CERTIFICATION ===== */
.certification-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2rem;
  background-color: var(--secondary);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px var(--shadow);
}

.certification-info h3 {
  margin-bottom: 0.5rem;
}

/* ===== CONTACT SECTION ===== */
.contact-content {
  text-align: center;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
  align-items: center;
}

.contact-links a {
  width: fit-content;
}

/* ===== FOOTER ===== */
footer {
  text-align: center;
  padding: 2rem;
  background-color: var(--secondary);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ===== THEME TOGGLE BUTTON ===== */
#theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background-color: var(--secondary);
  border: none;
  padding: 0.8rem;
  border-radius: 50%;
  cursor: pointer;
  z-index: 1100;
  box-shadow: 0 2px 8px var(--shadow);
  transition: background 0.3s;
}

#theme-toggle i {
  font-size: 1.2rem;
  color: var(--accent);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (min-width: 768px) {
  #home {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .home-img {
    flex: 1;
    padding-left: 3rem;
    display: flex;
    justify-content: flex-end;
  }

  .home-content {
    flex: 2;
    padding-right: 3rem;
    max-width: 100%;
  }

  .home-img {
    flex: 1;
  }

  .certification-card {
    flex-wrap: nowrap;
  }

  .contact-links {
    flex-direction: row;
  }
}