/* ✨ Super Special Calculator Styles ✨ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Arial", sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
  overflow-y: auto;
}

.calculator-container {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  padding: 20px;
  max-width: 380px;
  width: 100%;
  backdrop-filter: blur(10px);
  max-height: 90vh;
  overflow-y: auto;
}

.header {
  text-align: center;
  margin-bottom: 15px;
}

.title {
  font-size: 20px;
  color: #333;
  margin-bottom: 5px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
  font-size: 12px;
  color: #666;
  font-style: italic;
}

.display {
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 15px;
  text-align: right;
  font-size: 20px;
  font-weight: bold;
  color: #333;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.buttons-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 15px;
}

.button {
  padding: 12px 8px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
  min-height: 45px;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);
}

.button:active {
  transform: translateY(0);
}

.number {
  background: linear-gradient(145deg, #ffffff, #e6e6e6);
  color: #333;
}

.operator {
  background: linear-gradient(145deg, #ff6b6b, #ee5a52);
  color: white;
}

.special {
  background: linear-gradient(145deg, #4ecdc4, #44a08d);
  color: white;
}

.equals {
  background: linear-gradient(145deg, #45b7d1, #96c93d);
  color: white;
  grid-column: span 2;
}

.clear {
  background: linear-gradient(145deg, #ffa726, #ff9800);
  color: white;
}

.advanced-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 15px;
}

.advanced-btn {
  padding: 10px 6px;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  background: linear-gradient(145deg, #9c27b0, #673ab7);
  color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  min-height: 35px;
}

.advanced-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.history {
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  padding: 12px;
  max-height: 120px;
  overflow-y: auto;
  font-size: 11px;
  color: #666;
}

.history-item {
  padding: 3px 0;
  border-bottom: 1px solid #eee;
}

.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  width: 45px;
  height: 45px;
  cursor: pointer;
  font-size: 18px;
  backdrop-filter: blur(10px);
  z-index: 1000;
}

.emoji-result {
  text-align: center;
  font-size: 20px;
  margin: 8px 0;
  animation: bounce 0.5s ease;
  min-height: 25px;
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-8px);
  }
  60% {
    transform: translateY(-4px);
  }
}

.quiz-mode {
  background: linear-gradient(145deg, #ff6b9d, #c44569);
  color: white;
  grid-column: span 2;
}

.voice-btn {
  background: linear-gradient(145deg, #feca57, #ff9ff3);
  color: white;
}

/* Responsive design for smaller screens */
@media (max-height: 700px) {
  .calculator-container {
    padding: 15px;
    max-height: 95vh;
  }

  .header {
    margin-bottom: 10px;
  }

  .title {
    font-size: 18px;
  }

  .display {
    padding: 12px;
    margin-bottom: 10px;
    font-size: 18px;
    min-height: 40px;
  }

  .button {
    padding: 10px 6px;
    font-size: 14px;
    min-height: 40px;
  }

  .advanced-btn {
    padding: 8px 4px;
    font-size: 11px;
    min-height: 30px;
  }

  .history {
    max-height: 100px;
    font-size: 10px;
  }
}

/* Scrollbar styling */
.calculator-container::-webkit-scrollbar {
  width: 6px;
}

.calculator-container::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.calculator-container::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 3px;
}

.calculator-container::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Dark theme styles */
body.dark-theme {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}

body.dark-theme .calculator-container {
  background: rgba(44, 62, 80, 0.95);
  color: #ecf0f1;
}

body.dark-theme .title {
  color: #ecf0f1;
}

body.dark-theme .subtitle {
  color: #bdc3c7;
}

body.dark-theme .display {
  background: #34495e;
  border-color: #2c3e50;
  color: #ecf0f1;
}

body.dark-theme .history {
  background: #34495e;
  border-color: #2c3e50;
  color: #bdc3c7;
}

body.dark-theme .history-item {
  border-bottom-color: #2c3e50;
}
