/* ---------------------------------------------------------------------------
   Generation Screens – Styles for Generate Data, Generation Log, Generated Files
   --------------------------------------------------------------------------- */

/* ============================================================================
   SHARED STYLES
   ============================================================================ */

#view-generation-data,
#view-generation-log,
#view-generation-files {
  padding: 1.5rem;
}

#view-generation-data > p.subtitle,
#view-generation-log > p.subtitle,
#view-generation-files > p.subtitle {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.subtitle {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

/* Hide/Show sections */
.hidden {
  display: none !important;
}

/* ============================================================================
   FORM STYLES
   ============================================================================ */

#generation-form-section {
  background: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

#generation-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.form-group input[type="number"],
.form-group input[type="text"],
.form-group select {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  font-size: 0.9rem;
  background: var(--bg-input);
  color: var(--text-primary);
  transition: border-color 0.2s;
}

.form-group input[type="number"]:focus,
.form-group input[type="text"]:focus,
.form-group select:focus {
  outline: 0;
  border-color: var(--blue);
  box-shadow: 0 0 0 2px var(--blue-light, rgba(59, 130, 246, 0.1));
}

.form-checkbox {
  flex-direction: row;
  align-items: center;
  gap: 0.8rem;
}

.form-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.form-checkbox label {
  font-weight: normal;
  margin: 0;
  cursor: pointer;
}

#generation-form-error {
  padding: 0.75rem 1rem;
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid var(--error);
  border-radius: 4px;
  color: var(--error);
  font-size: 0.9rem;
}

#btn-generation-start {
  padding: 0.6rem 1.5rem;
  background: var(--blue);
  color: white;
  border: none;
  border-radius: 4px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
  width: fit-content;
}

#btn-generation-start:hover {
  background: var(--blue-dark, #1e40af);
}

#btn-generation-start:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ============================================================================
   PROGRESS & STATUS DISPLAY
   ============================================================================ */

#generation-progress-section,
#generation-result-section {
  background: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

#generation-progress-section h2,
#generation-result-section h2 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

.status-row,
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border-light);
}

.status-row:last-child,
.summary-row:last-child {
  border-bottom: none;
}

.status-label,
.summary-label {
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 0.9rem;
  min-width: 150px;
}

.status-badge {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.status-badge.success {
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
}

.status-badge.error {
  background: rgba(220, 38, 38, 0.15);
  color: #dc2626;
}

.status-badge.warning {
  background: rgba(234, 179, 8, 0.15);
  color: #ea4444;
}

.status-badge.info {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

#generation-job-progress-bar {
  height: 8px;
  background: var(--bg-secondary);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 1.5rem;
  margin-bottom: 0;
}

#generation-job-progress-fill {
  height: 100%;
  background: var(--blue);
  width: 0%;
  animation: pulse 1.5s ease-in-out infinite;
}

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

#generation-result-actions {
  display: flex;
  gap: 0.8rem;
  margin-top: 1.5rem;
}

#btn-generation-view-files,
#btn-generation-start-new {
  padding: 0.6rem 1.5rem;
  border: none;
  border-radius: 4px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9rem;
}

#btn-generation-view-files {
  background: var(--blue);
  color: white;
}

#btn-generation-view-files:hover {
  background: var(--blue-dark, #1e40af);
}

#btn-generation-start-new {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}

#btn-generation-start-new:hover {
  background: var(--bg-secondary);
}

#generation-result-error {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid var(--error);
  border-radius: 4px;
  color: var(--error);
  font-size: 0.9rem;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ============================================================================
   TABLE FILTERS & PAGINATION
   ============================================================================ */

#generation-log-filters,
#generation-files-filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.filter-group label {
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.filter-group input,
.filter-group select {
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  font-size: 0.9rem;
  background: var(--bg-input);
  color: var(--text-primary);
}

.filter-group input:focus,
.filter-group select:focus {
  outline: 0;
  border-color: var(--blue);
}

#btn-generation-log-filter,
#btn-generation-files-filter,
#btn-generation-log-clear,
#btn-generation-files-clear {
  padding: 0.4rem 1rem;
  border: none;
  border-radius: 4px;
  font-weight: 500;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

#btn-generation-log-filter,
#btn-generation-files-filter {
  background: var(--blue);
  color: white;
}

#btn-generation-log-filter:hover,
#btn-generation-files-filter:hover {
  background: var(--blue-dark, #1e40af);
}

#btn-generation-log-clear,
#btn-generation-files-clear {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}

#btn-generation-log-clear:hover,
#btn-generation-files-clear:hover {
  background: var(--bg-secondary);
}

/* ============================================================================
   TABLE STYLES
   ============================================================================ */

#generation-log-table-wrap,
#generation-files-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  margin-bottom: 1.5rem;
}

#generation-log-table,
#generation-files-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

#generation-log-table thead,
#generation-files-table thead {
  background: var(--bg-secondary);
  border-bottom: 2px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 10;
}

#generation-log-table th,
#generation-files-table th {
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

#generation-log-table tbody tr:nth-child(odd),
#generation-files-table tbody tr:nth-child(odd) {
  background: var(--bg-hover, rgba(0, 0, 0, 0.01));
}

#generation-log-table tbody tr:hover,
#generation-files-table tbody tr:hover {
  background: var(--bg-secondary, rgba(0, 0, 0, 0.03));
}

#generation-log-table td,
#generation-files-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}

#generation-log-table tbody tr:last-child td,
#generation-files-table tbody tr:last-child td {
  border-bottom: none;
}

/* Action buttons in tables */
.btn-file-preview,
.btn-file-download,
.btn-file-import,
.btn-view-params {
  padding: 0.3rem 0.6rem;
  margin-right: 0.4rem;
  border: 1px solid var(--border-light);
  background: transparent;
  color: var(--blue);
  border-radius: 3px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-file-preview:hover,
.btn-file-download:hover,
.btn-file-import:hover,
.btn-view-params:hover {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
}

.btn-file-preview:disabled,
.btn-file-download:disabled,
.btn-file-import:disabled,
.btn-view-params:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================================================
   PAGINATION STYLES
   ============================================================================ */

#generation-log-pagination,
#generation-files-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem;
  background: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  flex-wrap: wrap;
}

#generation-log-page-info,
#generation-files-page-info {
  font-size: 0.9rem;
  color: var(--text-secondary);
  min-width: 200px;
}

#generation-log-page-controls,
#generation-files-page-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#generation-log-page-controls button,
#generation-files-page-controls button {
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--border-light);
  background: transparent;
  color: var(--text-primary);
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

#generation-log-page-controls button:hover,
#generation-files-page-controls button:hover {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
}

#generation-log-page-controls button:disabled,
#generation-files-page-controls button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#generation-log-page-display,
#generation-files-page-display {
  font-size: 0.9rem;
  color: var(--text-primary);
  min-width: 80px;
  text-align: center;
}

#generation-log-per-page-wrap,
#generation-files-per-page-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
}

#generation-log-per-page-wrap label,
#generation-files-per-page-wrap label {
  color: var(--text-secondary);
}

#generation-log-per-page,
#generation-files-per-page {
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--border-light);
  border-radius: 3px;
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.9rem;
  cursor: pointer;
}

/* ============================================================================
   NO DATA STATES
   ============================================================================ */

#generation-log-no-data,
#generation-files-no-data {
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

#generation-log-no-data p,
#generation-files-no-data p {
  margin: 0;
}
