/* ==========================================================================
   BAOBAB RISE - Components & Interactive Elements
   ========================================================================== */

/* Modal Backdrop */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-box {
  background: #ffffff;
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 18px 24px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 20px;
  color: #64748b;
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 75vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 14px 24px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* Form Controls */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  display: block;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: 9px;
  font-family: inherit;
  font-size: 13.5px;
  color: #0f172a;
  background-color: #ffffff;
  outline: none;
  transition: all 0.15s ease-in-out;
  box-sizing: border-box;
}

.form-input::placeholder, .form-textarea::placeholder {
  color: #94a3b8;
  font-weight: 400;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: #0284c7;
  background-color: #ffffff;
  color: #0f172a;
  box-shadow: 0 0 0 3.5px rgba(2, 132, 199, 0.18);
}

.form-input:disabled, .form-input[readonly], .form-select:disabled {
  background-color: #f1f5f9 !important;
  color: #0369a1 !important;
  border-color: #cbd5e1 !important;
  cursor: not-allowed;
  font-weight: 600;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Toast Alerts */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: #0f172a;
  color: #ffffff;
  padding: 12px 18px;
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastSlideIn 0.25s ease-out;
}

.toast.success { border-left: 4px solid #22c55e; }
.toast.info { border-left: 4px solid #0284c7; }
.toast.warning { border-left: 4px solid #f59e0b; }

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

/* Lightbox Image Preview */
.lightbox-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 2500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 30px;
}

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

.lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  color: #ffffff;
  font-size: 32px;
  background: none;
  border: none;
  cursor: pointer;
}

/* Modal Extensions */
.modal-box.modal-lg {
  max-width: 820px;
}
.modal-box.modal-xl {
  max-width: 960px;
}

/* School Module Components */
.form-section-header {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #0369a1;
  background: #f0f9ff;
  border-left: 4px solid #0284c7;
  padding: 8px 12px;
  border-radius: 4px;
  margin-top: 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.school-uid-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.5px;
}
.school-logo-uploader-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
}
.school-logo-thumb-wrapper {
  width: 68px;
  height: 68px;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.school-logo-thumb-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.status-pill.inactive {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
}
.status-pill.active {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

