/* 
  EduFlow SaaS Educational ERP - Student Management Module Stylesheet
  ------------------------------------------------------------------
*/

/* Import app and design system styles */
@import url("app.css");

/* --- Main workspace grid --- */
.students-workspace-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  width: 100%;
}

.students-screen-element {
  display: none;
  width: 100%;
  animation: fadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.students-screen-element.active {
  display: block;
}

/* --- Screen 2: Add Student Wizard --- */
.wizard-progress-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-6);
  margin-bottom: var(--space-6);
  position: relative;
  overflow-x: auto;
}
.wizard-progress-bar::-webkit-scrollbar {
  display: none; /* Hide scrollbar for layout */
}

.wizard-step {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  opacity: 0.5;
  transition: opacity var(--transition-fast);
  white-space: nowrap;
}

.wizard-step.active {
  opacity: 1;
  font-weight: 700;
  color: var(--color-primary);
}

.wizard-step.completed {
  opacity: 0.8;
  color: var(--color-success);
}

.wizard-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: var(--color-surface-hover);
  border: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 700;
}

.wizard-step.active .wizard-step-num {
  background-color: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.wizard-step.completed .wizard-step-num {
  background-color: var(--color-success);
  color: white;
  border-color: var(--color-success);
}

.wizard-content-step {
  display: none;
  animation: fadeIn 0.25s ease forwards;
}

.wizard-content-step.active {
  display: block;
}

/* --- Screen 3: Profile Tabs Grid --- */
.profile-student-header {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-6);
}

.profile-student-left {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.profile-student-avatar {
  width: 88px;
  height: 88px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 3px solid var(--color-primary);
  padding: 2px;
}

.profile-student-title h2 {
  font-family: var(--font-headings);
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--color-text-primary);
}

.profile-student-title p {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
}

.profile-tabs-scroller {
  overflow-x: auto;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-5);
}
.profile-tabs-scroller::-webkit-scrollbar {
  display: none;
}

/* Tab 3: Attendance Calendar */
.attendance-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.attendance-day-header {
  text-align: center;
  font-size: 0.6875rem;
  font-weight: 800;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
}

.attendance-calendar-cell {
  background-color: var(--color-surface-hover);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  aspect-ratio: 1.2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--space-2);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--color-text-secondary);
  position: relative;
}

.attendance-calendar-cell.present {
  background-color: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.2);
  color: var(--color-success);
}

.attendance-calendar-cell.absent {
  background-color: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.2);
  color: var(--color-danger);
}

.attendance-calendar-cell.late {
  background-color: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.2);
  color: var(--color-warning);
}

.attendance-calendar-cell.leave {
  background-color: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.2);
  color: var(--color-info);
}

.attendance-cell-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  position: absolute;
  bottom: 8px;
  right: 8px;
}
.attendance-calendar-cell.present .attendance-cell-dot { background-color: var(--color-success); }
.attendance-calendar-cell.absent .attendance-cell-dot { background-color: var(--color-danger); }
.attendance-calendar-cell.late .attendance-cell-dot { background-color: var(--color-warning); }
.attendance-calendar-cell.leave .attendance-cell-dot { background-color: var(--color-info); }

/* Tab 7: Finance timeline */
.finance-timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  position: relative;
  padding-left: var(--space-6);
}
.finance-timeline::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: 6px;
  width: 2px;
  background-color: var(--color-border);
}

.finance-timeline-item {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3.5) var(--space-4);
}
.finance-timeline-item::before {
  content: '';
  position: absolute;
  left: -24px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--color-primary);
  border: 2px solid var(--color-surface);
}
.finance-timeline-item.paid::before { background-color: var(--color-success); }
.finance-timeline-item.unpaid::before { background-color: var(--color-danger); }

/* --- Screen 18: ID Card Generator --- */
.id-card-generator-workspace {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
}

.id-card-visualizer {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-surface-hover);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  min-height: 400px;
}

/* Portrait Template */
.id-card-preview {
  width: 250px;
  height: 380px;
  background-color: white;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(12,8,29,0.1);
  font-family: var(--font-body);
  position: relative;
}

.id-card-header-bar {
  background-color: var(--color-dark-primary);
  color: white;
  padding: var(--space-4) var(--space-3);
  text-align: center;
  font-family: var(--font-headings);
  font-weight: 700;
  font-size: 0.8125rem;
}

.id-card-avatar-wrapper {
  margin: var(--space-4) auto 0;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--color-primary);
}
.id-card-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.id-card-body-content {
  padding: var(--space-3.5);
  text-align: center;
  flex: 1;
}

.id-card-student-name {
  font-family: var(--font-headings);
  font-size: 0.9375rem;
  font-weight: 800;
  color: #1a153a;
  margin-bottom: 2px;
}

.id-card-student-role {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-4);
  display: inline-block;
  background-color: rgba(97,61,223,0.1);
  padding: 2px 8px;
  border-radius: 10px;
}

.id-card-metadata-row {
  display: flex;
  justify-content: space-around;
  font-size: 0.75rem;
  color: #555;
  margin-bottom: var(--space-4);
  border-top: 1px solid #eee;
  padding-top: var(--space-3);
}

.id-card-barcode-box {
  margin-top: auto;
  padding: var(--space-3) 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #fafafa;
  border-top: 1px solid #eee;
}

.id-card-barcode-img {
  width: 140px;
  height: 25px;
  object-fit: contain;
}
.id-card-barcode-text {
  font-size: 0.625rem;
  color: #777;
  font-family: monospace;
}

/* Landscape Template Override */
.id-card-preview.landscape {
  width: 380px;
  height: 240px;
  flex-direction: row;
}

.id-card-preview.landscape .id-card-header-bar {
  width: 100px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.id-card-preview.landscape .id-card-body-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  text-align: left;
  padding-left: var(--space-5);
}

.id-card-preview.landscape .id-card-avatar-wrapper {
  margin: 0 0 var(--space-3);
  width: 70px;
  height: 70px;
}

.id-card-preview.landscape .id-card-metadata-row {
  width: 100%;
  border-top: none;
  padding-top: 0;
  justify-content: flex-start;
  gap: var(--space-5);
}

.id-card-preview.landscape .id-card-barcode-box {
  background: none;
  border-top: none;
  padding: 0;
  position: absolute;
  bottom: var(--space-4);
  right: var(--space-4);
}

/* Custom styles for Student Portal Simulator View */
.student-portal-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  width: 100%;
}

.student-portal-header {
  background: linear-gradient(135deg, var(--color-dark-primary), var(--color-primary));
  color: white;
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.assignment-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-2);
}

/* Dark theme overrides for visualizer frames */
[data-theme="dark"] .id-card-preview {
  background-color: #1a153a;
  border-color: #2d245b;
}

[data-theme="dark"] .id-card-student-name {
  color: white;
}

[data-theme="dark"] .id-card-barcode-box {
  background-color: #130f2d;
  border-color: #2d245b;
}

[data-theme="dark"] .id-card-metadata-row {
  border-color: #2d245b;
  color: #bbb;
}
[data-theme="dark"] .id-card-barcode-text {
  color: #bbb;
}
