/**
 * Scheduled Process Page Styles
 */

.scheduled-process-page {
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  bottom: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px;
  background: #f5f7fa;
}

.scheduled-process-container {
  max-width: 1400px;
  margin: 0 auto;
  padding-bottom: 40px;
}

.scheduled-process-header {
  margin-bottom: 30px;
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.scheduled-process-header h1 {
  font-size: 28px;
  color: #333;
  margin: 0 0 10px 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.scheduled-process-header p {
  color: #666;
  margin: 0;
  font-size: 14px;
}

.scheduled-process-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Section Styles */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.section-header h2 {
  font-size: 20px;
  color: #333;
  margin: 0;
}

.section-actions {
  display: flex;
  gap: 10px;
}

/* Job Status Section */
.job-status-section {
  background: #fff;
  border-radius: 8px;
  padding: 25px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.job-card {
  background: #f8f9fa;
  border-radius: 6px;
  padding: 20px;
  border: 1px solid #e0e0e0;
}

.job-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid #e0e0e0;
}

.job-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.job-title i {
  font-size: 24px;
}

.job-status {
  padding: 6px 12px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.5px;
}

.status-running {
  color: #28a745;
}

.status-stopped {
  color: #dc3545;
}

.job-status.status-running {
  background: #d4edda;
  color: #155724;
}

.job-status.status-stopped {
  background: #f8d7da;
  color: #721c24;
}

/* Status Banner */
.status-banner {
  padding: 15px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.status-banner i {
  font-size: 24px;
}

.status-banner-running {
  background: #d4edda;
  color: #155724;
  border: 2px solid #28a745;
}

.status-banner-stopped {
  background: #f8d7da;
  color: #721c24;
  border: 2px solid #dc3545;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.85;
  }
}

.job-details {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}

.detail-row.highlight-row {
  background: #e7f3ff;
  padding: 12px;
  border-radius: 6px;
  margin: 5px 0;
  border-left: 3px solid #007bff;
}

.detail-label {
  font-weight: 600;
  color: #555;
}

.detail-label i {
  margin-right: 5px;
}

.detail-value {
  color: #333;
}

.detail-value.highlight-value {
  font-size: 18px;
  font-weight: 700;
  color: #007bff;
}

/* Last Result */
.last-result {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px solid #e0e0e0;
}

.last-result h3 {
  font-size: 16px;
  margin: 0 0 15px 0;
  color: #333;
}

.last-result.error {
  border-top-color: #dc3545;
}

.last-result.success {
  border-top-color: #28a745;
}

.result-data {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
}

.stat-card {
  background: #fff;
  padding: 15px;
  border-radius: 6px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: #007bff;
  margin-bottom: 5px;
}

.stat-label {
  font-size: 12px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.condition-breakdown {
  background: #fff;
  padding: 15px;
  border-radius: 6px;
}

.condition-breakdown h4 {
  font-size: 14px;
  margin: 0 0 10px 0;
  color: #666;
}

.condition-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.condition-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 4px;
  background: #f8f9fa;
}

.condition-good {
  border-left: 4px solid #28a745;
}

.condition-fair {
  border-left: 4px solid #ffc107;
}

.condition-poor {
  border-left: 4px solid #ff9800;
}

.condition-critical {
  border-left: 4px solid #dc3545;
}

.condition-unknown {
  border-left: 4px solid #6c757d;
}

.condition-label {
  font-weight: 600;
}

.condition-value {
  font-weight: 700;
  color: #333;
}

.error-text {
  color: #dc3545;
  font-family: monospace;
}

/* Settings Section */
.settings-section {
  background: #fff;
  border-radius: 8px;
  padding: 25px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-group label {
  font-weight: 600;
  color: #333;
}

.form-group small {
  color: #666;
  font-size: 12px;
}

.interval-control {
  display: flex;
  gap: 10px;
}

.interval-control input {
  flex: 1;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
}

.control-buttons {
  display: flex;
  gap: 10px;
}

/* History Section */
.history-section {
  background: #fff;
  border-radius: 8px;
  padding: 25px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.history-count {
  font-size: 14px;
  color: #666;
  margin-bottom: 15px;
}

.history-container {
  /* Removed max-height to allow page scrolling */
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-entry {
  background: #f8f9fa;
  border-radius: 6px;
  padding: 15px;
  border-left: 4px solid #ccc;
  transition: transform 0.2s, box-shadow 0.2s;
}

.history-entry:hover {
  transform: translateX(2px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.history-entry.success {
  border-left-color: #28a745;
}

.history-entry.error {
  border-left-color: #dc3545;
}

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

.history-index {
  font-weight: 600;
  color: #666;
  font-size: 14px;
}

.history-timestamp {
  color: #666;
  font-size: 13px;
}

.history-status {
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
}

.history-status.success {
  background: #d4edda;
  color: #155724;
}

.history-status.error {
  background: #f8d7da;
  color: #721c24;
}

.history-details {
  font-size: 13px;
}

.history-stats {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.history-stats .stat {
  color: #333;
}

.error-message {
  color: #dc3545;
  font-family: monospace;
  font-size: 12px;
}

.execution-time {
  color: #666;
  font-size: 12px;
  margin-top: 5px;
}

/* Buttons */
.btn {
  padding: 10px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-primary {
  background: #007bff;
  color: #fff;
}

.btn-primary:hover {
  background: #0056b3;
}

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

.btn-secondary:hover {
  background: #545b62;
}

.btn-success {
  background: #28a745;
  color: #fff;
}

.btn-success:hover {
  background: #218838;
}

.btn-danger {
  background: #dc3545;
  color: #fff;
}

.btn-danger:hover {
  background: #c82333;
}

.btn-outline {
  background: #fff;
  color: #6c757d;
  border: 1px solid #6c757d;
}

.btn-outline:hover {
  background: #6c757d;
  color: #fff;
}

/* Utilities */
.loading-indicator {
  text-align: center;
  padding: 40px;
  color: #666;
}

.no-data {
  text-align: center;
  padding: 40px;
  color: #999;
}

.error-message {
  background: #f8d7da;
  color: #721c24;
  padding: 15px;
  border-radius: 4px;
  border: 1px solid #f5c6cb;
}

/* Toast Notification */
.toast-notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #28a745;
  color: #fff;
  padding: 15px 20px;
  border-radius: 4px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s;
  z-index: 10000;
}

.toast-notification.show {
  opacity: 1;
  transform: translateY(0);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding: 20px 0;
}

.pagination-info {
  color: #666;
  font-size: 14px;
  margin: 0 15px;
}

.pagination-btn {
  padding: 8px 16px;
  border: 1px solid #ddd;
  background: #fff;
  color: #333;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pagination-btn:hover:not(:disabled) {
  background: #007bff;
  border-color: #007bff;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: #f5f5f5;
}

.pagination-pages {
  display: flex;
  gap: 5px;
}

.pagination-page {
  padding: 8px 12px;
  border: 1px solid #ddd;
  background: #fff;
  color: #333;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  min-width: 40px;
  text-align: center;
  transition: all 0.2s;
}

.pagination-page:hover {
  background: #007bff;
  border-color: #007bff;
  color: #fff;
}

.pagination-page.active {
  background: #007bff;
  border-color: #007bff;
  color: #fff;
  font-weight: 600;
}

.pagination-ellipsis {
  padding: 8px 4px;
  color: #999;
  user-select: none;
}

/* Processor-specific styling */
.stat-card.processor {
  border-left: 3px solid #28a745;
}

.stat-card.processor .stat-value {
  color: #28a745;
}

.history-entry.processor {
  border-left: 3px solid #28a745;
}

.history-job {
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 12px;
  background: #e9ecef;
  color: #495057;
}

.history-job.processor {
  background: #d4edda;
  color: #155724;
}

.history-stats .stat.processor {
  color: #28a745;
  font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
  .scheduled-process-page {
    padding: 10px;
    top: 50px;
  }

  .scheduled-process-header {
    padding: 15px;
  }

  .scheduled-process-header h1 {
    font-size: 22px;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

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

  .control-buttons {
    flex-direction: column;
  }

  .history-stats {
    flex-direction: column;
    gap: 5px;
  }

  .section-actions {
    flex-wrap: wrap;
  }
}
