@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&family=Varela+Round&display=swap');

/* General styles */
body,html {
  background: radial-gradient(circle at bottom, 
    #2563eb 0%, 
    #0f172a 40%, 
    #000 80%);
  font-family: Montserrat, sans-serif;
  margin: 0;
  padding: 0;
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  touch-action: none;
}

.num-font {
  font-family: "Varela Round", sans-serif;
}

/* Splash Screen */
#splash-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #1e1e1e;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 1000;
  animation: fadeOut 2.5s ease-in-out forwards; 
}

#splash-screen h1 {
  background: linear-gradient(90deg, #06b6d4, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Loader Animation */
.loader {
  border: 5px solid #444;
  border-top: 5px solid #3b82f6; 
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Fade-out animation */
@keyframes fadeOut {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    visibility: hidden;
  }
}

/* Main Calculator */
#main-app {
  display: flex;
  animation: fadeIn 1s forwards;
}

@keyframes fadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* Calculator Styles */
.calculator {
  background: rgba(30, 30, 30, 0.4); /* transparent dark layer */
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px); /* adds glass blur effect */
  -webkit-backdrop-filter: blur(12px);
  width: 350px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.display input {
  width: 100%;
  height: 50px;
  border: none;
  border-radius: 8px;  
  padding: 10px 15px;
  background-color: #2a2a2a;
  color: #fff;
  font-size: 1.2em;
  text-align: right;
  box-sizing: border-box;
  margin-bottom: 15px;
}

.buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 20px;
}

button {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 15px;
  font-size: 1em;
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.3s ease, transform 0.2s ease;
  font-family: montserrat, sans-serif;
  -webkit-tap-highlight-color: transparent;
  outline: none;              
}

button:focus {
  outline: none;
  box-shadow: none;
}

button:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

button:active {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(0.95);
}

/* Bottom row layout */
.bottom-row {
  display: flex;
  justify-content: center;
  margin-top: 15px;
}

.equals-button {
  grid-column: span 2; /* still wider */
  background: rgba(255, 255, 255, 0.15); /* same glass tone as others */
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 1.4em;
  font-weight: bold;
  color: #fff;
  border-radius: 14px;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.4); /* subtle glow */
  transition: all 0.3s ease;
}

.equals-button:hover {
  background: rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.7);
}

.equals-button:active {
  background: rgba(255, 255, 255, 0.35);
  transform: scale(0.96);
}

/* Red Buttons (DEL and AC) with glass effect */
.red-button {
  background: rgba(255, 0, 0, 0.2);
  border: 1px solid rgba(255, 0, 0, 0.4);
}

.red-button:hover {
  background: rgba(255, 0, 0, 0.3);
}

.red-button:active {
  background-color: #8b0000;
  box-shadow: 0 0 8px 2px #ff4444; /* Red glow on click */
}
