/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* CSS Reset & Global Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* General Body Styling */
body {
  font-family: 'Poppins', sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  background: linear-gradient(135deg, #667eea, #764ba2);
  animation: gradientBG 15s ease infinite;
  padding: 20px;
}

/* Container */
.container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 500px;
}

/* Calculator Styling */
.calculator {
  width: 100%;
  padding: 25px;
  border-radius: 24px;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
  background: rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  animation: fadeIn 1.5s ease-in-out;
  overflow: hidden;
}

.calculator h2 {
  text-align: center;
  margin-bottom: 20px;
  font-weight: 700;
  color: #333;
  font-size: 1.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Result Display */
#result {
  width: 100%;
  height: 70px;
  margin-bottom: 20px;
  padding: 15px;
  font-size: 1.8rem;
  text-align: right;
  border: none;
  border-radius: 12px;
  background-color: #f3f4f6;
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.1);
  color: #333;
  font-weight: 500;
  transition: all 0.3s ease;
}

#result.flash {
  background-color: #e6f7ff;
  box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

#result.error {
  background-color: #ffebee;
  color: #d32f2f;
  box-shadow: 0 0 10px rgba(244, 67, 54, 0.5);
}

/* Button Styles */
.buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

button {
  height: 65px;
  font-size: 1.2rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  border-radius: 12px;
  background-color: #667eea;
  color: white;
  transition: all 0.3s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Hover Effect */
button:hover {
  background-color: #764ba2;
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

button:active {
  transform: translateY(1px);
}

/* Special Buttons */
.clear {
  background-color: #f44336;
  grid-column: span 2;
}

.clear:hover {
  background-color: #d32f2f;
}

.equal {
  background-color: #4caf50;
  grid-column: span 2;
}

.equal:hover {
  background-color: #388e3c;
}

.zero {
  grid-column: span 2;
}

/* Operator Buttons */
button:nth-child(1),
button:nth-child(2),
button:nth-child(3),
button:nth-child(4),
button:nth-child(5) {
  background-color: #ff9800;
}

button:nth-child(1):hover,
button:nth-child(2):hover,
button:nth-child(3):hover,
button:nth-child(4):hover,
button:nth-child(5):hover {
  background-color: #f57c00;
}

/* Name Styling */
.name {
  grid-column: 1 / -1;
  text-align: center;
  margin-top: 15px;
  font-size: 0.9rem;
  color: #666;
  font-weight: 400;
}

/* Animations */
@keyframes fadeIn {
  0% {
    transform: scale(0.95);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes gradientBG {
  0% {
    background: linear-gradient(135deg, #667eea, #764ba2);
  }
  50% {
    background: linear-gradient(135deg, #764ba2, #667eea);
  }
  100% {
    background: linear-gradient(135deg, #667eea, #764ba2);
  }
}

/* Responsive Design */
@media (max-width: 500px) {
  .calculator {
    padding: 15px;
    border-radius: 20px;
  }
  
  #result {
    height: 60px;
    font-size: 1.5rem;
    margin-bottom: 15px;
  }
  
  button {
    height: 55px;
    font-size: 1rem;
  }
  
  .calculator h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
  }
}

@media (max-width: 350px) {
  .calculator {
    padding: 12px;
  }
  
  .buttons {
    gap: 8px;
  }
  
  button {
    height: 50px;
    font-size: 0.9rem;
    border-radius: 10px;
  }
}