@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Changa+One&display=swap');


* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root{
	--prin-color:#000c75;
	--sec-color:#3e94e6;
	--ter-color:#fff;
}

/* --- ESTILOS DEL HEADER Y MENÚ --- */
.header {
  display: flex;
  right: 68%;
  position: fixed;
  top: 20px;
  z-index: 100;
  height: 60px;
  width: 30%;
}

.menu {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 1152px; /* Equivalente aproximado a w-xl */
  height: 60px;
  padding: 6px 20px;
  border-radius: 50px;

  /* Efecto de cristal (Glassmorphism) */
  backdrop-filter: blur(25px) saturate(100%);
  -webkit-backdrop-filter: blur(25px) saturate(100%);
  background-color: rgba(255, 255, 255, 0.177);
  box-shadow: 0 1px 3px 0 rgba(31, 38, 135, 0.37);
}

.menu-list {
  display: flex;
  justify-content: space-between;
  align-items: left;
  text-decoration: none;
  list-style: none;
  width: 100%;
}

/* --- ESTILOS DE LOS ENLACES Y ELEMENTOS --- */
.menu-links {
  display: flex;
  align-items: center;
  gap: 20px;
  font-weight: 600;
  text-decoration: none;
}

.menu-links a{
  text-decoration: none;
  color: #000c75;
}


.logo-img {
  width: 52px;
}

.btn-contacto {
  background-color: #000c75;
  color: #ffffff !important;
  border-radius: 9999px;
  padding: 6px 10px;
  display: inline-block;
  transition: transform 0.2s ease;
}

.btn-contacto:hover {
  transform: scale(1.1);
}




@media (min-width: 481px) and (max-width: 720px) {
  .buttons {
    gap: 10px;
  }
  .buttons button {
    font-size: 15px;
    padding: 14px 5px;
  }
}

body {
  font-family: "Inter", sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 20px;
}
h1 {
  margin-top: 0px;
  margin-bottom: 5px;
  font-size: clamp(28px, 7vw, 50px);
  color: #3e94e6;
  font-family: "Changa One", cursive;
  font-weight: 400;
  text-align: center;
  width: 100%;

  /* font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; */
}

h1 span {
  color:#000c75;

  /* font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; */
}

/* --- RESPONSIVE (MÓVILES) --- */
@media (max-width: 800px) {
  .header {
    width: 100%;
    right: auto;
    left: 60%;
    transform: translateX(-50%);
  }
  .menu {
    width: 80%;
  }

  h1 {
  margin-top: 70px;
  margin-bottom: 20px;

  /* font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; */
}
}

.calculator {
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 25px 50px rgba(60, 75, 120, 0.15);
  padding: 30px;
  max-width: 480px;
  width: 100%;
  animation: slideIn 0.6s ease-out;
}

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

.mode-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 15px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 6px;
}

.mode-toggle button {
  flex: 1;
  background: transparent;
  border: none;
  color: rgba(0, 12, 117, 0.7);
  font-family: "Inter", sans-serif;
  font-weight: 500;
  padding: 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 12px;
  letter-spacing: 0.5px;
}

.mode-toggle button.active {
  background: rgba(123, 216, 255, 0.2);
  color: var(--prin-color);
  transform: scale(1.02);
}

.display {
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: right;
  transition: all 0.3s ease;
}

.display:hover {
  background: rgba(0, 0, 0, 0.4);
}

.expression {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.7);
  min-height: 28px;
  line-height: 1.4;
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result {
  font-size: 36px;
  font-weight: 600;
  color: #000c75;
  margin-top: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: none;
}

.result.error {
  color: #ff6b6b;
  font-size: 20px;
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

.buttons {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.buttons button {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(0, 0, 0, 0.05);
  color: #000c75;
  border-radius: 16px;
  padding: 12px 5px;
  font-size: 16px;
  font-weight: 500;
  font-family: "Inter", sans-serif;
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.buttons button:hover {
  background: rgba(255, 255, 255, 0.4);
  box-shadow: 0 8px 20px rgba(60, 75, 120, 0.1);
}

.buttons button:active {
  box-shadow: 0 4px 10px rgba(60, 75, 120, 0.1);
}

.buttons button::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition:
    width 0.3s ease,
    height 0.3s ease;
}

.buttons button:active::before {
  width: 100%;
  height: 100%;
}

/* Botones especiales */
.buttons button:nth-child(1), /* C */
    .buttons button:nth-child(2) {
  /* CE */
  background: rgba(255, 107, 107, 0.5);
  border-color: rgba(255, 107, 107, 0.6);
  color: white;
}

.buttons button:nth-child(1):hover,
.buttons button:nth-child(2):hover {
  background: rgba(255, 107, 107, 0.7);
}

.buttons button:last-child {
  /* = */
  background: rgba(74, 222, 128, 0.6) !important;
  border-color: rgba(74, 222, 128, 0.7) !important;
  color: white !important;
  grid-column: span 2;
}

.buttons button:last-child:hover {
  background: rgba(74, 222, 128, 0.8) !important;
}

/* Operadores principales */
.buttons button:nth-child(5), /* ÷ */
    .buttons button:nth-child(10), /* × */
    .buttons button:nth-child(15), /* - */
    .buttons button:nth-child(20) {
  /* + */
  /* Se ha eliminado nth-child(45) para que no sobreescriba el estilo del botón '=' */
  background: rgba(0, 12, 117, 0.5);
  border-color: rgba(0, 12, 117, 0.5);
  color: white;
}

.buttons button:nth-child(5):hover,
.buttons button:nth-child(10):hover,
.buttons button:nth-child(15):hover,
.buttons button:nth-child(20):hover {
  background: rgba(0, 12, 117, 0.7);
}

/* Números */
.buttons button:nth-child(n + 31):nth-child(-n + 43) {
  background: rgba(255, 255, 255, 0.3);
  font-weight: 600;
}

.buttons button:nth-child(n + 31):nth-child(-n + 43):hover {
  background: rgba(255, 255, 255, 0.5);
}

/* Botón 0 especial - ocupa doble espacio */
.zero-button {
  grid-column: span 1 !important;
}

/* Responsive */
@media (max-width: 480px) {
  .calculator {
    padding: 20px;
    margin: 0px;
    height: auto;
  }
  body {
    padding: 10px;
  }
  .buttons {
    gap: 5px;
  }

  .buttons button {
    font-size: 14px;
    padding: 10px 5px;
  }

  .result {
    font-size: 28px;
  }
}

@media (max-width: 360px) {
  .buttons {
    gap: 4px;
  }
  .buttons button {
    font-size: 12px;
    padding: 6px 3px;
    border-radius: 10px;
  }
  .result {
    font-size: 22px;
  }
  .expression {
    font-size: 13px;
  }
  .calculator {
    padding: 10px;
    border-radius: 16px;
  }
  h1 {
    font-size: clamp(18px, 5vw, 28px);
  }
  .display {
    padding: 16px;
  }
}

/* Efectos de glassmorphism adicionales */
.calculator::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.2) 0%,
    rgba(255, 255, 255, 0) 100%
  );
  border-radius: 24px;
  pointer-events: none;
}

/* Animaciones suaves para los números */
.result {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.expression {
  transition: all 0.2s ease;
}
