.project-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--modal-background);
  backdrop-filter: blur(2px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 2rem;
}

.project-modal-content {
  background: var(--glass-background);
  backdrop-filter: blur(2px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  width: 90%;
  max-width: 800px;
  padding: 1.5rem;
  position: relative;
}

.project-modal-header {
  margin-bottom: 2rem;
}

.project-modal-header h2 {
  font-size: 2rem;
  color: var(--text-color);
  margin: 0;
}

.project-modal-body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

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

.project-modal-image {
  width: 100%;
  height: auto;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 4px 12px var(--shadow-color);
}

.project-modal-info {
  display: flex;
  flex-direction: column;
}

.project-modal-description {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--text-color);
  margin: 0;
}

.project-modal-techs {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

.project-modal-techs h3 {
  font-size: 1.2rem;
  color: var(--text-color);
  margin: 0;
  text-align: center;
}

.tech-tags, .tech-tags-container, .modal .tech-tags, .modal-content .tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1rem;
  justify-content: center;
  margin-top: 1.2rem;
  margin-bottom: 0.7rem;
}

.tech-tag, .modal .tech-tag, .modal-content .tech-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1.5rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.7rem;
  /* El color y fondo se definen por tema más abajo */
}

@media (max-width: 768px) {
  .project-modal-content {
    padding: 1rem;
    width: 95%;
  }

  .project-modal-header h2 {
    font-size: 1.5rem;
  }

  .project-modal-description {
    font-size: 1rem;
  }

  .project-modal-images {
    grid-template-columns: 1fr;
  }
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--modal-background);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 2rem;
}

.modal-content {
  background: var(--card-background);
  backdrop-filter: blur(2px);
  border-radius: 20px;
  padding: 2rem;
  max-width: 1000px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  border: 1px solid var(--card-border);
}

.back-button {
  background: var(--text-color);
  text-align: center;
  width: 12rem;
  height: 3.5rem;
  border-radius: 1rem;
  position: relative;
  color: var(--background-color);
  font-size: 1.25rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  padding-left: 0.5rem;
  cursor: pointer;
  border: none;
  margin-bottom: 2rem;
}

.back-button-icon {
  background: #4ade80;
  border-radius: 0.75rem;
  height: 3rem;
  width: 1/4;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  left: 0.25rem;
  top: 0.25rem;
  z-index: 10;
  transition: width 0.5s ease;
}

.back-button:hover .back-button-icon {
  width: 11.5rem;
}

.modal-header {
  margin-bottom: 2rem;
}

.modal-header h2 {
  font-size: 2rem;
  color: var(--text-color);
  margin: 0;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.modal-images {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  justify-items: center;
}

.modal-images img, .project-modal-image {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 50vh;
  border-radius: 10px;
  object-fit: contain;
  /* Difuminado solo en el lado izquierdo */
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 5%, #000 100%);
  mask-image: linear-gradient(to right, transparent 0%, #000 5%, #000 100%);
}

.modal-info {
  color: var(--text-color);
}

.modal-info p {
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.modal-tech h3 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
  color: var(--text-color);
}

.modal .tech-tags,
.modal-content .tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: center;
}

.tech-tag {
  padding: 0.5rem 1rem;
  background: rgba(0, 113, 227, 0.2);
  border-radius: 20px;
  font-size: 0.9rem;
  color: var(--accent-color);
}

@media (max-width: 768px) {
  .modal-content {
    padding: 1.5rem;
  }

  .modal-header h2 {
    font-size: 1.8rem;
  }

  .modal-info p {
    font-size: 1rem;
  }

  .back-button {
    width: 10rem;
    height: 3rem;
    font-size: 1.1rem;
  }

  .back-button-icon {
    height: 2.5rem;
  }
}

@media (max-width: 480px) {
  .modal-content {
    padding: 1rem;
  }

  .modal-header h2 {
    font-size: 1.5rem;
  }

  .back-button {
    width: 9rem;
    height: 2.8rem;
    font-size: 1rem;
  }

  .back-button-icon {
    height: 2.3rem;
  }
} 

.modal-description {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--text-color);
  margin: 0;
}

.modal-techs {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  margin-top: 1.5rem;
}

.project-modal-techs h3 {
  font-size: 1.2rem;
  color: var(--text-color);
  margin: 0;
  text-align: center;
}

[data-theme="light"] .modal .tech-tag,
[data-theme="light"] .modal-content .tech-tag {
  background: #e3eefd;
  color: #007AFF;
  border: none;
}

[data-theme="light"] .modal-info,
[data-theme="light"] .modal-info p,
[data-theme="light"] .modal-header h2,
[data-theme="light"] .modal-tech h3 {
  color: #fff;
}

[data-theme="light"] .modal-info p,
[data-theme="light"] .modal-description,
[data-theme="light"] .project-modal-description {
  color: #fff !important;
}

[data-theme="light"] .modal-content {
  background: rgba(102, 102, 112, 0.295);
  backdrop-filter: blur(2px);
  color: #fff;
  border: 1.5px solid rgba(125, 123, 146, 0.321);
}

[data-theme="light"] .modal-content .tech-tags,
[data-theme="light"] .modal .tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem 1.5rem;
  justify-content: center;
  gap: 100px; 
  margin-top: 1.5rem;
  margin-bottom: 0.7rem;
}

[data-theme="light"] .modal-content .tech-tag,
[data-theme="light"] .modal .tech-tag {
  margin-bottom: 0.7rem;
  padding-left: 1.2rem;
  padding-right: 1.2rem;
  gap: 10rem;
  
}

.modal-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  background: transparent;
  color: #fff;
  border: none;
  width: 32px;
  height: 32px;
  font-size: 1.5rem;
  font-weight: bold;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  outline: none;
  box-shadow: none;
  transition: none;
}

.modal-close-btn:hover,
.modal-close-btn:focus,
.modal-close-btn:active {
  background: transparent;
  color: #fff;
  outline: none;
  box-shadow: none;
  opacity: 0.7;
}
