/* 
 * Word Calculator CSS Styles
 * File: assets/css/word-calculator.css
 */

/* Основной контейнер калькулятора */
.word-optimization-container {
  width: 100%;
  margin: 0 0 25px 0;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 10px;
  border: 1px solid #e0e0e0;
}

/* Форма калькулятора */
.word-optimization-form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  margin: 0;
}

/* Секция ввода количества */
.word-input-section {
  flex: 1;
  min-width: 200px;
}

.word-input-section label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
  color: #333;
}

/* Поле ввода */
.word-count-input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 16px;
  transition: border-color 0.3s ease;
}

.word-count-input:focus {
  outline: none;
  border-color: #4caf50;
  box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.1);
}

/* Подсказка под полем ввода */
.word-input-hint {
  font-size: 12px;
  margin-top: 5px;
  color: #666;
  line-height: 1.4;
}

/* Секция отображения цены */
.price-display-section {
  flex: 1;
  min-width: 200px;
}

/* Блок с ценой */
.price-display-box {
  background: #fff;
  padding: 5px;
  border-radius: 8px;
  text-align: center;
  border: 2px solid #4caf50;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Метка цены */
.price-display-label {
  font-size: 14px;
  margin-bottom: 5px;
  color: #666;
  font-weight: 500;
}

/* Сумма */
.price-display-amount {
  font-size: 24px;
  font-weight: bold;
  color: #4caf50;
  line-height: 1.2;
}

/* Детали расчета */
.price-details {
  font-size: 12px;
  margin-top: 5px;
  color: #666;
  line-height: 1.4;
}

/* Стили для конкретных типов продуктов */
.words-calculator .price-display-box {
  border-color: #4caf50;
}

.posts-calculator .price-display-box {
  border-color: #2196f3;
}

.words-calculator .price-display-amount {
  color: #4caf50;
}

.posts-calculator .price-display-amount {
  color: #2196f3;
}

/* Индикаторы для разных продуктов */
.product-type-indicator {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: bold;
  margin-left: 5px;
  vertical-align: middle;
}

.words-indicator {
  background-color: #e8f5e8;
  color: #2e7d32;
}

.posts-indicator {
  background-color: #e3f2fd;
  color: #1565c0;
}

/* Адаптивность */
@media (max-width: 768px) {
  .word-optimization-form {
    flex-direction: column;
  }

  .word-input-section,
  .price-display-section {
    min-width: 100%;
    width: 100%;
  }

  .word-optimization-container {
    padding: 15px;
  }

  .price-display-box {
    padding: 10px 5px;
  }
}

@media (max-width: 480px) {
  .word-optimization-container {
    margin: 15px 0;
    padding: 12px;
  }

  .price-display-amount {
    font-size: 20px;
  }

  .word-count-input {
    font-size: 14px;
    padding: 8px;
  }

  .word-input-section label {
    font-size: 14px;
  }

  .price-display-label {
    font-size: 13px;
  }

  .price-details {
    font-size: 11px;
  }
}

/* Дополнительные улучшения */
.word-count-input::-webkit-inner-spin-button,
.word-count-input::-webkit-outer-spin-button {
  opacity: 1;
  height: auto;
}

/* Стили для состояний */
.word-count-input:disabled {
  background-color: #f5f5f5;
  cursor: not-allowed;
}

.word-optimization-container.loading {
  opacity: 0.7;
  pointer-events: none;
}

/* Инфо-блок */
.calculator-info {
  margin-top: 10px;
  padding: 10px;
  background-color: #e8f5e8;
  border-radius: 5px;
  border-left: 4px solid #4caf50;
  font-size: 13px;
  color: #2e7d32;
}

.posts-calculator .calculator-info {
  background-color: #e3f2fd;
  border-left-color: #2196f3;
  color: #1565c0;
}

.calculator-info p {
  margin: 0;
  line-height: 1.4;
}

/* Кнопки быстрого выбора (если добавятся в будущем) */
.quick-select-buttons {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.quick-select-btn {
  padding: 6px 12px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
}

.quick-select-btn:hover {
  background: #f5f5f5;
}

.quick-select-btn.active {
  background: #4caf50;
  color: white;
  border-color: #4caf50;
}

.posts-calculator .quick-select-btn.active {
  background: #2196f3;
  border-color: #2196f3;
}

/* Сообщения об ошибках */
.calculator-error {
  color: #f44336;
  font-size: 12px;
  margin-top: 5px;
  display: none;
}

.calculator-error.show {
  display: block;
}
