/* timeline.css - Visa Timeline Page Styles */

/* Page layout */
body {
  background: #f5f5f5;
}

.timeline-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.page-header {
  margin: 0 0 30px;
  padding: 30px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.page-header h1 {
  margin: 0 0 10px 0;
  font-size: 2rem;
}

.page-header p {
  margin: 0;
  opacity: 0.9;
  font-size: 1rem;
}

/* Filter section */
.timeline-filters {
  max-width: 1400px;
  margin: 0 auto 20px;
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.filters-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 12px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.filter-group label {
  font-size: 0.85rem;
  font-weight: bold;
  color: #555;
}

.timeline-filters select {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.9rem;
  min-width: 150px;
  background: white;
}

.timeline-filters button {
  padding: 8px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  font-size: 0.9rem;
  transition: all 0.2s;
}

#apply-filters {
  background: #667eea;
  color: white;
}

#apply-filters:hover {
  background: #5568d3;
}

#reset-filters {
  background: #e0e0e0;
  color: #333;
}

#reset-filters:hover {
  background: #d0d0d0;
}

/* Results section */
.timeline-results-container {
  max-width: 1400px;
  margin: 0 auto;
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#result-count {
  margin: 0 0 15px 0;
  font-size: 1.1rem;
  font-weight: bold;
  color: #667eea;
}

#loading {
  text-align: center;
  padding: 40px;
  font-size: 1.1rem;
  color: #666;
}

/* Table styling */
.table-wrapper {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

.timeline-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  background: white;
  min-width: 1200px;
}

.timeline-table thead {
  background: #0C2340;
  color: white;
  position: sticky;
  top: 0;
  z-index: 10;
}

.timeline-table th {
  padding: 12px 8px;
  text-align: left;
  font-weight: bold;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  border-right: 1px solid rgba(255,255,255,0.1);
  background: #7d90a2;
}

.timeline-table th:last-child {
  border-right: none;
}

.timeline-table th:hover {
  background: #1a3a5f;
}

.timeline-table th.sorted-asc::after {
  content: " ▲";
  font-size: 0.7rem;
}

.timeline-table th.sorted-desc::after {
  content: " ▼";
  font-size: 0.7rem;
}

.timeline-table tbody tr {
  border-bottom: 1px solid #e0e0e0;
  transition: background 0.15s;
}

.timeline-table tbody tr:hover {
  background: #f9f9f9;
}

.timeline-table tbody tr:nth-child(even) {
  background: #fafafa;
}

.timeline-table tbody tr:nth-child(even):hover {
  background: #f5f5f5;
}

.timeline-table td {
  padding: 10px 8px;
  white-space: nowrap;
  border-right: 1px solid #f0f0f0;
}

.timeline-table td:last-child {
  border-right: none;
}

/* Special column styling */
.row-number {
  text-align: center;
  font-weight: bold;
  color: #999;
  background: #fafafa;
}

.total-days {
  font-weight: bold;
  color: #667eea;
}

.date-cell {
  color: #555;
}

.empty-cell {
  color: #ccc;
  text-align: center;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .page-header h1 {
    font-size: 1.5rem;
  }

  .page-header p {
    font-size: 0.9rem;
  }

  .filters-row {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group {
    width: 100%;
  }

  .timeline-filters select,
  .timeline-filters button {
    width: 100%;
  }

  .timeline-table {
    font-size: 0.75rem;
  }

  .timeline-table th,
  .timeline-table td {
    padding: 6px 4px;
  }
}

/* Loading spinner */
.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #667eea;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Comment section styling */
.comment {
  margin-left: 0;
  padding-left: 10px;
  border-left: 2px solid #e0e0e0;
}

.comment .comment {
  margin-left: 20px;
  margin-top: 10px;
}

.comment form {
  margin-top: 20px;
}

.comment button {
  padding: 4px 10px;
  font-size: 0.85rem;
  border: 1px solid #ddd;
  background: white;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.comment button:hover {
  background: #f5f5f5;
}

.comment textarea {
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: inherit;
}

.comment input[type="text"] {
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  width: 100%;
  max-width: 200px;
  font-size: 0.9rem;
}
