/* addStudent specific overrides and enhancements */

body[data-default-theme="theme-light"] {
  --bg-main: #eef4fb;
  --text-main: #172033;
  --text-muted: #64748b;
  --bg-glass: rgba(255, 255, 255, 0.94);
  --border-glass: rgba(148, 163, 184, 0.26);
  --input-bg: #ffffff;
  --input-color: #172033;
}

body[data-default-theme="theme-light"] .tabs-container,
body.theme-light .tabs-container {
  background: rgba(255, 255, 255, 0.95);
  color: #172033;
}

body[data-default-theme="theme-light"] .tabs-header,
body.theme-light .tabs-header,
body[data-default-theme="theme-light"] .tab-wizard-nav,
body.theme-light .tab-wizard-nav,
body[data-default-theme="theme-light"] .add-student-actions,
body.theme-light .add-student-actions {
  background: rgba(248, 250, 252, 0.94);
}

body[data-default-theme="theme-light"] .tab-link,
body.theme-light .tab-link {
  color: #64748b;
}

body[data-default-theme="theme-light"] .tab-link:hover,
body.theme-light .tab-link:hover,
body[data-default-theme="theme-light"] .tab-link.active,
body.theme-light .tab-link.active {
  color: #1d4ed8;
}

body[data-default-theme="theme-light"] .tab-wizard-status,
body.theme-light .tab-wizard-status {
  color: #475569;
}

body select,
body .theme-select,
body .input-group select {
  background-color: #ffffff !important;
  color: #172033 !important;
  -webkit-text-fill-color: #172033 !important;
  border-color: rgba(148, 163, 184, 0.38) !important;
}

body select option,
body .theme-select option,
body .input-group select option {
  background: #ffffff !important;
  color: #172033 !important;
}

body select:disabled {
  color: #64748b !important;
  -webkit-text-fill-color: #64748b !important;
  background-color: #f1f5f9 !important;
}

.student-setup-blocker {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin: 0 0 18px;
  padding: 16px 18px;
  border: 1px solid rgba(245, 158, 11, 0.32);
  border-left: 5px solid #f59e0b;
  border-radius: 12px;
  background: rgba(120, 53, 15, 0.18);
  color: #fff7ed;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.student-setup-blocker strong {
  display: block;
  margin-bottom: 8px;
  color: #ffffff;
}

.student-setup-blocker ul {
  margin: 0;
  padding-left: 18px;
}

.student-setup-blocker a {
  flex: 0 0 auto;
  padding: 10px 14px;
  border-radius: 8px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  font-weight: 800;
  text-decoration: none;
  transition: all 0.2s ease;
}

.student-setup-blocker a:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.26);
}

/* Tabs Framework Enhanced */
.tabs-container {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.tabs-header {
  display: flex;
  background: rgba(15, 23, 42, 0.4);
  border-bottom: 1px solid var(--border-glass);
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.55) transparent;
}

.tabs-header::-webkit-scrollbar {
  height: 8px;
}

.tabs-header::-webkit-scrollbar-track {
  background: transparent;
}

.tabs-header::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.45);
  border-radius: 999px;
}

.tab-link {
  flex: 1;
  min-width: 0;
  padding: 1.25rem 1rem;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-muted);
  font-size: 1.05rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  white-space: nowrap;
  line-height: 1.2;
}

.tab-link i {
  font-size: 1.1rem;
  opacity: 0.9;
}

.tab-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 3px;
  background-color: var(--primary);
  transition: width 0.3s ease;
}

.tab-link:hover {
  background: rgba(59, 130, 246, 0.05);
  color: var(--text-main);
}

.tab-link.active {
  color: var(--primary);
  background: rgba(59, 130, 246, 0.1);
}
.tab-link.active::after {
  width: 100%;
}

.tab-content {
  display: none;
  padding: 2.5rem;
  animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 0;
}

.tab-content.active {
  display: block;
}

.tab-wizard-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 2.5rem;
  border-top: 1px solid var(--border-glass);
  background: rgba(15, 23, 42, 0.24);
}

.tab-wizard-status {
  min-width: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 600;
  text-align: center;
}

.tab-wizard-nav .btn-outline,
.tab-wizard-nav .btn-primary {
  min-width: 132px;
  max-width: 100%;
  border-radius: 12px;
  padding: 0.78rem 1.15rem;
  font-weight: 700;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.tab-wizard-nav .btn-outline {
  color: #c7d2fe;
  border-color: rgba(129, 140, 248, 0.35);
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.72), rgba(15, 23, 42, 0.54));
}

.tab-wizard-nav .btn-primary {
  color: #ffffff;
  border: 1px solid rgba(59, 130, 246, 0.58);
  background: linear-gradient(135deg, #2563eb, #14b8a6);
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.22);
}

.tab-wizard-nav .btn-outline:hover,
.tab-wizard-nav .btn-primary:hover {
  transform: translateY(-1px);
}

.tab-wizard-nav .btn-outline:hover {
  border-color: rgba(165, 180, 252, 0.62);
  background: linear-gradient(135deg, rgba(49, 46, 129, 0.62), rgba(15, 23, 42, 0.62));
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.18);
}

.tab-wizard-nav .btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8, #0f766e);
  box-shadow: 0 16px 32px rgba(20, 184, 166, 0.22);
}

.tab-wizard-nav .btn-outline:disabled,
.tab-wizard-nav .btn-primary:disabled {
  opacity: 0.46;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.tab-wizard-nav .btn-primary i {
  margin-right: 0;
  margin-left: 0.45rem;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.tab-content h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tab-content h3 {
  font-size: 1.15rem;
  font-weight: 500;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  color: var(--primary);
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.tab-content h2 i,
.tab-content h3 i,
.section-title-icon {
  color: var(--primary);
}

.glass-header h1 {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.btn-outline i,
.btn-primary i {
  margin-right: 0.45rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  align-items: start;
}

.col-span-full {
  grid-column: 1 / -1;
}

.split-address-fields {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(220px, 2fr);
  gap: 1rem;
}

/* Animations for Input Focus */
.input-group label {
  transition: color 0.3s ease;
}
.input-group:focus-within label {
  color: var(--primary);
}

.student-id-warning {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  margin-top: 0.75rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 16px;
  background:
    radial-gradient(circle at top left, rgba(245, 158, 11, 0.22), transparent 42%),
    rgba(120, 53, 15, 0.24);
  color: #fffbeb;
  box-shadow: 0 16px 34px rgba(120, 53, 15, 0.18);
}

.student-id-warning.hidden {
  display: none;
}

.student-id-warning-icon {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  font-size: 1.35rem;
}

.student-id-warning strong {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.98rem;
  letter-spacing: 0.01em;
}

.student-id-warning p {
  margin: 0;
  color: #fde68a;
  line-height: 1.45;
}

.student-id-warning span {
  display: inline-block;
  margin-top: 0.35rem;
  color: rgba(255, 251, 235, 0.72);
  font-size: 0.82rem;
}

input.student-id-conflict {
  border-color: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.18);
}

/* Checkboxes */
.checkbox-row {
  flex-direction: row;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--input-bg);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.checkbox-row:hover {
  border-color: var(--primary);
}

.checkbox-row label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  line-height: 1.35;
}

.checkbox-row input[type="checkbox"] {
  width: 1.2rem;
  height: 1.2rem;
  flex: 0 0 1.2rem;
  accent-color: var(--primary);
  cursor: pointer;
  margin-right: 0;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1.5rem; }

/* Grid Table for Academic Details */
.academic-grid-panel {
  width: 100%;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.55) transparent;
}

.academic-grid-panel::-webkit-scrollbar {
  height: 8px;
}

.academic-grid-panel::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.28);
  border-radius: 999px;
}

.academic-grid-panel::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.5);
  border-radius: 999px;
}

.grid-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  background: rgba(15, 23, 42, 0.4);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.grid-table th {
  background: rgba(15, 23, 42, 0.8);
  padding: 1rem;
  text-align: left;
  font-size: 0.95rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-glass);
}

.grid-table td {
  padding: 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.grid-table input {
  padding: 0.6rem;
  font-size: 0.9rem;
  border: 1px solid transparent;
  background: rgba(255,255,255,0.05);
}
.grid-table input:focus {
  background: var(--input-bg);
  border-color: var(--primary);
}

.btn-row-remove {
  min-width: 42px;
  min-height: 36px;
  padding: 0.3rem 0.6rem;
  border-color: #ef4444;
  color: #ef4444;
}

.add-student-actions {
  margin-top: 1.5rem;
  padding: 1.25rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  border-top: 1px solid var(--border-glass);
  background: rgba(15, 23, 42, 0.2);
}

.add-student-status {
  margin-right: auto;
  align-self: center;
  font-weight: 500;
  min-width: 0;
}

.edit-student-search {
  padding: 1.5rem;
  margin-bottom: -1rem;
}

.edit-student-search .input-group {
  margin-bottom: 0;
}

.edit-student-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  position: relative;
}

.edit-student-actions #btnDeleteStudent {
  border-color: #ef4444;
  color: #ef4444;
}

@media (max-width: 1100px) {
  .tab-link {
    flex: 0 0 auto;
    min-width: 190px;
  }

  .tab-content {
    padding: 2rem;
  }
}

@media (max-width: 768px) {
  .tabs-container {
    border-radius: 14px;
  }

  .tab-link {
    min-width: 164px;
    padding: 0.95rem 1rem;
    font-size: 0.92rem;
    justify-content: center;
  }

  .tab-link i {
    font-size: 1rem;
  }

  .tab-content {
    padding: 1.25rem;
  }

  .tab-content h2 {
    font-size: 1.18rem;
    margin-bottom: 1.15rem;
  }

  .tab-content h3 {
    font-size: 1rem;
  }

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

  .input-group {
    margin-bottom: 0.75rem;
  }

  .split-address-fields {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .tab-wizard-nav {
    padding: 1rem;
    flex-wrap: wrap;
  }

  .tab-wizard-status {
    order: -1;
    width: 100%;
  }

  .tab-wizard-nav .btn-outline,
  .tab-wizard-nav .btn-primary {
    flex: 1 1 140px;
    min-width: 0;
    padding: 0.72rem 0.8rem;
    font-size: 0.9rem;
    white-space: normal;
    line-height: 1.25;
  }

  .student-id-warning {
    grid-template-columns: 1fr;
  }

  .add-student-actions {
    padding: 1rem;
    flex-wrap: wrap;
    justify-content: stretch;
  }

  .add-student-status {
    width: 100%;
    margin-right: 0;
  }

  .add-student-actions .btn-outline,
  .add-student-actions .btn-primary {
    flex: 1 1 100%;
    min-width: 0;
    white-space: normal;
    line-height: 1.25;
  }

  .edit-student-search {
    padding: 1rem;
    margin-bottom: -0.5rem;
  }

  .edit-student-search-row {
    grid-template-columns: 1fr;
  }

  .grid-table th,
  .grid-table td {
    padding: 0.65rem;
  }
}

@media (max-width: 520px) {
  .tab-link {
    min-width: 142px;
    padding: 0.85rem 0.85rem;
  }

  .tab-link span {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .tab-content {
    padding: 1rem;
  }

  .tab-wizard-nav {
    gap: 0.65rem;
  }

  .tab-wizard-nav .btn-outline,
  .tab-wizard-nav .btn-primary {
    flex-basis: 100%;
  }

  .grid-table {
    min-width: 760px;
  }
}
