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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#app-container {
  width: 100%;
  max-width: 700px;
}

.calculator-card {
  background: white;
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.header-with-info {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 30px;
  gap: 20px;
}

.header-with-info > div {
  flex: 1;
}

h1 {
  color: #2d3748;
  font-size: 2.5rem;
  margin-bottom: 10px;
  text-align: center;
}

.subtitle {
  color: #718096;
  text-align: center;
  margin-bottom: 0;
  font-size: 1rem;
}

.info-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  flex-shrink: 0;
}

.info-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.info-btn:active {
  transform: scale(0.95);
}

.info-icon {
  display: block;
  line-height: 1;
}

/* Mode Toggle */
.mode-toggle {
  display: flex;
  gap: 10px;
  margin-bottom: 25px;
  background: #f7fafc;
  padding: 6px;
  border-radius: 12px;
}

.mode-btn {
  flex: 1;
  padding: 12px;
  background: transparent;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  color: #4a5568;
  cursor: pointer;
  transition: all 0.3s ease;
}

.mode-btn:hover {
  background: rgba(102, 126, 234, 0.1);
}

.mode-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* Calculator Type Buttons */
.calc-type-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin-bottom: 30px;
}

.calc-type-btn {
  background: #f7fafc;
  border: 3px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  font-size: 1rem;
  font-weight: 600;
  color: #4a5568;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.calc-type-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.calc-type-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: #667eea;
}

.calc-type-btn .icon {
  font-size: 2rem;
}

/* Input Section */
.input-section {
  background: #f7fafc;
  padding: 25px;
  border-radius: 12px;
  margin-bottom: 25px;
  min-height: 200px;
}

.input-group {
  margin-bottom: 20px;
}

.input-group:last-child {
  margin-bottom: 0;
}

.input-group label {
  display: block;
  color: #2d3748;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.input-group input,
.input-group select {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
  background: white;
}

.input-group input:focus,
.input-group select:focus {
  outline: none;
  border-color: #667eea;
}

.input-group input[type="number"]::-webkit-inner-spin-button,
.input-group input[type="number"]::-webkit-outer-spin-button {
  opacity: 1;
}

/* Calculate Button */
.calculate-btn {
  width: 100%;
  padding: 18px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.calculate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.calculate-btn:active {
  transform: translateY(0);
}

/* Results Box */
.results-box {
  margin-top: 25px;
  padding: 25px;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  border-radius: 12px;
  color: white;
  animation: slideIn 0.4s ease;
}

.results-box.hidden {
  display: none;
}

.results-box h2 {
  font-size: 1.5rem;
  margin-bottom: 15px;
  text-align: center;
}

#results-content {
  font-size: 1.1rem;
  line-height: 1.8;
}

.result-item {
  background: rgba(255, 255, 255, 0.2);
  padding: 12px 15px;
  border-radius: 8px;
  margin-bottom: 10px;
  backdrop-filter: blur(10px);
}

.result-item:last-child {
  margin-bottom: 0;
}

.result-item strong {
  font-weight: 700;
}

.result-highlight {
  background: rgba(255, 255, 255, 0.3);
  padding: 15px;
  border-radius: 8px;
  font-size: 1.3rem;
  font-weight: 700;
  text-align: center;
  margin-top: 10px;
}

/* Instructions */
.instructions {
  margin-top: 30px;
  padding: 20px;
  background: #edf2f7;
  border-radius: 12px;
  border-left: 4px solid #667eea;
}

.instructions h3 {
  color: #2d3748;
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.instructions p {
  color: #4a5568;
  line-height: 1.6;
}

.instructions code {
  background: #cbd5e0;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  color: #2d3748;
  font-weight: 600;
}

/* Animations */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Calculator Display Styles */
.calculator-display {
  background: #2d3748;
  color: white;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  font-family: 'Courier New', monospace;
}

.calc-expression {
  font-size: 0.9rem;
  color: #a0aec0;
  margin-bottom: 5px;
  min-height: 20px;
}

.calc-result {
  font-size: 2rem;
  font-weight: bold;
  word-break: break-all;
}

.calculator-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.calculator-grid.basic {
  grid-template-columns: repeat(4, 1fr);
}

.calculator-grid.scientific {
  grid-template-columns: repeat(5, 1fr);
}

.calc-btn {
  padding: 20px;
  font-size: 1.2rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: white;
  color: #2d3748;
  border: 2px solid #e2e8f0;
}

.calc-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.calc-btn:active {
  transform: scale(0.98);
}

.calc-btn.number {
  background: white;
  color: #2d3748;
}

.calc-btn.operator {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: #667eea;
}

.calc-btn.function {
  background: #4299e1;
  color: white;
  font-size: 1rem;
  border-color: #4299e1;
}

.calc-btn.clear {
  background: #fc8181;
  color: white;
  border-color: #fc8181;
}

.calc-btn.equals {
  background: #48bb78;
  color: white;
  border-color: #48bb78;
  grid-column: span 2;
}

.calc-btn.zero {
  grid-column: span 2;
}

.calc-btn.wide {
  grid-column: span 2;
}

.calc-memory-display {
  background: rgba(102, 126, 234, 0.1);
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 15px;
  text-align: center;
  color: #4a5568;
  font-size: 0.9rem;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Modal Styles */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 1000;
  overflow-y: auto;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: white;
  border-radius: 20px;
  padding: 40px;
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.3s ease;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: #f7fafc;
  border: 2px solid #e2e8f0;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4a5568;
}

.modal-close:hover {
  background: #fc8181;
  color: white;
  border-color: #fc8181;
  transform: rotate(90deg);
}

.modal-content h2 {
  color: #2d3748;
  font-size: 2rem;
  margin-bottom: 25px;
  text-align: center;
}

.modal-content h3 {
  color: #2d3748;
  font-size: 1.3rem;
  margin-bottom: 15px;
}

.modal-section {
  margin-bottom: 30px;
}

.modal-section p {
  color: #4a5568;
  line-height: 1.7;
  margin-bottom: 15px;
}

.highlight-box {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  padding: 25px;
  border-radius: 12px;
  border-left: 4px solid #667eea;
}

.custom-list {
  list-style: none;
  counter-reset: custom-counter;
  padding-left: 0;
}

.custom-list li {
  counter-increment: custom-counter;
  position: relative;
  padding-left: 45px;
  margin-bottom: 20px;
  color: #4a5568;
  line-height: 1.7;
}

.custom-list li::before {
  content: counter(custom-counter);
  position: absolute;
  left: 0;
  top: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.9rem;
}

.example-prompts {
  margin-top: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.prompt-example {
  background: white;
  padding: 12px 15px;
  border-radius: 8px;
  border-left: 3px solid #667eea;
  color: #2d3748;
  font-style: italic;
  font-size: 0.95rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.ideas-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin-top: 15px;
}

.idea-card {
  background: #f7fafc;
  padding: 15px;
  border-radius: 10px;
  border: 2px solid #e2e8f0;
  transition: all 0.3s ease;
}

.idea-card:hover {
  border-color: #667eea;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.idea-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 8px;
}

.idea-card strong {
  color: #2d3748;
  display: block;
  margin-bottom: 5px;
  font-size: 1rem;
}

.idea-card p {
  color: #718096;
  font-size: 0.85rem;
  margin: 0;
  line-height: 1.5;
}

.cta-section {
  background: #edf2f7;
  padding: 20px;
  border-radius: 12px;
}

.cta-section code {
  background: #cbd5e0;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  color: #2d3748;
  font-weight: 600;
}

.modal-footer {
  text-align: center;
  margin-top: 30px;
}

.cta-button {
  display: inline-block;
  padding: 15px 40px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  text-decoration: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 700;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.modal-content a {
  color: #667eea;
  font-weight: 600;
  text-decoration: none;
}

.modal-content a:hover {
  text-decoration: underline;
}

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

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

/* Responsive Design */
@media (max-width: 600px) {
  .calculator-card {
    padding: 25px;
  }

  .header-with-info {
    flex-direction: column;
    align-items: center;
  }

  .info-btn {
    width: 45px;
    height: 45px;
    font-size: 1.3rem;
  }

  h1 {
    font-size: 2rem;
  }

  .calc-type-buttons {
    grid-template-columns: 1fr;
  }

  .calc-type-btn {
    padding: 15px;
  }

  .calculator-grid.scientific {
    grid-template-columns: repeat(4, 1fr);
  }

  .calc-btn {
    padding: 15px;
    font-size: 1rem;
  }

  .calc-btn.function {
    font-size: 0.85rem;
  }

  .calc-result {
    font-size: 1.5rem;
  }

  .modal-content {
    padding: 30px 20px;
  }

  .modal-content h2 {
    font-size: 1.5rem;
  }

  .ideas-grid {
    grid-template-columns: 1fr;
  }

  .custom-list li {
    padding-left: 40px;
  }
}
