/* Resume Parse Event Detail Page */

.parse-event-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.event-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  gap: 1rem;
}

.event-header h1 {
  margin: 0;
  font-size: 2rem;
}

.btn-secondary-link {
  color: var(--muted, #6b7280);
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 1rem;
}

.btn-secondary-link:hover {
  color: var(--text, #0f172a);
}

.event-card {
  background: white;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.file-info-card .card-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.file-icon-large {
  font-size: 2.5rem;
  flex-shrink: 0;
}

.file-info {
  flex: 1;
}

.file-info .file-name {
  margin: 0 0 0.75rem 0;
  font-size: 1.5rem;
  word-break: break-word;
}

.file-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 0;
  color: var(--muted, #6b7280);
  font-size: 0.95rem;
}

.meta-item {
  display: flex;
  gap: 0.5rem;
}

.status-badge-large {
  flex-shrink: 0;
}

.success-message {
  display: flex;
  gap: 1rem;
  background-color: #ecfdf5;
  border: 1px solid #d1fae5;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  align-items: flex-start;
}

.success-icon {
  color: #10b981;
  flex-shrink: 0;
  margin-top: 0.25rem;
}

.success-text h3 {
  margin: 0 0 0.5rem 0;
  color: #10b981;
}

.success-text p {
  margin: 0;
  color: var(--text, #0f172a);
}

.summary-section {
  background: white;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 2rem;
}

.summary-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 1.5rem 0;
  color: var(--text, #0f172a);
}

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

.summary-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background-color: var(--bg-secondary, #f9fafb);
  border-radius: 8px;
  border: 1px solid var(--border, #e5e7eb);
}

.summary-icon {
  font-size: 2rem;
}

.summary-stat {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text, #0f172a);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--muted, #6b7280);
}

.extracted-section {
  margin-bottom: 1.5rem;
}

.collapsible-section {
  background: white;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  overflow: hidden;
}

.collapsible-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background-color: var(--bg-secondary, #f9fafb);
  border-bottom: 1px solid var(--border, #e5e7eb);
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s;
}

.collapsible-header:hover {
  background-color: #f3f4f6;
}

.collapsible-icon {
  font-size: 0.8rem;
  color: var(--muted, #6b7280);
  transition: transform 0.2s;
  display: inline-block;
}

details[open] > summary .collapsible-icon {
  transform: rotate(180deg);
}

.collapsible-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text, #0f172a);
}

.collapsible-content {
  padding: 1.5rem;
}

.records-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.record-item {
  padding: 1rem;
  background-color: var(--bg-secondary, #f9fafb);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
}

.record-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.record-title h4 {
  margin: 0 0 0.25rem 0;
  font-size: 1.1rem;
  color: var(--text, #0f172a);
}

.record-company,
.record-field,
.record-publication,
.record-number {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted, #6b7280);
}

.date-badge {
  display: inline-block;
  background-color: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  font-size: 0.85rem;
  white-space: nowrap;
}

.record-description {
  margin: 0.75rem 0;
  color: var(--text, #0f172a);
  font-size: 0.95rem;
  line-height: 1.5;
}

.record-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-action {
  padding: 0.5rem 1rem;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-action-edit {
  color: #3b82f6;
  background-color: rgba(59, 130, 246, 0.1);
}

.btn-action-edit:hover {
  background-color: rgba(59, 130, 246, 0.2);
}

.btn-action-delete {
  color: #ef4444;
  background-color: rgba(239, 68, 68, 0.1);
}

.btn-action-delete:hover {
  background-color: rgba(239, 68, 68, 0.2);
}

.event-pending-section {
  text-align: center;
  padding: 4rem 2rem;
}

.pending-message {
  margin-bottom: 2rem;
}

.spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid rgba(59, 130, 246, 0.1);
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.pending-message h3 {
  font-size: 1.5rem;
  margin: 1rem 0 0.5rem 0;
}

.pending-message p {
  color: var(--muted, #6b7280);
  margin: 0.5rem 0;
}

.pending-instruction {
  font-weight: 500;
  color: var(--text, #0f172a);
}

.pending-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.event-failed-section {
  padding: 2rem;
}

.error-message {
  display: flex;
  gap: 1rem;
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  align-items: flex-start;
}

.error-icon {
  color: #ef4444;
  flex-shrink: 0;
  margin-top: 0.25rem;
}

.error-text h3 {
  margin: 0 0 0.75rem 0;
  color: #ef4444;
}

.error-details,
.error-explanation {
  margin: 0.5rem 0;
  color: var(--text, #0f172a);
  line-height: 1.6;
}

.failed-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-actions {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border, #e5e7eb);
  margin-top: 2rem;
}

.link-secondary {
  color: var(--primary, #007bff);
  text-decoration: none;
  font-weight: 500;
}

.link-secondary:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .parse-event-container {
    padding: 1rem 0.5rem;
  }

  .event-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .file-info-card .card-header {
    flex-direction: column;
  }

  .file-meta {
    flex-direction: column;
    gap: 0.5rem;
  }

  .summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
  }

  .summary-card {
    padding: 0.75rem;
  }

  .summary-icon {
    font-size: 1.5rem;
  }

  .record-header {
    flex-direction: column;
  }

  .record-actions {
    gap: 0.35rem;
  }

  .btn-action {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
  }

  .pending-actions,
  .failed-actions {
    flex-direction: column;
  }

  .pending-actions .btn,
  .failed-actions .btn {
    width: 100%;
  }
}
