/* Schedule Modern CSS - Enhanced Schedule Table Styling */
/* Pharmacy Scheduler - Schedule Interface Modernization */

/* Vacation Request Styling */
.vacation-item, .modern-vacation-item {
  border-radius: 8px;
  position: relative;
  transition: all 0.2s ease;
  cursor: pointer;
}

/* Status-based background colors */
.vacation-item[data-status="approved"], .modern-vacation-item[data-status="approved"] {
  background: #28a745 !important;
}

.vacation-item[data-status="pending"], .modern-vacation-item[data-status="pending"] {
  background: #ffc107 !important;
}

.vacation-item[data-status="denied"], .modern-vacation-item[data-status="denied"] {
  background: #dc3545 !important;
}

.vacation-item:hover, .modern-vacation-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transform: translateY(-1px);
}

/* Remove ::before border - we're using full background colors now */

/* Vacation icon styling */
.vacation-item .fas.fa-plane, .modern-vacation-item .fas.fa-plane {
  font-size: 12px;
}

/* Partial day vacation styling */
.vacation-item[data-full-day="false"] {
  border-style: dashed;
}

/* Vacation request legend */
.vacation-legend {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 10px;
  font-size: 12px;
}

.vacation-legend-item {
  display: inline-flex;
  align-items: center;
  margin-right: 15px;
  margin-bottom: 5px;
}

.vacation-legend-color {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  margin-right: 5px;
}

/* Schedule Container */
.schedule-container {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: var(--space-6);
}

.schedule-header {
  background: linear-gradient(135deg, var(--gray-50), var(--gray-100));
  border-bottom: 1px solid var(--gray-200);
  padding: var(--space-6);
}

.schedule-header h2 {
  margin: 0;
  color: var(--gray-800);
  font-weight: 600;
  font-size: var(--font-size-xl);
}

/* Schedule Toolbar */
.schedule-toolbar {
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  padding: var(--space-4) var(--space-6);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
  justify-content: space-between;
}

.toolbar-section {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.toolbar-label {
  font-weight: 500;
  color: var(--gray-700);
  font-size: var(--font-size-sm);
  white-space: nowrap;
}

/* Enhanced Button Groups */
.btn-group .btn {
  border-radius: 0;
  border-right-width: 0;
}

.btn-group .btn:first-child {
  border-top-left-radius: var(--radius-lg);
  border-bottom-left-radius: var(--radius-lg);
}

.btn-group .btn:last-child {
  border-top-right-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
  border-right-width: 1px;
}

.btn-group .btn.active {
  background: var(--primary-600);
  border-color: var(--primary-600);
  color: white;
  z-index: 1;
}

/* Schedule Table Container */
.schedule-table-container {
  background: white;
  overflow-x: auto;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* Enhanced Schedule Table */
#schedule-table {
  margin-bottom: 0;
  font-size: var(--font-size-sm);
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}

#schedule-table thead th {
  background: linear-gradient(135deg, var(--gray-50), var(--gray-100));
  border-bottom: 2px solid var(--gray-200);
  font-weight: 600;
  color: var(--gray-800);
  padding: var(--space-4);
  position: sticky;
  top: 0;
  z-index: 10;
  text-align: left;
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-right: 1px solid var(--gray-200);
}

#schedule-table thead th:last-child {
  border-right: none;
}

/* Sortable Headers */
#schedule-table thead th.sortable {
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
}

#schedule-table thead th.sortable:hover {
  background: linear-gradient(135deg, var(--gray-100), var(--gray-200));
  color: var(--primary-600);
}

#schedule-table thead th.sortable::after {
  content: '↕';
  position: absolute;
  right: var(--space-2);
  opacity: 0.5;
  font-size: var(--font-size-xs);
}

#schedule-table thead th.sortable.asc::after {
  content: '↑';
  opacity: 1;
  color: var(--primary-600);
}

#schedule-table thead th.sortable.desc::after {
  content: '↓';
  opacity: 1;
  color: var(--primary-600);
}

/* Table Body Styling */
#schedule-table tbody tr {
  transition: all var(--transition-fast);
  border-bottom: 1px solid var(--gray-100);
}

#schedule-table tbody tr:nth-child(even) {
  background-color: var(--gray-50);
}

#schedule-table tbody tr:hover {
  background-color: var(--primary-50);
  transform: scale(1.005);
  box-shadow: var(--shadow-sm);
  z-index: 1;
  position: relative;
}

#schedule-table tbody td {
  padding: var(--space-3) var(--space-4);
  border-color: var(--gray-200);
  vertical-align: middle;
  border-right: 1px solid var(--gray-100);
  transition: all var(--transition-fast);
}

#schedule-table tbody td:last-child {
  border-right: none;
}

/* Employee Column Styling */
.schedule-employee-col {
  min-width: 180px;
  font-weight: 500;
  color: var(--gray-800);
}

.employee-name {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.employee-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--primary-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: var(--font-size-sm);
  color: var(--primary-700);
  text-transform: uppercase;
}

/* Role Column Styling */
.schedule-role-col {
  min-width: 120px;
}

.role-badge {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid transparent;
  transition: all var(--transition-normal);
}

.role-badge:hover {
  transform: scale(1.05);
}

.role-pharmacist {
  background: linear-gradient(135deg, var(--primary-100), var(--primary-200));
  color: var(--primary-800);
  border-color: var(--primary-300);
}

.role-technician {
  background: linear-gradient(135deg, var(--success-100), var(--success-200));
  color: var(--success-800);
  border-color: var(--success-300);
}

.role-intern {
  background: linear-gradient(135deg, var(--warning-100), var(--warning-200));
  color: var(--warning-800);
  border-color: var(--warning-300);
}

.role-manager {
  background: linear-gradient(135deg, var(--info-100), var(--info-200));
  color: var(--info-800);
  border-color: var(--info-300);
}

/* Period Hours Column */
.schedule-hours-col {
  min-width: 100px;
  text-align: center;
  font-weight: 500;
}

.hours-display {
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-md);
  background: var(--gray-100);
  color: var(--gray-800);
  font-size: var(--font-size-sm);
}

/* Date Column Headers */
.date-header {
  min-width: 120px;
  text-align: center;
}

.date-header .date-day {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--gray-500);
  font-weight: 400;
  text-transform: uppercase;
}

.date-header .date-number {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--gray-800);
}

/* Shift Badge Styling */
.shift-cell {
  min-width: 120px;
  text-align: center;
  padding: var(--space-2) !important;
}

.shift-badge {
  display: inline-block;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-xs);
  font-weight: 500;
  text-align: center;
  min-width: 80px;
  transition: all var(--transition-normal);
  cursor: pointer;
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}

.shift-badge:hover {
  transform: scale(1.05) translateY(-1px);
  box-shadow: var(--shadow-md);
  z-index: 2;
}

.shift-badge:active {
  transform: scale(1.02);
}

/* Location-based Shift Colors */
.shift-main {
  background: linear-gradient(135deg, var(--primary-100), var(--primary-200));
  color: var(--primary-800);
  border-color: var(--primary-300);
}

.shift-main:hover {
  background: linear-gradient(135deg, var(--primary-200), var(--primary-300));
  border-color: var(--primary-400);
}

.shift-satellite {
  background: linear-gradient(135deg, var(--success-100), var(--success-200));
  color: var(--success-800);
  border-color: var(--success-300);
}

.shift-satellite:hover {
  background: linear-gradient(135deg, var(--success-200), var(--success-300));
  border-color: var(--success-400);
}

.shift-clinic {
  background: linear-gradient(135deg, var(--warning-100), var(--warning-200));
  color: var(--warning-800);
  border-color: var(--warning-300);
}

.shift-clinic:hover {
  background: linear-gradient(135deg, var(--warning-200), var(--warning-300));
  border-color: var(--warning-400);
}

.shift-remote {
  background: linear-gradient(135deg, var(--info-100), var(--info-200));
  color: var(--info-800);
  border-color: var(--info-300);
}

.shift-remote:hover {
  background: linear-gradient(135deg, var(--info-200), var(--info-300));
  border-color: var(--info-400);
}

.shift-off {
  background: var(--gray-100);
  color: var(--gray-500);
  border-color: var(--gray-200);
  font-style: italic;
}

.shift-off:hover {
  background: var(--gray-200);
  border-color: var(--gray-300);
}

/* Shift Time Display */
.shift-time {
  display: block;
  font-size: var(--font-size-xs);
  opacity: 0.8;
  margin-top: var(--space-1);
}

/* Enhanced Filters */
.schedule-filters {
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.filter-group:last-child {
  margin-bottom: 0;
}

.filter-label {
  font-weight: 500;
  color: var(--gray-700);
  min-width: 80px;
  font-size: var(--font-size-sm);
}

.filter-input {
  flex: 1;
  max-width: 300px;
}

/* Filter Tags */
.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  background: var(--primary-100);
  color: var(--primary-800);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 500;
  border: 1px solid var(--primary-200);
}

.filter-tag .remove-tag {
  cursor: pointer;
  padding: 0;
  background: none;
  border: none;
  color: var(--primary-600);
  font-size: var(--font-size-sm);
  line-height: 1;
  transition: color var(--transition-fast);
}

.filter-tag .remove-tag:hover {
  color: var(--primary-800);
}

/* Schedule Statistics */
.schedule-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.stat-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  transition: all var(--transition-normal);
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-label {
  font-size: var(--font-size-sm);
  color: var(--gray-500);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-1);
}

.stat-value {
  font-size: var(--font-size-2xl);
  font-weight: 600;
  color: var(--gray-800);
}

.stat-change {
  font-size: var(--font-size-sm);
  margin-top: var(--space-1);
}

.stat-change.positive {
  color: var(--success-600);
}

.stat-change.negative {
  color: var(--danger-600);
}

/* Loading States */
.schedule-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-12);
  color: var(--gray-500);
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--gray-200);
  border-top: 3px solid var(--primary-500);
  border-radius: var(--radius-full);
  animation: spin 1s linear infinite;
  margin-right: var(--space-3);
}

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

/* Empty State */
.schedule-empty {
  text-align: center;
  padding: var(--space-12);
  color: var(--gray-500);
}

.schedule-empty-icon {
  font-size: var(--font-size-4xl);
  margin-bottom: var(--space-4);
  opacity: 0.5;
}

.schedule-empty-title {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: var(--space-2);
}

.schedule-empty-description {
  font-size: var(--font-size-sm);
  color: var(--gray-500);
}

/* Responsive Design */
@media (max-width: 1200px) {
  .schedule-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .toolbar-section {
    justify-content: space-between;
  }
}

@media (max-width: 768px) {
  .schedule-container {
    margin: 0 -1rem;
    border-radius: 0;
  }
  
  .schedule-header {
    padding: var(--space-4);
  }
  
  .schedule-toolbar {
    padding: var(--space-3);
    gap: var(--space-2);
  }
  
  .toolbar-section {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-2);
  }
  
  #schedule-table {
    font-size: var(--font-size-xs);
  }
  
  #schedule-table thead th,
  #schedule-table tbody td {
    padding: var(--space-2);
  }
  
  .shift-badge {
    min-width: 60px;
    font-size: 0.65rem;
    padding: var(--space-1) var(--space-2);
  }
  
  .employee-avatar {
    width: 24px;
    height: 24px;
    font-size: 0.65rem;
  }
  
  .schedule-stats {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-3);
  }
  
  .stat-card {
    padding: var(--space-3);
  }
  
  .stat-value {
    font-size: var(--font-size-xl);
  }
}

@media (max-width: 576px) {
  .schedule-header h2 {
    font-size: var(--font-size-lg);
  }
  
  .schedule-filters {
    margin: 0 -0.5rem var(--space-4);
    border-radius: var(--radius-md);
    padding: var(--space-3);
  }
  
  .filter-group {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-2);
  }
  
  .filter-label {
    min-width: auto;
  }
  
  .filter-input {
    max-width: none;
  }
  
  .schedule-stats {
    grid-template-columns: 1fr;
  }
}

/* Print Styles */
@media print {
  .schedule-toolbar,
  .schedule-filters {
    display: none;
  }
  
  .schedule-container {
    box-shadow: none;
    border: 1px solid var(--gray-300);
  }
  
  #schedule-table {
    font-size: 10px;
  }
  
  .shift-badge {
    background: white !important;
    border: 1px solid var(--gray-400) !important;
    color: var(--gray-800) !important;
  }
}

/* Dark Mode Support (if needed) */
@media (prefers-color-scheme: dark) {
  .schedule-container {
    background: var(--gray-800);
    border-color: var(--gray-700);
  }
  
  .schedule-header {
    background: linear-gradient(135deg, var(--gray-700), var(--gray-800));
    border-color: var(--gray-600);
  }
  
  .schedule-header h2 {
    color: var(--gray-100);
  }
  
  #schedule-table thead th {
    background: linear-gradient(135deg, var(--gray-700), var(--gray-800));
    color: var(--gray-100);
    border-color: var(--gray-600);
  }
  
  #schedule-table tbody tr:nth-child(even) {
    background-color: var(--gray-750);
  }
  
  #schedule-table tbody td {
    color: var(--gray-200);
    border-color: var(--gray-600);
  }
}