/* ========================================
   Number Sorter - Page Specific Styles
   ======================================== */

/* ---------- Input/Output Sections ---------- */
.io-section {
  margin-bottom: 20px;
}

.io-section:last-of-type {
  margin-bottom: 0;
}

.io-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.io-label {
  font-size: 15px;
  font-weight: 600;
  color: #212529;
}

.io-meta {
  font-size: 13px;
  color: #6c757d;
}

.io-meta strong {
  color: #007bff;
}

#inputNumbers,
#outputNumbers {
  width: 100%;
  min-height: 120px;
  padding: 15px;
  border: 1px solid #ced4da;
  border-radius: 8px;
  font-size: 15px;
  font-family: 'Courier New', monospace;
  resize: vertical;
  line-height: 1.6;
  margin-bottom: 8px;
}

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

#outputNumbers {
  background-color: #f8f9fa;
  color: #212529;
}

/* ---------- Separator Bar ---------- */
.separator-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.separator-label {
  font-size: 13px;
  color: #6c757d;
  font-weight: 500;
  white-space: nowrap;
}

.separator-options {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.separator-radio {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  padding: 6px 12px;
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  font-size: 13px;
  color: #495057;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.separator-radio:hover {
  background-color: #e9ecef;
  border-color: #ced4da;
}

.separator-radio input[type="radio"] {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: #007bff;
  margin: 0;
}

.separator-radio input[type="radio"]:checked + span {
  color: #007bff;
  font-weight: 500;
}

.separator-radio:has(input[type="radio"]:checked) {
  background-color: #e7f3ff;
  border-color: #007bff;
}

.custom-separator-input {
  padding: 6px 10px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  font-size: 13px;
  color: #495057;
  width: 80px;
  margin-left: 4px;
}

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

/* ---------- Options Grid ---------- */
.options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.option-group {
  background-color: #f8f9fa;
  padding: 16px;
  border-radius: 8px;
}

.option-title {
  font-size: 14px;
  font-weight: 600;
  color: #212529;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e9ecef;
}

.radio-label,
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 5px 0;
  font-size: 14px;
  color: #495057;
  transition: color 0.15s ease;
}

.radio-label:hover,
.checkbox-label:hover {
  color: #212529;
}

.radio-label input[type="radio"],
.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #007bff;
}

/* ---------- Action Bar ---------- */
.action-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding-top: 15px;
  border-top: 1px solid #f1f3f5;
}

.action-btn {
  background-color: #007bff;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.action-btn:hover:not(:disabled) {
  background-color: #0069d9;
}

.action-btn:disabled {
  background-color: #6c757d;
  cursor: not-allowed;
}

.btn-primary {
  background-color: #0066cc;
  font-size: 15px;
  padding: 12px 24px;
}

.btn-primary:hover {
  background-color: #0052a3;
}

.btn-secondary {
  background-color: #6c757d;
}

.btn-secondary:hover {
  background-color: #5a6268;
}

/* ---------- Statistics Panel ---------- */
.stats-panel {
  background-color: #e7f3ff;
  border: 1px solid #b8daff;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.stats-panel h3 {
  font-size: 16px;
  color: #004085;
  margin-bottom: 15px;
  text-align: center;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}

.stat-item {
  background-color: #ffffff;
  padding: 12px;
  border-radius: 6px;
  text-align: center;
}

.stat-label {
  display: block;
  font-size: 12px;
  color: #6c757d;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  display: block;
  font-size: 20px;
  font-weight: 600;
  color: #007bff;
  font-family: 'Courier New', monospace;
}

/* ---------- Output Section ---------- */
.output-section {
  padding-top: 15px;
  border-top: 1px solid #f1f3f5;
}

/* ---------- Responsive ---------- */
@media (max-width: 992px) {
  .options-grid {
    grid-template-columns: 1fr;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .separator-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .separator-options {
    width: 100%;
  }

  .action-bar {
    flex-direction: column;
  }

  .action-btn {
    width: 100%;
    justify-content: center;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  #inputNumbers,
  #outputNumbers {
    min-height: 100px;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}