* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  padding: 1rem 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.title {
  color: white;
  font-size: 2rem;
  font-weight: 700;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.back-button {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 25px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  font-weight: 500;
}

.back-button:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 2rem;
}

/* Attendance Controls */
.attendance-controls {
  background: white;
  border-radius: 15px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  display: flex;
  gap: 1rem;
  align-items: end;
  flex-wrap: wrap;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 200px;
}

.control-group label {
  font-weight: 500;
  color: #333;
}

.control-group select,
.control-group input {
  padding: 10px;
  border: 2px solid #f0f0f0;
  border-radius: 10px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.control-group select:focus,
.control-group input:focus {
  outline: none;
  border-color: #2196f3;
}

.btn-primary {
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
  color: white;
  height: fit-content;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(33, 150, 243, 0.3);
}

/* Attendance Session */
.attendance-session {
  background: white;
  border-radius: 15px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.session-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #f0f0f0;
}

.session-header h3 {
  color: #333;
  font-size: 1.3rem;
}

.session-info {
  color: #666;
  font-size: 0.9rem;
}

/* Quick Actions */
.quick-actions {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.btn-success,
.btn-danger {
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.btn-success {
  background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
  color: white;
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(76, 175, 80, 0.3);
}

.btn-danger {
  background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
  color: white;
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(244, 67, 54, 0.3);
}

/* Students Attendance List */
.students-attendance-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.student-attendance-card {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
  border-left: 4px solid #e0e0e0;
}

.student-attendance-card.present {
  border-left-color: #4caf50;
  background: #e8f5e8;
}

.student-attendance-card.absent {
  border-left-color: #f44336;
  background: #ffebee;
}

.student-attendance-card.late {
  border-left-color: #ff9800;
  background: #fff3e0;
}

.student-attendance-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.student-attendance-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.student-avatar {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
}

.student-attendance-info strong {
  color: #333;
}

.attendance-buttons {
  display: flex;
  gap: 0.5rem;
}

.attendance-btn {
  width: 35px;
  height: 35px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-size: 0.8rem;
}

.attendance-btn.present {
  background: #4caf50;
  color: white;
}

.attendance-btn.absent {
  background: #f44336;
  color: white;
}

.attendance-btn.late {
  background: #ff9800;
  color: white;
}

.attendance-btn:not(.active) {
  background: #e0e0e0;
  color: #666;
}

.attendance-btn:hover {
  transform: scale(1.1);
}

/* Attendance History */
.attendance-history {
  background: white;
  border-radius: 15px;
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.attendance-history h3 {
  color: #333;
  margin-bottom: 1.5rem;
}

.history-filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.history-filters select,
.history-filters input {
  padding: 8px 12px;
  border: 2px solid #f0f0f0;
  border-radius: 8px;
  font-size: 0.9rem;
  transition: border-color 0.3s ease;
}

.history-filters select:focus,
.history-filters input:focus {
  outline: none;
  border-color: #2196f3;
}

.btn-secondary {
  padding: 8px 16px;
  border: 2px solid #2196f3;
  background: white;
  color: #2196f3;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.btn-secondary:hover {
  background: #2196f3;
  color: white;
}

/* History Table */
.history-table-container {
  overflow-x: auto;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.history-table th,
.history-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid #f0f0f0;
}

.history-table th {
  background: #f8f9fa;
  font-weight: 600;
  color: #333;
  position: sticky;
  top: 0;
}

.history-table tr:hover {
  background: #f8f9fa;
}

.attendance-rate {
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 500;
  font-size: 0.9rem;
}

.attendance-rate.good {
  background: #e8f5e8;
  color: #4caf50;
}

.attendance-rate.warning {
  background: #fff3e0;
  color: #ff9800;
}

.attendance-rate.danger {
  background: #ffebee;
  color: #f44336;
}

.btn-small {
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  background: #e3f2fd;
  color: #2196f3;
  transition: all 0.3s ease;
  margin-right: 0.5rem;
}

.btn-small:hover {
  background: #2196f3;
  color: white;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: white;
  border-radius: 20px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal.large {
  max-width: 800px;
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1.2rem;
  color: #333;
}

.close-modal {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #666;
}

.modal-body {
  padding: 1.5rem;
}

/* Attendance Detail */
.attendance-detail {
  max-width: 100%;
}

.detail-header {
  text-align: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #f0f0f0;
}

.detail-header h4 {
  color: #333;
  margin-bottom: 0.5rem;
}

.detail-header p {
  color: #666;
}

.attendance-summary {
  display: flex;
  justify-content: space-around;
  margin-bottom: 1.5rem;
  background: #f8f9fa;
  border-radius: 10px;
  padding: 1rem;
}

.summary-item {
  text-align: center;
}

.summary-number {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: #2196f3;
}

.summary-label {
  color: #666;
  font-size: 0.9rem;
}

.students-detail-list {
  max-height: 300px;
  overflow-y: auto;
}

.student-attendance-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.student-attendance-item .student-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.status {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.status.present {
  background: #e8f5e8;
  color: #4caf50;
}

.status.absent {
  background: #ffebee;
  color: #f44336;
}

.status.late {
  background: #fff3e0;
  color: #ff9800;
}

.modal-footer {
  padding: 1.5rem;
  border-top: 1px solid #f0f0f0;
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

/* Responsive */
@media (max-width: 768px) {
  .main-content {
    padding: 1rem;
  }

  .header {
    padding: 1rem;
  }

  .header-content {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .title {
    font-size: 1.5rem;
  }

  .attendance-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .control-group {
    min-width: auto;
  }

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

  .students-attendance-list {
    grid-template-columns: 1fr;
  }

  .history-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .history-table-container {
    overflow-x: scroll;
  }

  .attendance-summary {
    flex-direction: column;
    gap: 1rem;
  }

  .student-attendance-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .attendance-buttons {
    width: 100%;
    justify-content: center;
  }
}

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

.student-attendance-card {
  animation: fadeInUp 0.6s ease forwards;
}

.student-attendance-card:nth-child(odd) {
  animation-delay: 0.1s;
}

.student-attendance-card:nth-child(even) {
  animation-delay: 0.2s;
}
