/* Chemical Equation Balancer Styles */

.equation-balancer-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;
}

/* Balanced Equation Display */
.balanced-equation {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}

.balanced-equation h3 {
  color: #fff;
}

.equation-display .equation {
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 20px;
}

.equation-display .term {
  display: inline-block;
  padding: 10px 15px;
  background-color: rgba(255,255,255,0.1);
  border-radius: 8px;
  font-weight: 600;
}

.equation-display .operator {
  color: rgba(255,255,255,0.8);
  font-size: 20px;
}

.equation-display .arrow {
  color: #fff;
  font-size: 28px;
  font-weight: 700;
}

/* Coefficients List */
.coefficients-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.coefficient-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  background-color: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #007bff;
}

.compound-formula {
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.coefficient-value {
  font-size: 24px;
  font-weight: 700;
  color: #007bff;
  min-width: 40px;
  text-align: center;
}

/* Verification Table */
.verification-table {
  overflow-x: auto;
}

.verification-table table {
  width: 100%;
  margin: 0;
}

.verification-table th {
  background-color: #007bff;
  color: #fff;
  padding: 12px;
  text-align: center;
  border: none;
}

.verification-table td {
  padding: 10px;
  text-align: center;
  border: none;
}

.verification-table tbody tr:nth-child(even) {
  background-color: #f8f9fa;
}

.reactant-count,
.product-count {
  font-weight: 600;
  font-size: 18px;
}

.reactant-count {
  color: #28a745;
}

.product-count {
  color: #007bff;
}

/* 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,
.info-card li {
  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 ol {
  margin: 0;
  padding-left: 20px;
}

.info-card ol li {
  margin-bottom: 10px;
  line-height: 1.6;
}

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

.info-card ul li {
  margin-bottom: 8px;
  line-height: 1.6;
}

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

/* Responsive */
@media (max-width: 768px) {
  .equation-display .equation {
    font-size: 18px;
    padding: 15px 10px;
  }

  .equation-display .term {
    padding: 8px 10px;
  }

  .equation-display .arrow {
    font-size: 22px;
  }

  .coefficient-value {
    font-size: 20px;
  }

  .compound-formula {
    font-size: 16px;
  }

  .reactant-count,
  .product-count {
    font-size: 16px;
  }
}

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

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

  .calculator-panel 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;
  }

  .compound-formula {
    color: #e0e0e0;
  }

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

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

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