/**
 * Enhanced Frequent Flyers Styles
 * Improved visual hierarchy and accessibility
 * Version: 1.0.0
 * Date: November 13, 2025
 */

/* ============================================================================
   FREQUENT FLYERS TABLE ENHANCEMENTS
   ============================================================================ */

/* Enhanced table row with hover effects */
.frequent-flyer-row {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border-left: 4px solid transparent;
}

.frequent-flyer-row:hover {
  background: linear-gradient(90deg, #f9fafb 0%, white 100%);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  transform: translateX(4px);
}

.frequent-flyer-row--critical {
  border-left-color: #ef4444;
}

.frequent-flyer-row--high {
  border-left-color: #f59e0b;
}

.frequent-flyer-row--medium {
  border-left-color: #fbbf24;
}

/* Student name with emphasis */
.student-name-cell {
  font-weight: 600;
  font-size: 1.05rem;
  color: #111827;
}

/* Pattern cell with visible hierarchy */
.pattern-cell {
  max-width: 300px;
}

.pattern-primary {
  font-weight: 500;
  color: #111827;
  margin-bottom: 0.25rem;
  display: block;
}

.pattern-secondary {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: #6b7280;
}

.pattern-icon {
  font-size: 0.875rem;
}

/* Trend indicator with full context */
.trend-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.875rem;
  border-radius: 1.5rem;
  font-weight: 500;
  font-size: 0.875rem;
  white-space: nowrap;
}

.trend-indicator--worsening {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #dc2626;
  border: 1px solid #fca5a5;
}

.trend-indicator--stable {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #d97706;
  border: 1px solid #fcd34d;
}

.trend-indicator--improving {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #059669;
  border: 1px solid #6ee7b7;
}

.trend-indicator--insufficient {
  background: #f3f4f6;
  color: #6b7280;
  border: 1px solid #e5e7eb;
}

.trend-icon {
  font-size: 1rem;
  line-height: 1;
}

.trend-text {
  font-weight: 600;
}

/* Screen reader only text for accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Action buttons with clear purpose */
.action-buttons {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
}

.action-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  background: white;
  color: #374151;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
  min-width: 44px; /* Touch-friendly */
  min-height: 44px;
}

.action-btn:hover {
  background: #f9fafb;
  border-color: #9ca3af;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.action-btn:active {
  transform: translateY(0);
}

.action-btn--primary {
  background: #0ea5e9;
  border-color: #0ea5e9;
  color: white;
}

.action-btn--primary:hover {
  background: #0284c7;
  border-color: #0284c7;
}

.action-btn--success {
  background: #10b981;
  border-color: #10b981;
  color: white;
}

.action-btn--success:hover {
  background: #059669;
  border-color: #059669;
}

.action-btn--info {
  background: #8b5cf6;
  border-color: #8b5cf6;
  color: white;
}

.action-btn--info:hover {
  background: #7c3aed;
  border-color: #7c3aed;
}

.action-btn__icon {
  font-size: 1rem;
  line-height: 1;
}

.action-btn__text {
  display: none;
}

@media (min-width: 1200px) {
  .action-btn__text {
    display: inline;
  }
  
  .action-btn {
    min-width: auto;
    min-height: auto;
  }
}

.action-btn__badge {
  position: absolute;
  top: -6px;
  right: -6px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  background: #ef4444;
  color: white;
  font-size: 0.625rem;
  font-weight: 700;
  border-radius: 9px;
  border: 2px solid white;
  line-height: 1;
}

.action-btn__badge--critical {
  background: #dc2626;
  animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.9;
  }
}

/* Statistics panel enhancement */
.stats-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, #f9fafb 0%, white 100%);
  border-radius: 0.5rem;
  border: 1px solid #e5e7eb;
}

.stat-card {
  text-align: center;
  padding: 1rem;
}

.stat-card__value {
  font-size: 2rem;
  font-weight: 700;
  color: #111827;
  line-height: 1.2;
}

.stat-card__label {
  font-size: 0.875rem;
  color: #6b7280;
  margin-top: 0.25rem;
}

.stat-card__trend {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
}

.stat-card__trend--up {
  color: #ef4444;
}

.stat-card__trend--down {
  color: #10b981;
}

/* Intervention modal enhancements */
.intervention-modal {
  max-width: 600px;
}

.intervention-item {
  padding: 1rem;
  margin-bottom: 0.75rem;
  border-radius: 0.5rem;
  border-left: 4px solid;
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.intervention-item--critical {
  border-left-color: #dc2626;
  background: #fef2f2;
}

.intervention-item--high {
  border-left-color: #f59e0b;
  background: #fffbeb;
}

.intervention-item--medium {
  border-left-color: #fbbf24;
  background: #fefce8;
}

.intervention-item--low {
  border-left-color: #10b981;
  background: #f0fdf4;
}

.intervention-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.intervention-priority {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.625rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.intervention-priority--critical {
  background: #dc2626;
  color: white;
}

.intervention-priority--high {
  background: #f59e0b;
  color: white;
}

.intervention-priority--medium {
  background: #fbbf24;
  color: #78350f;
}

.intervention-priority--low {
  background: #10b981;
  color: white;
}

.intervention-action {
  font-size: 0.9375rem;
  color: #1f2937;
  line-height: 1.5;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .frequent-flyer-row:hover {
    transform: none;
  }
  
  .trend-indicator {
    padding: 0.25rem 0.625rem;
    font-size: 0.8125rem;
  }
  
  .action-buttons {
    flex-direction: column;
    width: 100%;
  }
  
  .action-btn {
    width: 100%;
    justify-content: center;
  }
  
  .action-btn__text {
    display: inline;
  }
  
  .stats-panel {
    grid-template-columns: 1fr;
  }
}

/* Print styles */
@media print {
  .action-buttons,
  .action-btn {
    display: none !important;
  }
  
  .frequent-flyer-row {
    border-left-width: 2px;
  }
  
  .trend-indicator {
    border: 1px solid #000;
    background: white !important;
    color: #000 !important;
  }
}
