/* ===== Attendance Universal Styles ===== */
/* Shared styles used across all attendance pages */

/* ===== Section Headers ===== */
.section-header {
  margin-bottom: 1rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--header-color);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

html.dark-mode .section-title {
  color: #ecf0f1;
}

/* ===== Stats Components ===== */
.stats-section {
  animation: fadeInUp 0.4s ease-out;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

/* Stat card styles are now in components/card.css */

/* Stat icon color variants specific to attendance module */
.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.total-icon {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(37, 99, 235, 0.15));
  color: #3b82f6;
}

.checked-in-icon {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(22, 163, 74, 0.15));
  color: #22c55e;
}

.checked-out-icon {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(217, 119, 6, 0.15));
  color: #f59e0b;
}

.absent-icon {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(220, 38, 38, 0.15));
  color: #ef4444;
}

/* ===== Filters Components ===== */
.filters-section {
  animation: fadeInUp 0.4s ease-out 0.1s backwards;
}

/* Filters card styles are now in components/card.css */

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.filter-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: #475569;
}

html.dark-mode .filter-label {
  color: #cbd5e1;
}

.filter-label i {
  font-size: 0.85rem;
  color: #8bc34a;
}

html.dark-mode .filter-label i {
  color: #8bc34a;
}

/* Search Box */
.search-box {
  position: relative;
  width: 100%;
}

.search-box .search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #546e7a;
  font-size: 1rem;
  pointer-events: none;
}

html.dark-mode .search-box .search-icon {
  color: #95a5a6;
}

.search-box .filter-input {
  padding-left: 2.75rem;
}

.filter-input,
.filter-select {
  width: 100%;
  padding: var(--input-padding-y, 0.75rem) var(--input-padding-x, 1rem);
  min-height: var(--input-height, 44px);
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: 'Sora', system-ui, sans-serif;
  transition: all 0.2s ease;
  background: white;
  color: var(--text-color);
  box-sizing: border-box;
}

.filter-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2394a3b8' d='M1.41 0L6 4.58L10.59 0L12 1.41l-6 6l-6-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.filter-input:hover,
.filter-select:hover {
  background: #f8f9fa;
  box-shadow: 0 3px 8px rgba(0,0,0,0.1);
  border-color: rgba(139, 195, 74, 0.3);
}

.filter-input:focus,
.filter-select:focus {
  outline: none;
  border-color: #8bc34a;
  box-shadow: 0 0 0 2px rgba(139, 195, 74, 0.1), 0 3px 8px rgba(0,0,0,0.12);
}

html.dark-mode .filter-input,
html.dark-mode .filter-select {
  background: #1e1e1e;
  border-color: #3a3a3a;
  color: #e0e0e0;
}

html.dark-mode .filter-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23b0b0b0' d='M1.41 0L6 4.58L10.59 0L12 1.41l-6 6l-6-6z'/%3E%3C/svg%3E");
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

html.dark-mode .filter-input:hover,
html.dark-mode .filter-select:hover {
  background: #2a2a2a;
  box-shadow: 0 3px 8px rgba(0,0,0,0.4);
  border-color: rgba(139, 195, 74, 0.3);
}

html.dark-mode .filter-input:focus,
html.dark-mode .filter-select:focus {
  border-color: #8bc34a;
  box-shadow: 0 0 0 2px rgba(139, 195, 74, 0.2), 0 3px 8px rgba(0,0,0,0.4);
}

.filter-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Button styles are now in components/button.css */

/* ===== Data Sections ===== */
.data-section {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  animation: fadeInUp 0.4s ease-out;
}

html.dark-mode .data-section {
  background: #2a2a2a;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.data-section h4 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--header-color);
  margin: 0 0 1.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

html.dark-mode .data-section h4 {
  color: #ecf0f1;
}

/* ===== Chart Components ===== */
.chart-section {
  animation: fadeInUp 0.4s ease-out 0.2s backwards;
}

.chart-card {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  border: 2px solid rgba(139, 195, 74, 0.1);
}

html.dark-mode .chart-card {
  background: #2a2a2a;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  border-color: rgba(139, 195, 74, 0.2);
}

.chart-container {
  position: relative;
  height: 400px;
  margin-top: 1rem;
}

.chart-container canvas {
  width: 100% !important;
  height: 100% !important;
}

/* ===== Status Components ===== */
.status-section {
  animation: fadeInUp 0.4s ease-out 0.3s backwards;
}

.status-card {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

html.dark-mode .status-card {
  background: #2a2a2a;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: #94a3b8;
}

.loading-state i {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: #8bc34a;
}

html.dark-mode .loading-state i {
  color: #8bc34a;
}

.loading-state p {
  margin: 0;
  font-size: 0.95rem;
}

/* Tables and forms are now in components/table.css and components/form.css */

/* ===== Status Badges ===== */
.status-badge {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.status-in {
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
}

.status-out {
  background: rgba(239, 68, 68, 0.15);
  color: #dc2626;
}

.status-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
}

.status-unknown {
  background: rgba(148, 163, 184, 0.15);
  color: #64748b;
}

html.dark-mode .status-in {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

html.dark-mode .status-out {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

html.dark-mode .status-warning {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

html.dark-mode .status-unknown {
  background: rgba(148, 163, 184, 0.2);
  color: #94a3b8;
}

/* ===== Animations ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Responsive Design ===== */
@media (max-width: 968px) {
  .filters-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
  }
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .filters-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .filter-actions {
    flex-direction: column;
  }

  .action-btn {
    width: 100%;
    justify-content: center;
  }

  .chart-container {
    height: 300px;
  }

  .modern-table {
    font-size: 0.85rem;
  }

  .modern-table thead th,
  .modern-table tbody td {
    padding: 0.75rem 0.5rem;
  }
}

@media (max-width: 480px) {
  .stat-card {
    padding: 1.25rem;
  }

  .stat-icon {
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
  }

  .stat-value {
    font-size: 1.75rem;
  }

  .filters-card,
  .chart-card,
  .status-card,
  .data-section {
    padding: 1.5rem;
  }
}

/* ===== Stats Components (from modern-ui.css) ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Stat card styles are now in components/card.css */

/* ===== Status Indicators (for JS-generated reader status in automatic) ===== */
.status-box {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
}

.status-box.connected {
    background: rgba(39, 174, 96, 0.1);
    border: 1px solid rgba(39, 174, 96, 0.2);
}

.status-box.disconnected {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.2);
}

.status-indicator.connected {
    background: #27ae60;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.3);
}

.status-indicator.disconnected {
    background: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.3);
}

.status-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.status-subtitle {
    font-size: 0.9rem;
    opacity: 0.8;
}

.reader-status {
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #ddd;
    margin-bottom: 1rem;
}

.reader-status.enabled {
    background: rgba(39, 174, 96, 0.05);
    border-color: rgba(39, 174, 96, 0.2);
}

.reader-status.disabled {
    background: rgba(149, 165, 166, 0.05);
    border-color: rgba(149, 165, 166, 0.2);
}
