* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Fira Code", "Courier New", monospace;
}

body {
  background: #1e1e1e;
  color: #d4d4d4;
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
}

body.light-mode {
  background: #f5f5f5;
  color: #333;
}

header {
  background: #252526;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid #3c3c3c;
}

body.light-mode header {
  background: #007acc;
  border-bottom: 1px solid #005f99;
}

nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

nav h1 {
  font-size: 1.5rem;
  color: #569cd6;
}

body.light-mode nav h1 {
  color: #fff;
}

.nav-menu {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

.nav-menu li a {
  color: #d4d4d4;
  text-decoration: none;
  font-size: 1rem;
  transition: color 0.3s;
}

body.light-mode .nav-menu li a {
  color: #fff;
}

.nav-menu li a:hover {
  color: #4ec9b0;
}

.menu-toggle {
  display: none;
  font-size: 1.8rem;
  background: none;
  border: none;
  color: #d4d4d4;
  cursor: pointer;
  transition: transform 0.3s;
}

body.light-mode .menu-toggle {
  color: #fff;
}

.menu-toggle.active .fa-bars {
  display: none;
}

.menu-toggle.active .fa-times {
  display: inline;
}

.fa-times {
  display: none;
}

.toggle-mode {
  background: none;
  border: none;
  color: #d4d4d4;
  font-size: 1.2rem;
  cursor: pointer;
}

body.light-mode .toggle-mode {
  color: #fff;
}

section {
  padding: 4rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

#inicio {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

#inicio h2 {
  font-size: 2.5rem;
  color: #4ec9b0;
  margin-bottom: 1rem;
  animation: type 2s steps(30, end);
}

body.light-mode #inicio h2 {
  color: #007acc;
}

#inicio p {
  font-size: 1.1rem;
  color: #9cdcfe;
  max-width: 600px;
  margin-bottom: 2rem;
}

body.light-mode #inicio p {
  color: #333;
}

.btn {
  background: #007acc;
  color: #fff;
  padding: 0.8rem 2rem;
  text-decoration: none;
  border-radius: 5px;
  font-size: 1rem;
  transition: background 0.3s;
}

.btn:hover {
  background: #4ec9b0;
}

.section-title {
  font-size: 2rem;
  color: #569cd6;
  text-align: center;
  margin-bottom: 2rem;
}

body.light-mode .section-title {
  color: #007acc;
}

/* Estilo para la sección Sobre Mí */
#sobre-mi {
  background: #2d2d2d;
  border-radius: 10px;
  padding: 2rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

body.light-mode #sobre-mi {
  background: #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

#sobre-mi .code-block {
  max-width: 700px;
  margin: 0 auto;
  font-size: 1rem;
  line-height: 1.8;
  color: #d4d4d4;
  white-space: pre;
}

body.light-mode #sobre-mi .code-block {
  color: #333;
}

#sobre-mi .code-block .keyword {
  color: #569cd6;
}

#sobre-mi .code-block .string {
  color: #ce9178;
}

#sobre-mi .code-block .comment {
  color: #6a9955;
}

#sobre-mi .code-block .function {
  color: #dcdcaa;
}

body.light-mode #sobre-mi .code-block .keyword {
  color: #007acc;
}

body.light-mode #sobre-mi .code-block .string {
  color: #a31515;
}

body.light-mode #sobre-mi .code-block .comment {
  color: #008000;
}

body.light-mode #sobre-mi .code-block .function {
  color: #795e26;
}

/* Estilo para la sección de Proyectos */
#proyectos {
  background: #2d2d2d;
  border-radius: 10px;
  padding: 3rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

body.light-mode #proyectos {
  background: #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.proyectos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.proyecto {
  position: relative;
  background: #252526;
  border: 1px solid #3c3c3c;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
  opacity: 0;
  transform: translateY(30px);
}

.proyecto.show {
  opacity: 1;
  transform: translateY(0);
}

body.light-mode .proyecto {
  background: #fff;
  border: 1px solid #ccc;
}

.proyecto img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease-in;
}

.proyecto img.loaded {
  opacity: 1;
}

.proyecto img[src=""] {
  display: none;
}

.proyecto .no-image {
  width: 100%;
  height: 150px;
  background: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #d4d4d4;
  font-size: 0.9rem;
}

body.light-mode .proyecto .no-image {
  background: #ddd;
  color: #333;
}

.proyecto-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s;
  padding: 1rem;
  text-align: center;
}

.proyecto:hover .proyecto-overlay {
  opacity: 1;
}

.proyecto-overlay h3 {
  font-size: 1.2rem;
  color: #4ec9b0;
  margin-bottom: 0.5rem;
}

body.light-mode .proyecto-overlay h3 {
  color: #007acc;
}

.proyecto-overlay p {
  font-size: 0.8rem;
  color: #d4d4d4;
}

body.light-mode .proyecto-overlay p {
  color: #333;
}

.proyecto-overlay a {
  margin-top: 0.8rem;
  background: #007acc;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  text-decoration: none;
  font-size: 0.8rem;
}

.proyecto-overlay a:hover {
  background: #4ec9b0;
}

.proyecto:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

body.light-mode .proyecto:hover {
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.habilidades-categoria {
  margin-bottom: 2rem;
}

.habilidades-categoria h3 {
  font-size: 1.5rem;
  color: #4ec9b0;
  margin-bottom: 1rem;
  text-align: center;
}

body.light-mode .habilidades-categoria h3 {
  color: #007acc;
}

.habilidades-lista {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.habilidad {
  padding: 0.5rem 1rem;
  border-radius: 5px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: transform 0.3s;
}

.habilidad:hover {
  transform: scale(1.05);
}

.habilidad i {
  font-size: 1.2rem;
}

/* Colores específicos para cada tecnología */
.habilidad.html5 {
  background: #e34f26;
  color: #fff;
}

.habilidad.css3 {
  background: #264de4;
  color: #fff;
}

.habilidad.javascript {
  background: #f7df1e;
  color: #333;
}

.habilidad.responsive {
  background: #2ecc71;
  color: #fff;
}

.habilidad.php {
  background: #777BB3;
  color: #fff;
}

.habilidad.python {
  background: #4b8bbe;
  color: #fff;
}

.habilidad.sql {
  background: #336791;
  color: #fff;
}

.habilidad.mongodb {
  background: #47a248;
  color: #fff;
}

.habilidad.git {
  background: #f05033;
  color: #fff;
}


footer {
  background: #252526;
  color: #d4d4d4;
  text-align: center;
  padding: 1rem 0;
  margin-top: 2rem;
}

body.light-mode footer {
  background: #007acc;
  color: #fff;
}

@keyframes type {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes loading {
  0% {
    content: ".";
  }
  33% {
    content: "..";
  }
  66% {
    content: "...";
  }
}

@media (max-width: 768px) {
  #inicio h2 {
    font-size: 1.8rem;
  }

  nav h1 {
    font-size: 1.2rem;
  }

  .menu-toggle {
    display: block;
    z-index: 1001;
  }

  .nav-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    height: 100%;
    background: rgba(37, 37, 38, 0.95);
    backdrop-filter: blur(5px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    border-right: 1px solid #3c3c3c;
    border-radius: 0 10px 10px 0;
  }

  body.light-mode .nav-menu {
    background: rgba(0, 122, 204, 0.95);
    border-right: 1px solid #005f99;
  }

  .nav-menu.active {
    display: flex;
    transform: translateX(0);
  }

  .nav-menu li {
    margin: 1rem 0;
  }

  .nav-menu li a {
    font-size: 1.2rem;
  }

  #sobre-mi,
  #proyectos,
  #contacto {
    padding: 1.5rem;
  }

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

  .proyecto img {
    height: 120px;
  }

  .proyecto .no-image {
    height: 120px;
  }

  .proyecto-overlay h3 {
    font-size: 1rem;
  }

  .proyecto-overlay p {
    font-size: 0.7rem;
  }

  .proyecto-overlay a {
    font-size: 0.7rem;
  }

  #sobre-mi .code-block {
    font-size: 0.9rem;
  }

  .habilidades-categoria {
    margin-bottom: 1.5rem;
  }
}

@media (min-width: 769px) {
  #habilidades {
    display: flex;
    flex-direction: column;
    gap: 2rem;
  }

  .habilidades-categoria {
    width: 100%;
  }
}
