@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&display=swap");

html {
  scroll-behavior: smooth;
}

body {
  background: #121212;
  color: #e0e0e0;
  font-family: "Montserrat", sans-serif;
  margin: 3rem;
  display: flex;
  justify-content: center;
}

.container {
  background: #1f1f1f;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
  width: 100%;
  padding: 2rem 3rem;
}

.tabs {
  display: flex;
  border-bottom: 2px solid #333;
  margin-bottom: 2rem;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.tab-btn {
  background: transparent;
  border: none;
  color: #bbb;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 1.5rem 1.2rem;
  cursor: pointer;
  position: relative;
  transition: color 0.3s ease;
}

.tab-btn:hover {
  color: #ff6f61;
}

.tab-btn.active {
  color: #ff6f61;
}

.tab-btn.active::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 30%;
  width: 40%;
  height: 3px;
  background: #ff6f61;
  border-radius: 2px;
}

.tab-content {
  display: none;
  line-height: 1.6;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.4s ease forwards;
}

h2 {
  margin-top: 0;
  color: #ff6f61;
}

p {
  color: #ccc;
  font-size: 1rem;
}

.social-links {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1rem;
}

.social-links a {
  color: #ff6f61;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  transition: color 0.3s ease;
}

.social-links a:hover {
  color: #ffa085;
}

.projects-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1rem;
}

#modal-projects li {
  list-style: none;
  margin: 10px 0;
}

/* === CERTIFICATIONS === */
#modal-projects li {
  list-style: none;
  margin: 10px 0;
}

.certifications-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1rem;
}

.certification-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.certification-title {
  font-weight: bold;
  margin-bottom: 5px;
  color: #61a8ff; /* distinto al #ff6f61 de projects para diferenciarlos */
}

.certification-image {
  width: 120px;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  margin-top: 5px;
}

/* Card estilo similar a .project */
.certification {
  padding: 1rem;
  border-radius: 8px;
  display: flex;
  gap: 1rem;
  align-items: center;
  box-shadow: 0 4px 10px rgba(97, 168, 255, 0.25);
  transition: background 0.3s ease;
  cursor: pointer;
}

.certification:hover {
  background: #3a3a3a;
}

.certification img {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.certification h3 {
  margin: 0 0 0.4rem 0;
  color: #61a8ff;
  font-size: 1.2rem;
}

.certification p {
  margin: 0;
  color: #ddd;
  font-size: 1rem;
  line-height: 1.3;
}

.project-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.project-title {
  font-weight: bold;
  margin-bottom: 5px;
  color: #ff6f61;
}

.project-image {
  width: 120px;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  margin-top: 5px;
}

.project {
  padding: 1rem;
  border-radius: 8px;
  display: flex;
  gap: 1rem;
  align-items: center;
  box-shadow: 0 4px 10px rgba(255, 111, 97, 0.2);
  transition: background 0.3s ease;
  cursor: pointer;
}

.project:hover {
  background: #3a3a3a;
}

.project img {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.project h3 {
  margin: 0 0 0.4rem 0;
  color: #ff6f61;
  font-size: 1.2rem;
}

.project p {
  margin: 0;
  color: #ddd;
  font-size: 1rem;
  line-height: 1.3;
}

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.skill-item {
  cursor: pointer;
  flex: 0 1 100px; /* ancho flexible, mínimo 0, crecer hasta 100px */
  text-align: center;
  user-select: none;
}

.skill-item img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease;
}

.skill-item img:hover {
  transform: scale(1.1);
}

.skill-name:first-child {
  margin-top: 0.3rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.skill-name {
  margin-top: 0.3rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-overlay.active {
  display: flex;
  animation: fadeInOverlay 0.3s ease forwards;
}

.modal-overlay.closing {
  animation: fadeOutOverlay 0.3s ease forwards;
}

.modal {
  background: #2a2a2a;
  border-radius: 8px;
  max-width: 400px;
  width: 90%;
  padding: 1rem 1.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8);
  color: #e0e0e0;
  animation: zoomSlideIn 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.modal img {
  max-width: 100px;
  height: auto;
  border-radius: 6px;
  display: block;
  margin: 0 auto;
}

.modal img.certifications-image {
  max-width: 100%;
}

.modal.closing {
  animation: zoomSlideOut 0.3s ease forwards;
}

.modal h3 {
  margin-top: 0;
  color: #ff6f61;
}

.modal ul {
  list-style: disc inside;
  margin: 0.5rem 0 1rem 0;
  padding-left: 0;
  color: #ccc;
}

.modal button.close-btn {
  background: #444;
  color: white;
  border: none;
  padding: 0.4rem 0.8rem;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.modal button.close-btn:hover {
  background-color: #ff6f61;
  color: white;
}

.lang-select {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: #222;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  border: 1px solid #444;
  cursor: pointer;
  transition: background 0.3s ease, border 0.3s ease;
}

.lang-select:hover {
  background: #333;
  border-color: #ff6f61;
}

.lang-select select {
  background: transparent;
  color: #e0e0e0;
  border: none;
  font-family: "Montserrat", sans-serif;
  font-size: 1rem;
  outline: none;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  appearance: none;
}

.lang-select select option {
  background: #1f1f1f;
  color: #e0e0e0;
}

.lang-select::after {
  content: "▼";
  font-size: 0.7rem;
  color: #ff6f61;
  margin-left: auto;
  pointer-events: none;
}

.cert-tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.cert-tab-btn {
  padding: 0.5rem 1rem;
  background-color: #222;
  border: none;
  color: #fff;
  cursor: pointer;
  border-radius: 5px;
}

.cert-tab-btn.active {
  background-color: #444;
}

.cert-content {
  display: grid;
  gap: 1rem;
}

.certificate {
  background-color: #1a1a1a;
  padding: 1rem;
  border-radius: 8px;
  display: flex;
  gap: 1rem;
  align-items: center;
  border: 1px solid #333;
}

.certificate-image {
  width: 15vw;
  object-fit: cover;
  border-radius: 5px;
}

.certificate-info h3 {
  margin: 0;
  font-size: 1.2rem;
  color: #fff;
}

.certificate-info p {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  color: #ccc;
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #1f1f1f;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb {
  background: #ff6f61;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #ff8a7a;
}

#contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

#contact-form label {
  display: flex;
  flex-direction: column;
  font-size: 1rem;
  color: #ccc;
}

#contact-form input,
#contact-form textarea {
  background: #1f1f1f;
  border: 1px solid #444;
  padding: 0.8rem;
  border-radius: 6px;
  color: #e0e0e0;
  font-family: inherit;
  font-size: 1rem;
  margin-top: 0.4rem;
}

#contact-form textarea {
  resize: vertical;
  min-height: 100px;
}

#contact-form button {
  background: #ff6f61;
  color: white;
  border: none;
  padding: 0.8rem;
  font-size: 1rem;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#contact-form button:hover {
  background: #ff8a7a;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInOverlay {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeOutOverlay {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes zoomSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes zoomSlideOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
}

#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #121212;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.spinner {
  border: 6px solid #333;
  border-top: 6px solid #ff6f61;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

#coding-stats img {
  width: 80%;
  max-width: 600px;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto 1rem auto;
}

@media (min-width: 1600px) {
  html {
    font-size: 20px;
  }
  .container {
    max-width: 1400px;
    margin: auto;
  }
  .project img {
    width: 200px;
    height: 200px;
  }
}

@media (min-width: 1280px) and (max-width: 1599px) {
  html {
    font-size: 18px;
  }
  .container {
    max-width: 1200px;
    margin: auto;
  }
}

@media (min-width: 1024px) and (max-width: 1279px) {
  html {
    font-size: 17px;
  }
  .tabs {
    gap: 0.5rem;
  }
  .project img {
    width: 130px;
    height: 130px;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  html {
    font-size: 16px;
  }
  body {
    margin: 1.5rem;
  }
  .tabs {
    flex-wrap: wrap;
  }
  .project {
    flex-direction: column;
    text-align: center;
  }
  .project img {
    width: 120px;
    height: auto;
  }
}

@media (max-width: 767px) {
  html {
    font-size: 16px;
  }
  body {
    margin: 0;
    padding: 0;
  }
  .container {
    width: 100vw;
    min-height: 100vh;
    border-radius: 0;
    padding: 1.5rem;
    box-shadow: none;
  }
  .tabs {
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
  }
  .tab-btn {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    text-align: center;
  }
  .project {
    flex-direction: column;
    text-align: center;
    padding: 1rem;
  }
  .project img {
    width: 100%;
    max-width: 250px;
    height: auto;
  }
  .skills-grid {
    justify-content: center;
  }
  .certificate {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .certificate-image {
    width: 100%;
    max-width: 250px;
  }
  #coding-stats img {
    width: 100%;
  }
}

@media (min-width: 576px) and (max-width: 767px) {
  html {
    font-size: 15px;
  }
  body {
    margin: 1rem;
  }
  .container {
    padding: 1.5rem;
  }
  .tabs {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .project {
    flex-direction: column;
    text-align: center;
  }
  .project img {
    width: 100px;
  }
}

@media (max-width: 575px) {
  html {
    font-size: 14px;
  }
  body {
    margin: 0.5rem;
  }
  .container {
    padding: 1rem;
    border-radius: 8px;
  }
  .tabs {
    flex-direction: column;
    align-items: stretch;
  }
  .tab-btn {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    text-align: center;
  }
  .projects-list {
    gap: 1rem;
  }
  .project {
    flex-direction: column;
    text-align: center;
    padding: 0.8rem;
  }
  .project img {
    width: 100%;
    max-width: 250px;
    height: auto;
  }
  .skills-grid {
    justify-content: center;
  }
  .skill-item {
    width: 60px;
  }

  .skill-item img {
    width: 50px;
    height: 50px;
  }
  .certificate {
    flex-direction: column;
    text-align: center;
  }
  .certificate-image {
    width: 100%;
    max-width: 250px;
  }
  #coding-stats img {
    width: 100%;
  }
}

.menu-toggle {
  display: none;
  background: linear-gradient(135deg, #ff4f6d, #ff2a52);
  color: #fff;
  padding: 12px 18px;
  border: none;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(255, 75, 95, 0.4);
  transition: all 0.3s ease;
}

.menu-toggle:hover {
  background: linear-gradient(135deg, #ff2a52, #ff4f6d);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(255, 75, 95, 0.6);
}

.menu-toggle:active {
  transform: scale(0.96);
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
    margin-bottom: 3%;
  }

  .tabs {
    display: none;
    flex-direction: column;
    gap: 10px;
    background: #222;
  }

  .tabs.show {
    display: flex;
  }

  .tab-btn {
    background: #444;
    color: white;
    border: none;
    padding: 10px;
    text-align: left;
    cursor: pointer;
  }

  .tab-btn:hover {
    background: #666;
  }
}
