/* pH Calculator Styles */

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

/* Calculator Panel */
.calculator-panel {
  background-color: #f8f9fa;
  padding: 30px;
  border-radius: 10px;
  margin: 20px 0;
  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 Groups */
.input-group {
  max-width: 500px;
  margin-bottom: 20px;
}

.input-group input {
  font-size: 18px;
  padding: 12px 15px;
  border: 2px solid #ddd;
  border-radius: 5px;
  transition: border-color 0.3s;
}

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

.input-group-addon {
  background-color: #e9ecef;
  border: 2px solid #ddd;
  border-left: none;
  padding: 12px 15px;
  font-weight: 600;
  color: #495057;
}

.input-group-btn .btn {
  padding: 12px 25px;
  font-size: 16px;
  font-weight: 600;
}

/* Result Panel */
.result-panel {
  margin-top: 25px;
  padding: 20px;
  background-color: #e7f3ff;
  border-left: 5px solid #007bff;
  border-radius: 5px;
  animation: fadeIn 0.3s ease-in;
}

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

.result-value {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 24px;
}

.result-value .label {
  font-weight: 600;
  color: #495057;
}

.result-value .ph-value {
  color: #007bff;
  font-weight: 700;
  font-size: 32px;
}

/* pH Scale Section */
.ph-scale-section {
  margin: 40px 0;
  padding: 20px;
  background-color: #f8f9fa;
  border-radius: 10px;
}

.ph-scale-section h2 {
  color: #333;
  margin-bottom: 10px;
}

.ph-scale-section p {
  color: #666;
  margin-bottom: 25px;
}

/* pH Scale Visualization */
.ph-scale {
  position: relative;
  height: 120px;
  margin: 30px 20px;
  background: linear-gradient(to right,
    #ff0000 0%,
    #ff4500 7%,
    #ff8c00 14%,
    #ffd700 21%,
    #ffff00 29%,
    #adff2f 36%,
    #7fff00 43%,
    #00ff00 50%,
    #00ff7f 57%,
    #00ffff 64%,
    #00bfff 71%,
    #0000ff 79%,
    #4169e1 86%,
    #00008b 93%,
    #4b0082 100%
  );
  border-radius: 60px;
  border: 3px solid #333;
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.3);
}

.ph-indicator {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  background-color: #333;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  transition: all 0.5s ease;
  z-index: 10;
}

.ph-indicator.neutral {
  background-color: #fff;
  border-color: #333;
}

.ph-indicator.very-acidic,
.ph-indicator.acidic {
  background-color: #ff0000;
  border-color: #fff;
}

.ph-indicator.weakly-acidic {
  background-color: #ffff00;
  border-color: #333;
}

.ph-indicator.nearly-neutral,
.ph-indicator.basic {
  background-color: #00bfff;
  border-color: #fff;
}

.ph-indicator.strongly-basic {
  background-color: #4b0082;
  border-color: #fff;
}

/* pH Marks */
.ph-marks {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  margin-top: 15px;
}

.ph-mark {
  text-align: center;
  position: relative;
}

.ph-mark span {
  display: block;
  font-weight: 700;
  font-size: 16px;
  color: #333;
  margin-bottom: 5px;
}

.ph-mark small {
  display: block;
  font-size: 11px;
  color: #666;
  max-width: 80px;
  line-height: 1.2;
}

/* Current pH Display */
.current-ph-display {
  text-align: center;
  padding: 20px;
  background-color: #fff;
  border-radius: 8px;
  margin-top: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
}

.current-ph-display.pulse {
  animation: pulse 0.5s ease;
}

.current-ph-display h3 {
  font-size: 24px;
  color: #333;
}

#current-ph {
  font-weight: 700;
  font-size: 32px;
  color: #007bff;
}

#ph-description {
  font-size: 20px;
  color: #666;
}

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

.educational-info 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: 20px;
}

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

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

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

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

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

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .ph-scale {
    height: 100px;
  }

  .ph-marks {
    flex-wrap: wrap;
    gap: 5px;
  }

  .ph-mark {
    flex: 1 1 12%;
    min-width: 40px;
  }

  .ph-mark small {
    font-size: 9px;
  }

  .result-value {
    font-size: 18px;
  }

  .result-value .ph-value {
    font-size: 24px;
  }

  .current-ph-display h3 {
    font-size: 18px;
  }

  #current-ph {
    font-size: 24px;
  }

  #ph-description {
    font-size: 16px;
  }
}

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

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

  .calculator-panel p,
  .ph-scale-section p {
    color: #b0b0b0;
  }

  .result-panel {
    background-color: #1a3a5c;
    border-left-color: #0069d9;
  }

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

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

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

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

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

  .current-ph-display {
    background-color: #3c3c3c;
  }

  .current-ph-display h3 {
    color: #e0e0e0;
  }

  .ph-mark span {
    color: #e0e0e0;
  }

  .ph-mark small {
    color: #b0b0b0;
  }
}
