/* Job Search Planning Page Styles */

:root {
  /* Default header and footer heights used for layout calculations.
     Update these values if the actual header/footer dimensions change. */
  --header-height: 70px;
  --footer-height: 80px;
}

/* Create a flex container for the job search planning page */
.job-search-planning-page {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-height) - var(--footer-height));
}

/* Success message styling */
.job-search-success-message {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
  border-radius: 0.375rem;
  padding: 1rem 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  max-width: 90%;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.job-search-success-message.fade-out {
  animation: fadeOut 0.5s ease-out forwards;
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* Sticky filter control */
.sticky-filter-control {
  position: sticky;
  top: 0;
  background: white;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.sticky-filter-control > div {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.sticky-filter-control .filter-label {
  font-weight: 500;
  margin-right: 1rem;
}

.filter-form {
  display: flex;
  gap: 1rem;
}

.filter-form label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

/* Action Details Section */
#action-details-section {
  display: none;
  margin-bottom: 2rem;
}

#action-details-section.visible {
  display: block;
  max-height: 50vh;
  overflow-y: auto;
  flex-shrink: 0;
}

#action-details-section h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #333;
  margin-top: 0;
}

.action-details-form {
  background: #f9f9f9;
  padding: 1.5rem;
  border-radius: 0.375rem;
  border: 1px solid var(--border);
}

/* Table container and scrolling */
.table-container {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* Turbo frame should participate in flexbox */
turbo-frame {
  display: contents;
}

/* Page-level structure for job search planning */
.job-search-planning-page > .page-header-actions {
  flex-shrink: 0;
}

.job-search-planning-page > #action-details-section {
  flex-shrink: 0;
}

.job-search-planning-page > .sticky-filter-control {
  flex-shrink: 0;
}

.job-search-planning-page > .table-content-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.table-wrapper {
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Fixed table header */
.table-header {
  width: 100%;
  background-color: #f5f5f5;
  border-bottom: 2px solid #ddd;
  flex-shrink: 0;
  display: block;
  padding-right: 8px;
}

.table-header-row {
  display: grid;
  grid-template-columns: 15% 12% 13% 13% 10% 10% 27%;
  width: calc(100% - 8px);
  gap: 0;
}

.table-header-cell {
  box-sizing: border-box;
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-header-cell.actions {
  text-align: center;
}

/* Sortable header styling */
.table-header-cell.sortable-header {
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s ease;
  padding: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  color: inherit;
}

.table-header-cell.sortable-header:hover {
  background-color: #e8e8e8;
}

/* Sort indicator styling */
.sort-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  order: -1;
  transition: opacity 0.2s ease;
  font-size: 0.65rem;
  line-height: 1;
}

/* Show indicator on sorted columns */
.table-header-cell.sortable-header.sorted-asc .sort-indicator {
  opacity: 1;
  color: #2563eb;
}

.table-header-cell.sortable-header.sorted-asc .sort-indicator::before {
  content: '▲';
}

.table-header-cell.sortable-header.sorted-desc .sort-indicator {
  opacity: 1;
  color: #2563eb;
}

.table-header-cell.sortable-header.sorted-desc .sort-indicator::before {
  content: '▼';
}

/* Light indicator for non-sorted columns */
.table-header-cell.sortable-header:not(.sorted-asc):not(.sorted-desc) .sort-indicator {
  opacity: 0.3;
  color: #999;
}

.table-header-cell.sortable-header:not(.sorted-asc):not(.sorted-desc) .sort-indicator::before {
  content: '↕';
}

/* Scrollable table body */
.table-body {
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
}

.table-row {
  display: grid;
  grid-template-columns: 15% 12% 13% 13% 10% 10% 27%;
  width: 100%;
  gap: 0;
  border-bottom: 1px solid #eee;
  transition: background-color 0.2s ease;
}

.table-row:hover {
  background-color: #fafafa;
}

.table-cell {
  box-sizing: border-box;
  padding: 0.75rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
}

.table-cell.outcome {
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  align-items: flex-start;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.table-cell.actions {
  text-align: center;
  justify-content: center;
  display: flex;
  gap: 0.5rem;
  overflow: visible;
  white-space: normal;
}

/* Status badge styling */
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 0.25rem;
  font-weight: 500;
  white-space: nowrap;
}

.status-badge.done {
  background-color: #d4edda;
  color: #155724;
}

.status-badge.pending {
  background-color: #fff3cd;
  color: #856404;
}

/* Response indicator */
.response-yes {
  color: #28a745;
  font-weight: 500;
}

.response-no {
  color: #999;
}

/* Empty state */
.table-empty-state {
  padding: 2rem;
  text-align: center;
  color: #999;
}

.table-empty-state p {
  margin: 0 0 1rem 0;
}

/* Muted text for missing values */
.text-muted-placeholder {
  color: #999;
}

/* Table content wrapper for flexbox layout */
.table-content-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* Multi-actions input table */
.multi-actions-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  overflow: hidden;
  background: white;
}

.multi-actions-table thead {
  background-color: #f5f5f5;
  border-bottom: 2px solid #ddd;
}

.multi-actions-table th {
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid #ddd;
}

.multi-actions-table tr {
  border-bottom: 1px solid #eee;
  transition: background-color 0.2s ease;
}

.multi-actions-table tbody tr:hover {
  background-color: #fafafa;
}

.multi-actions-table td {
  padding: 0.75rem;
  box-sizing: border-box;
}

.multi-actions-table input:not([type="radio"]),
.multi-actions-table select {
  width: 100%;
  min-width: 0;
}

.multi-actions-table .action-types-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.multi-actions-table .action-types-container label {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  white-space: nowrap;
  font-size: 0.875rem;
}

.btn-remove-row {
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 0.25rem;
  width: 2rem;
  height: 2rem;
  padding: 0;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

.btn-remove-row:hover {
  background-color: #c82333;
}

.form-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.form-actions button,
.form-actions a {
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

/* Form options layout - for radio buttons, checkboxes, and similar grouped options */
.form-options-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Individual form option label - aligns radio/checkbox with text */
.form-option-label {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Form section divider with spacing */
.we-form-divider {
  margin-top: 2rem;
}
