/* Dock Scheduling Specific Styles */

/* Stats Grid - Professional Black & White */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: var(--spacing-lg);
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--bg-secondary);
  border-radius: 8px;
  flex-shrink: 0;
}

.stat-icon svg {
  width: 24px;
  height: 24px;
  color: var(--text-primary);
}

.stat-content {
  flex: 1;
  min-width: 0;
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.stat-change {
  font-size: 13px;
  margin-top: 4px;
}

.stat-change.positive {
  color: #10b981;
}

.stat-change.negative {
  color: #ef4444;
}

/* Dock Timeline */
.timeline-container {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
  overflow-x: auto;
}

.timeline-header-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-md);
  border-bottom: 1px solid var(--border-color);
}

.timeline-header-section h2 {
  margin: 0;
  font-size: 18px;
}

.date-navigation {
  display: flex;
  align-items: center;
  gap: 12px;
}

.date-navigation button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.date-navigation button:hover {
  background: var(--bg-secondary);
  border-color: var(--text-secondary);
}

.current-date {
  font-weight: 600;
  font-size: 14px;
  min-width: 120px;
  text-align: center;
}

.timeline-grid {
  min-width: 900px;
}

.timeline-header {
  display: grid;
  grid-template-columns: 100px repeat(14, 1fr);
  border-bottom: 2px solid var(--border-color);
}

.timeline-label {
  padding: 12px;
  font-weight: 600;
  font-size: 13px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
}

.timeline-hour {
  padding: 12px 8px;
  font-size: 12px;
  text-align: center;
  font-weight: 500;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
}

.timeline-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  border-bottom: 1px solid var(--border-color);
  min-height: 60px;
}

.timeline-slots {
  position: relative;
  display: grid;
  grid-template-columns: repeat(14, 1fr);
}

.timeline-slots::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: repeating-linear-gradient(
    to right,
    var(--border-color) 0,
    var(--border-color) 1px,
    transparent 1px,
    transparent calc(100% / 14)
  );
  pointer-events: none;
}

.timeline-appointment {
  position: absolute;
  top: 8px;
  bottom: 8px;
  padding: 8px 12px;
  background: white;
  border: 2px solid var(--text-primary);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 1;
  overflow: hidden;
}

.timeline-appointment:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
  z-index: 2;
}

.timeline-appointment.scheduled {
  border-color: #3b82f6;
  background: #eff6ff;
}

.timeline-appointment.in-progress {
  border-color: #10b981;
  background: #f0fdf4;
}

.timeline-appointment.completed {
  border-color: #6b7280;
  background: #f9fafb;
  opacity: 0.7;
}

.timeline-appointment.cancelled {
  border-color: #ef4444;
  background: #fef2f2;
  opacity: 0.6;
  text-decoration: line-through;
}

.appointment-carrier {
  font-weight: 600;
  font-size: 12px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.appointment-time {
  font-size: 11px;
  color: var(--text-secondary);
}

/* Appointments Table */
.appointments-section {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: var(--spacing-lg);
  overflow-x: auto;
}

.appointments-section h2 {
  margin: 0 0 var(--spacing-lg);
  font-size: 18px;
}

.table-filters {
  display: flex;
  gap: 12px;
  margin-bottom: var(--spacing-lg);
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-group label {
  font-size: 13px;
  font-weight: 500;
}

.filter-group select {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 13px;
  background: white;
  cursor: pointer;
}

.appointments-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.appointments-table th {
  text-align: left;
  padding: 12px;
  background: var(--bg-secondary);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border-color);
}

.appointments-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
}

.appointments-table tr:last-child td {
  border-bottom: none;
}

.appointments-table tbody tr:hover {
  background: var(--bg-secondary);
}

/* Detail Grid for Modal */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-label {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.detail-value {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 600;
}

/* Modal Form Improvements */
.modal .form-group {
  margin-bottom: 20px;
}

.modal .form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 13px;
  color: var(--text-primary);
}

.modal .form-label.required::after {
  content: ' *';
  color: #ef4444;
}

.modal .form-control {
  width: 100%;
  height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s;
}

.modal .form-control:focus {
  outline: none;
  border-color: var(--text-primary);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.modal textarea.form-control {
  height: auto;
  min-height: 80px;
  resize: vertical;
}

.modal select.form-control {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23374151' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  padding-right: 36px;
  appearance: none;
}

.modal .form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
  
  .stat-card {
    padding: var(--spacing-md);
  }
  
  .stat-value {
    font-size: 24px;
  }
  
  .timeline-container {
    padding: var(--spacing-md);
  }
  
  .timeline-header-section {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  
  .appointments-section {
    padding: var(--spacing-md);
  }
  
  .modal .form-row {
    grid-template-columns: 1fr;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .stat-card,
  .timeline-container,
  .appointments-section {
    background: var(--bg-secondary);
    border-color: #374151;
  }
  
  .stat-icon {
    background: #1f2937;
  }
  
  .timeline-label,
  .timeline-hour,
  .appointments-table th {
    background: #1f2937;
  }
  
  .timeline-appointment {
    background: var(--bg-secondary);
  }
  
  .timeline-appointment.scheduled {
    background: #1e3a5f;
  }
  
  .timeline-appointment.in-progress {
    background: #064e3b;
  }
  
  .timeline-appointment.completed {
    background: #1f2937;
  }
  
  .timeline-appointment.cancelled {
    background: #450a0a;
  }
  
  .modal .form-control {
    background: var(--bg-secondary);
    border-color: #374151;
    color: var(--text-primary);
  }
  
  .modal select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23d1d5db' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  }
  
  .date-navigation button {
    background: var(--bg-secondary);
    border-color: #374151;
  }
  
  .filter-group select {
    background: var(--bg-secondary);
    border-color: #374151;
    color: var(--text-primary);
  }
}
