/* Molar Mass Calculator Styles */

.molar-mass-calculator-container {
  margin-top: 20px;
  margin-bottom: 40px;
}

/* Calculator Section */
.calculator-section {
  margin: 20px 0;
}

.calculator-panel {
  background-color: #f8f9fa;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.calculator-panel h2 {
  color: #333;
  margin-bottom: 15px;
}

.calculator-panel p {
  color: #666;
  margin-bottom: 20px;
}

/* Input Group */
.input-group-lg input {
  font-size: 20px;
  padding: 15px;
  border: 2px solid #ddd;
  border-radius: 8px;
  transition: border-color 0.3s;
}

.input-group-lg input:focus {
  border-color: #007bff;
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.input-group-lg .btn {
  margin-left: 10px;
  padding: 15px 30px;
  font-size: 18px;
  font-weight: 600;
}

/* Quick Examples */
.quick-examples {
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid #dee2e6;
}

.quick-examples p {
  margin-bottom: 15px;
  color: #495057;
  font-weight: 600;
}

.example-btn {
  margin: 5px;
  padding: 8px 15px;
  background-color: #fff;
  border: 1px solid #007bff;
  color: #007bff;
  border-radius: 5px;
  transition: all 0.2s;
  cursor: pointer;
}

.example-btn:hover {
  background-color: #007bff;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,123,255,0.3);
}

/* Result Cards */
.result-card {
  background-color: #fff;
  padding: 25px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  margin-bottom: 20px;
  animation: fadeIn 0.3s ease-in;
}

.result-card h3 {
  color: #007bff;
  margin-bottom: 20px;
  font-size: 20px;
}

/* Main Result */
.main-result {
  text-align: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}

.main-result h3 {
  color: #fff;
}

.molar-mass-value {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  margin: 20px 0;
}

.big-number {
  font-size: 48px;
  font-weight: 700;
  color: #fff;
}

.unit {
  font-size: 24px;
  color: rgba(255,255,255,0.8);
}

.formula-display {
  font-size: 18px;
  color: rgba(255,255,255,0.9);
  margin-top: 15px;
}

.formula-display span {
  font-weight: 600;
}

/* Composition Result */
.composition-result .composition-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  margin-bottom: 10px;
  background-color: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #007bff;
}

.composition-item .element-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.element-symbol {
  font-weight: 700;
  font-size: 18px;
  color: #333;
  min-width: 40px;
}

.element-count {
  color: #666;
  font-size: 14px;
}

.contribution-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.contribution-mass {
  font-weight: 600;
  color: #007bff;
  font-size: 16px;
}

.contribution-percent {
  color: #666;
  font-size: 14px;
}

/* Calculation Details */
.calculation-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 16px;
  color: #495057;
}

.detail-element {
  font-weight: 600;
  min-width: 80px;
}

.detail-operator {
  color: #6c757d;
}

.detail-calculation {
  color: #666;
}

.detail-result {
  font-weight: 600;
  color: #007bff;
}

.calculation-total {
  margin-top: 15px;
  padding-top: 15px;
  font-size: 18px;
  color: #333;
}

.total-mass {
  font-weight: 700;
  color: #007bff;
  font-size: 20px;
}

/* Error Section */
.alert-danger {
  background-color: #f8d7da;
  border-color: #f5c6cb;
  color: #721c24;
  padding: 15px 20px;
  border-radius: 8px;
  margin: 20px 0;
}

/* Educational Section */
.educational-section {
  margin-top: 50px;
  padding: 30px;
  background-color: #f8f9fa;
  border-radius: 10px;
}

.educational-section h2 {
  color: #333;
  margin-bottom: 30px;
  text-align: center;
}

.info-card {
  background-color: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  margin-bottom: 20px;
  height: 100%;
}

.info-card h3 {
  color: #007bff;
  margin-bottom: 15px;
  font-size: 18px;
}

.info-card p {
  color: #555;
  line-height: 1.6;
  margin-bottom: 10px;
}

.info-card .formula {
  background-color: #f0f0f0;
  padding: 10px;
  border-radius: 5px;
  font-family: 'Courier New', monospace;
  font-weight: 600;
  text-align: center;
  margin: 10px 0;
  font-size: 18px;
}

.info-card ul {
  margin: 0;
  padding-left: 20px;
}

.info-card li {
  color: #555;
  line-height: 1.8;
  margin-bottom: 8px;
}

/* Periodic Table Reference */
.periodic-table-reference {
  margin-top: 50px;
  padding: 30px;
  background-color: #f8f9fa;
  border-radius: 10px;
}

.periodic-table-reference h2 {
  color: #333;
  margin-bottom: 15px;
}

.periodic-table-reference p {
  color: #666;
  margin-bottom: 25px;
}

.elements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 15px;
}

.element-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 15px;
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.element-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

.element-card .element-symbol {
  display: block;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 5px;
}

.element-card .element-name {
  display: block;
  font-size: 12px;
  color: rgba(255,255,255,0.9);
  margin-bottom: 5px;
}

.element-card .element-mass {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
}

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

/* Responsive */
@media (max-width: 768px) {
  .big-number {
    font-size: 36px;
  }

  .unit {
    font-size: 18px;
  }

  .molar-mass-value {
    flex-direction: column;
    gap: 5px;
  }

  .calculation-step {
    flex-wrap: wrap;
    font-size: 14px;
  }

  .elements-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
  }

  .element-card .element-symbol {
    font-size: 24px;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .calculator-panel,
  .educational-section,
  .periodic-table-reference {
    background-color: #2c2c2c;
    color: #e0e0e0;
  }

  .calculator-panel h2,
  .educational-section h2,
  .periodic-table-reference h2 {
    color: #e0e0e0;
  }

  .calculator-panel p,
  .periodic-table-reference p {
    color: #b0b0b0;
  }

  .result-card {
    background-color: #3c3c3c;
    color: #e0e0e0;
  }

  .result-card h3 {
    color: #0069d9;
  }

  .info-card {
    background-color: #3c3c3c;
    color: #e0e0e0;
  }

  .info-card h3 {
    color: #0069d9;
  }

  .info-card p,
  .info-card li {
    color: #b0b0b0;
  }

  .info-card .formula {
    background-color: #4c4c4c;
    color: #e0e0e0;
  }

  .composition-item {
    background-color: #4c4c4c;
  }

  .element-symbol {
    color: #e0e0e0;
  }

  .calculation-step {
    color: #b0b0b0;
  }

  .calculation-total {
    color: #e0e0e0;
  }

  .input-group-lg input {
    background-color: #3c3c3c;
    border-color: #555;
    color: #e0e0e0;
  }

  .input-group-lg input:focus {
    background-color: #4c4c4c;
    border-color: #0069d9;
  }
}
