/* Re-engagement Room Page-Specific Styles */
/* Extracted from inline styles - 2025 */

/* Enhanced loading states */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-2xl);
  text-align: center;
}

.loading-message {
  margin-top: var(--spacing-md);
  color: var(--text-light);
  font-weight: 500;
}

.loading-progress {
  width: 200px;
  height: 4px;
  background: var(--border-light);
  border-radius: 2px;
  margin-top: var(--spacing-md);
  overflow: hidden;
}

.loading-progress-bar {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.3s ease;
}

/* Skeleton Screen Loading States */
.skeleton {
  animation: skeleton-loading 1.5s ease-in-out infinite;
  background: linear-gradient(
    90deg,
    #f0f0f0 0%,
    #e0e0e0 20%,
    #f0f0f0 40%,
    #f0f0f0 100%
  );
  background-size: 200% 100%;
  border-radius: 4px;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-table-row {
  display: grid;
  grid-template-columns: 1fr 2fr 2fr 1fr 1fr;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--border-light);
}

.skeleton-cell {
  height: 20px;
}

.skeleton-cell.large {
  height: 40px;
}

.dark-mode .skeleton {
  background: linear-gradient(
    90deg,
    #2a2a2a 0%,
    #3a3a3a 20%,
    #2a2a2a 40%,
    #2a2a2a 100%
  );
  background-size: 200% 100%;
}

/* Smooth fade-in for loaded content */
.fade-in {
  animation: fadeIn 0.4s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Data loading indicator */
.data-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.6;
}

.data-loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dark-mode .data-loading::after {
  background: rgba(0, 0, 0, 0.6);
}

/* Enhanced form validation */
.field-valid {
  border-color: var(--success) !important;
  box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.15) !important;
  background: rgba(5, 150, 105, 0.02);
  transition: all 0.3s ease;
}

.field-invalid {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.15) !important;
  background: rgba(220, 38, 38, 0.02);
  animation: shake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-8px); }
  20%, 40%, 60%, 80% { transform: translateX(8px); }
}

.field-error {
  color: var(--danger);
  font-size: 0.75rem;
  margin-top: var(--spacing-xs);
  font-weight: 500;
}

/* Screen reader only content */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Follow-up Notes Styles */
.referral-follow-up-section {
  margin-top: 20px;
  padding: 16px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

.follow-up-panel {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
  margin-top: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.follow-up-timeline {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 20px;
  padding-left: 20px;
  border-left: 2px solid #ddd;
}

.timeline-item {
  position: relative;
  padding-bottom: 20px;
}

.timeline-marker {
  position: absolute;
  left: -27px;
  top: 0;
  width: 14px;
  height: 14px;
  background: linear-gradient(135deg, var(--brand-maroon, #660000), var(--brand-accent, #880000));
  border-radius: 50%;
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(102, 0, 0, 0.3), 0 0 0 1px rgba(102, 0, 0, 0.1);
  transition: transform 0.2s ease;
}

.timeline-item:hover .timeline-marker {
  transform: scale(1.2);
}

.timeline-content {
  background: white;
  padding: 12px;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.9em;
}

.timeline-date {
  color: #666;
  font-size: 0.85em;
}

.follow-up-form textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-family: inherit;
  resize: vertical;
  margin-bottom: 12px;
}

.follow-up-actions {
  display: flex;
  gap: 10px;
}

.btn-secondary {
  background: #6c757d;
  color: white;
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9em;
  transition: background-color 0.2s;
}

.btn-secondary:hover {
  background: #5a6268;
}

.btn-primary {
  background: var(--accent);
  color: white;
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9em;
  transition: background-color 0.2s;
}

.btn-primary:hover {
  background: #880000;
}

/* ===== ACTION BUTTONS ===== */
.unified-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  white-space: nowrap;
}

.unified-action-btn-primary {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.unified-action-btn-primary:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
  transform: translateY(-1px);
}

.unified-action-btn-secondary {
  background: rgba(255, 255, 255, 0.9);
  color: #2c3e50;
  border: 1px solid #e0e0e0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.unified-action-btn-secondary:hover {
  background: white;
  border-color: #3b82f6;
  color: #3b82f6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
  transform: translateY(-1px);
}

.unified-action-btn-ghost {
  background: transparent;
  color: #64748b;
  border: none;
  padding: 8px;
  font-size: 18px;
}

.unified-action-btn-ghost:hover {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  transform: scale(1.1);
}

/* Focus indicators for all action buttons */
.unified-action-btn:focus,
.unified-action-btn-primary:focus,
.unified-action-btn-secondary:focus,
.unified-action-btn-ghost:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);
}

/* Mobile responsiveness for follow-up notes */
@media (max-width: 768px) {
  .follow-up-timeline {
    padding-left: 12px;
    border-left-width: 1px;
  }
  
  .timeline-marker {
    left: -18px;
    width: 8px;
    height: 8px;
  }
  
  .timeline-header {
    flex-direction: column;
    gap: 4px;
  }
}

/* Dark mode styles for follow-up notes */
.dark-mode .referral-follow-up-section {
  background: #2a2a2a;
  border-color: #444;
}

.dark-mode .follow-up-panel {
  background: #2a2a2a;
  border-color: #444;
}

.dark-mode .timeline-content {
  background: #333;
  color: #e0e0e0;
}

.dark-mode .follow-up-form textarea {
  background: #333;
  color: #e0e0e0;
  border-color: #555;
}

.dark-mode .btn-secondary {
  background: #495057;
}

.dark-mode .btn-secondary:hover {
  background: #6c757d;
}

/* Teacher Search Styles */
.teacher-search-container {
  position: relative;
}

#teacherSearch {
  width: 100%;
  padding: var(--spacing-md);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  font-size: 1rem;
  background: var(--card);
  color: var(--text);
  transition: border-color 0.15s ease;
}

#teacherSearch:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(102, 0, 0, 0.1);
}

.teacher-dropdown {
  position: fixed !important;
  background: var(--card);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--border-radius) var(--border-radius);
  max-height: 300px;
  overflow-y: auto;
  z-index: 2147483646 !important;
  display: none;
  box-shadow: var(--shadow-lg);
  isolation: isolate;
  min-width: 400px;
}

.teacher-option {
  padding: var(--spacing-md);
  cursor: pointer;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.teacher-option:last-child {
  border-bottom: none;
}

.teacher-option:hover {
  background: var(--border-light);
}

.teacher-option-selected {
  background: var(--accent) !important;
  color: white !important;
}

.teacher-option-selected .teacher-option-details {
  color: rgba(255, 255, 255, 0.8) !important;
}

.teacher-option-name {
  font-weight: 600;
  color: var(--text);
}

.teacher-option-details {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Dark mode adjustments */
.dark-mode .teacher-dropdown {
  border-color: var(--border);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

.dark-mode .teacher-option:hover {
  background: var(--border);
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .teacher-dropdown {
    max-height: 150px;
  }
  
  .teacher-option {
    padding: var(--spacing-sm);
  }
  
  .teacher-option-details {
    font-size: 0.8rem;
  }
  
  .actions-dropdown-content {
    min-width: 180px;
    max-height: 300px;
    border-radius: 6px;
  }
  
  .actions-dropdown-content button {
    padding: 7px 10px;
    font-size: 0.75rem;
    gap: 6px;
  }
}

@media (max-width: 480px) {
  .teacher-dropdown {
    max-height: 120px;
  }
  
  .actions-dropdown-content {
    min-width: 160px;
    max-height: 280px;
    border-radius: 6px;
  }
  
  .actions-dropdown-content button {
    padding: 6px 8px;
    font-size: 0.7rem;
    gap: 5px;
  }
  
  .actions-dropdown-btn {
    padding: 6px 10px;
    font-size: 0.75rem;
  }
}

/* Enhanced modal sizes */
.modal-sm { max-width: 400px; }
.modal-md { max-width: 600px; }
.modal-lg { max-width: 800px; }
.modal-fullscreen { 
  max-width: 95vw; 
  max-height: 95vh; 
  width: 95vw; 
  height: 95vh; 
}

/* Data table enhancements */
.data-table-container {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  overflow: hidden;
}

.data-table-controls {
  padding: var(--spacing-lg);
  background: var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.data-table-search {
  max-width: 300px;
  flex: 1;
  margin-right: var(--spacing-lg);
}

.data-table-count {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
}

.data-table-wrapper {
  overflow-x: auto;
  max-height: 500px;
  overflow-y: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table th {
  background: var(--nav-bg);
  color: white;
  padding: var(--spacing-md);
  text-align: left;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 10;
}

.data-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}

.data-table th.sortable:hover {
  background: #004a73;
}

.sort-indicator {
  margin-left: var(--spacing-xs);
  opacity: 0.5;
}

.data-table td {
  padding: var(--spacing-md);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tr:hover {
  background: var(--border-light);
}

.data-table-pagination {
  padding: var(--spacing-lg);
  background: var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
}

.pagination-info {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
}

/* Skip Links for Accessibility */
.skip-links {
  list-style: none;
  margin: 0;
  padding: 0;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10001; 
}
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  background: var(--accent);
  color: white;
  padding: 10px 18px;
  text-decoration: none;
  border-radius: 0 0 6px 6px;
  font-weight: 600;
  font-size: 0.95em;
  box-shadow: 0 3px 10px rgba(0,0,0,0.3);
  transition: none;
}
.skip-link:focus {
  left: 8px;
  top: 8px;
  width: auto;
  height: auto;
  overflow: visible;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Connection Status */
.connection-status {
  position: fixed;
  bottom: 20px;
  left: 20px;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.8em;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2);
  display: none;
}
.connection-status.online {
  background: linear-gradient(135deg, var(--success), #20c997);
  color: white;
  box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}
.connection-status.offline {
  background: linear-gradient(135deg, var(--danger), #c82333);
  color: white;
  box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}
.connection-status.loading {
  background: linear-gradient(135deg, var(--warning), #e0a800);
  color: #333;
  box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
}
 .dark-mode .connection-status {
  border-color: rgba(0,0,0,0.2);
}
.dark-mode .connection-status.loading {
  color: var(--text);
}

/* Keep unified toast notifications clear of the connection status badge */
body .unified-toast {
  bottom: 80px;
  left: 20px;
}

@media (max-width: 480px) {
  body .unified-toast {
    bottom: 100px;
    left: 10px;
    right: 10px;
  }
}

/* Continue with remaining styles... (file is getting long, splitting for readability) */
