/* ==============================================
   routes.css - Route Modal, Folder Nav, Breadcrumb, Editor Stops
   ============================================== */

/* Route Modal Styles */
.route-stops-container {
  max-height: 400px;
  overflow-y: auto;
  padding-right: 8px;
}

.route-stops-container::-webkit-scrollbar {
  width: 6px;
}

.route-stops-container::-webkit-scrollbar-track {
  background: var(--bg);
  border-radius: 3px;
}

.route-stops-container::-webkit-scrollbar-thumb {
  background: var(--stroke);
  border-radius: 3px;
}

.route-stops-container::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

.stop-row {
  transition: all 0.2s ease;
  position: relative;
}

.stop-row:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stop-connector {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 20px;
  background: linear-gradient(180deg, var(--stroke) 0%, transparent 100%);
}

/* Subgroup collapse visibility - controlled via class, not inline styles */
.subgroup-content {
  display: none !important;
  overflow: hidden;
}

.subgroup-content.show {
  display: block !important;
}

/* Route group pagination */
.group-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  margin: 0;
  border-top: 1px solid var(--stroke);
  background: rgba(100, 116, 139, 0.03);
  font-size: 0.8rem;
}

.group-pagination .btn-sm {
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  min-width: 32px;
}

.group-pagination .pagination-info {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

/* Folder Navigation Styles (Windows Explorer style) */
.folder-navigation {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--card);
}

.folder-card,
.folder-tile {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.folder-card:hover,
.folder-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
}

.folder-card:hover .folder-action {
  opacity: 1 !important;
}

.route-tile {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.route-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08) !important;
}

/* Breadcrumb styling */
.breadcrumb-item + .breadcrumb-item::before {
  content: "›";
  color: var(--muted);
  font-size: 1.1rem;
  padding: 0 0.5rem;
}

.breadcrumb-link:hover {
  color: var(--primary) !important;
}

/* Empty folder indicator */
.folder-empty {
  opacity: 0.6;
  filter: grayscale(30%);
}

/* Dark mode adjustments */
:root[data-theme="dark"] .folder-card:hover,
:root[data-theme="dark"] .folder-tile:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3) !important;
}

:root[data-theme="dark"] .route-tile:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25) !important;
}

/* Route Editor - Stops Table Styles */
#stopsTable {
  font-size: 0.9rem;
}

#stopsTable thead th {
  background-color: var(--bg);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--stroke);
  padding: 0.75rem 0.5rem;
}

#stopsTable tbody tr.stop-row {
  transition: background-color 0.15s ease;
}

#stopsTable tbody tr.stop-row:hover {
  background-color: rgba(37, 99, 235, 0.05);
}

#stopsTable tbody tr.stop-row.dragging {
  opacity: 0.5;
}

#stopsTable tbody td {
  padding: 0.5rem;
  vertical-align: middle;
}

/* Inactive stop row styling */
#stopsTable tbody tr.stop-row.table-secondary {
  background-color: rgba(108, 117, 125, 0.08);
  opacity: 0.65;
}

#stopsTable tbody tr.stop-row.table-secondary:hover {
  background-color: rgba(108, 117, 125, 0.12);
}

#stopsTable tbody tr.stop-row.table-secondary .stop-number {
  opacity: 0.7;
}

/* Dark theme inactive stop row */
:root[data-theme="dark"] #stopsTable tbody tr.stop-row.table-secondary {
  background-color: rgba(156, 163, 175, 0.08);
  opacity: 0.6;
}

:root[data-theme="dark"] #stopsTable tbody tr.stop-row.table-secondary:hover {
  background-color: rgba(156, 163, 175, 0.15);
}

/* Compact time inputs in table */
.time-input-sm {
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  text-align: center;
  letter-spacing: 0.05em;
}

/* Drag handle styling */
#stopsTable .bi-grip-vertical {
  font-size: 1.2rem;
  opacity: 0.4;
  transition: opacity 0.2s ease;
}

#stopsTable tr:hover .bi-grip-vertical {
  opacity: 0.8;
}

/* Route Groups */
.group-chevron {
  transition: transform 0.2s ease;
}

/* Dark theme group badge fixes */
:root[data-theme="dark"] .badge.bg-light.text-dark {
  background-color: rgba(255, 255, 255, 0.15) !important;
  color: var(--text) !important;
}

/* Day selection buttons */
.day-button:hover {
  background: rgba(79, 70, 229, 0.05) !important;
  border-color: rgba(79, 70, 229, 0.2) !important;
}

:root[data-theme="dark"] .day-button:hover {
  background: rgba(99, 102, 241, 0.1) !important;
  border-color: rgba(99, 102, 241, 0.3) !important;
}

/* Route sections row - force side-by-side layout using Grid */
.route-sections-row {
  display: grid !important;
  grid-template-columns: 35% 65% !important;
  gap: 1rem !important;
  width: 100% !important;
}

.route-section-left,
.route-section-right {
  min-width: 0 !important;
  width: 100% !important;
}

/* Day schedule cards - Compact List */
.day-schedule-card {
  transition: all 0.2s ease;
}

.day-schedule-card:hover {
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15) !important;
  border-color: #6366f1 !important;
}

:root[data-theme="dark"] .day-schedule-card:hover {
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.25) !important;
}

.day-schedule-card .time-input {
  transition: all 0.15s ease;
}

.day-schedule-card .time-input:not(:disabled):hover {
  background: rgba(99, 102, 241, 0.05) !important;
}

.day-schedule-card .time-input:not(:disabled):focus {
  background: rgba(99, 102, 241, 0.08) !important;
  outline: 2px solid rgba(99, 102, 241, 0.3);
  outline-offset: 0;
}

.day-schedule-card .time-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.day-card-clickable {
  cursor: pointer;
  user-select: none;
}

/* Pulse animation for active indicator */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Day schedule checkboxes - checked state */
.day-checkbox:checked {
  background-color: #6366f1 !important;
  border-color: #6366f1 !important;
}

.day-checkbox:focus {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.25) !important;
}

/* Time inputs in day schedules */
.day-schedule-row .time-input:focus {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.15) !important;
}

.day-schedule-row .time-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--bg) !important;
}

/* Departure time inputs - enhanced green theme */
.day-schedule-row .departure-time-input:not(:disabled):hover {
  border-color: rgba(16, 185, 129, 0.4) !important;
  box-shadow: 0 0 0 0.15rem rgba(16, 185, 129, 0.1) !important;
}

.day-schedule-row .departure-time-input:not(:disabled):focus {
  border-color: rgba(16, 185, 129, 0.6) !important;
  box-shadow: 0 0 0 0.2rem rgba(16, 185, 129, 0.15) !important;
}

/* Deadline time inputs - enhanced yellow theme */
.day-schedule-row .deadline-time-input:not(:disabled):hover {
  border-color: rgba(245, 158, 11, 0.4) !important;
  box-shadow: 0 0 0 0.15rem rgba(245, 158, 11, 0.1) !important;
}

.day-schedule-row .deadline-time-input:not(:disabled):focus {
  border-color: rgba(245, 158, 11, 0.6) !important;
  box-shadow: 0 0 0 0.2rem rgba(245, 158, 11, 0.15) !important;
}

/* Day schedules container */
.day-schedules-container {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

:root[data-theme="dark"] .day-schedules-container {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Quick actions buttons hover states */
#toggleAllDays:hover,
#copyScheduleBtn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

:root[data-theme="dark"] #toggleAllDays:hover,
:root[data-theme="dark"] #copyScheduleBtn:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Glass effect for route config cards */
.glass {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

:root[data-theme="light"] .glass {
  background: rgba(255, 255, 255, 0.7) !important;
}

:root[data-theme="dark"] .glass {
  background: rgba(255, 255, 255, 0.02) !important;
}
