/* ============================================================
   css/app.css  —  v0.6
   Shared styles for list pages (student.html, category.html)
   and the home/settings screens.
   ============================================================ */

/* ---- Google Font: Inter (loaded inline so it works offline from SW cache) ---- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --app-theme-color: #2B2640;
  --app-bg:          #F4F1EA;
  --radius-sm:       8px;
  --radius-md:       12px;
  --radius-lg:       16px;
  --shadow-card:     0 2px 12px rgba(0,0,0,.08);
  --shadow-float:    0 6px 20px rgba(0,0,0,.22);
  --transition:      0.18s ease;
}

/* ── Reset / base ── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--app-bg);
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Layout ── */
.main-container {
  max-width: 640px;
  margin: 0 auto;
  position: relative;
  min-height: 100vh;
}

/* ── Fixed header ── */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: var(--app-theme-color);
  color: #fff;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}

.header-items {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0 auto;
  padding: 0 8px;
  max-width: 640px;
  height: 52px;
}
.header-items li { list-style: none; }

.heading-text {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -.01em;
  margin-left: 6px;
  flex: 1;
}

.header-icons-L {
  color: #fff;
  text-decoration: none;
  padding: 8px 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.header-icons-L:hover { background: rgba(255,255,255,.12); color: #fff; }

.float-right { margin-left: auto; }

/* ── Search bar ── */
#search_bar {
  padding: 10px 14px 4px;
  background: var(--app-bg);
  position: sticky;
  top: 52px;
  z-index: 900;
}

/* Override Bootstrap mb-4 so the search input group doesn't have a big gap */
#search_bar .input-group.mb-4 { margin-bottom: 6px !important; }

#search_bar .input-group-text {
  background: #fff;
  border-right: none;
  color: var(--app-theme-color);
}

#search_bar .form-control#search {
  border-left: none;
  box-shadow: none;
  font-size: 14px;
  height: 40px;
}

#search:focus {
  border-color: var(--app-theme-color);
  box-shadow: none;
  outline: none;
}

/* records count + filter row */
#search_bar .row.pt-2 {
  padding-top: 2px !important;
  align-items: center;
}
#search_bar .row .row {
  margin-left: 0;
  margin-top: 0;
  padding-bottom: 6px;
  align-items: center;
  gap: 2px;
}

#records {
  font-size: 13px;
  font-weight: 600;
  color: #888;
  margin: 0;
  padding-top: 0 !important;
  white-space: nowrap;
}

.filter-items { margin: 0; }
#filter_params { flex-wrap: wrap; gap: 4px; }
#filter_params h6 {
  background: #fff;
  border: 1.5px solid var(--app-theme-color);
  border-radius: 999px;
  padding: 3px 11px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--app-theme-color);
  margin: 0;
}

/* ── List ── */
.list-container {
  padding: 8px 14px 80px;
}

.list-dis {
  list-style: none;
  padding: 13px 14px;
  margin: 0 0 8px;
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition), transform var(--transition);
  cursor: pointer;
}
.list-dis:active {
  transform: scale(.988);
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.list-dis li { list-style: none; }

/* ── Modals ── */
.modal-10 .modal-content {
  border-radius: var(--radius-lg);
  border: none;
  box-shadow: 0 16px 48px rgba(0,0,0,.18);
}
.modal-header {
  border-bottom: 1px solid #f0f0f0;
  padding: 16px 20px 14px;
}
.modal-footer {
  border-top: 1px solid #f0f0f0;
  padding: 12px 20px;
}
.modal-title { font-weight: 700 !important; font-size: 17px !important; }

.form-control-label {
  font-weight: 600;
  font-size: 12.5px;
  color: #555;
  margin-top: 10px;
  display: block;
}

.form-control {
  border-radius: var(--radius-sm) !important;
  font-size: 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
  border-color: var(--app-theme-color) !important;
  box-shadow: 0 0 0 2px rgba(43,38,64,.12) !important;
}

#save_div button, .modal-footer button {
  font-weight: 700;
  border-radius: var(--radius-sm);
  letter-spacing: .01em;
  transition: opacity var(--transition), transform var(--transition);
}
#save_div button:active, .modal-footer button:active {
  transform: scale(.97);
  opacity: .9;
}

/* ── FAB ── */
.float-button {
  position: fixed;
  right: 20px;
  bottom: 22px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--app-theme-color);
  color: #fff;
  text-align: center;
  box-shadow: var(--shadow-float);
  z-index: 900;
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.float-button:hover { transform: scale(1.06); }
.float-button:active { transform: scale(.96); }
.float-button i { color: #fff; font-size: 18px; }

/* info card layout */
.mt--7 { margin-top: -3.5rem; }

/* ── Loader overlay ── */
#__loader__ {
  position: fixed;
  inset: 0;
  background: rgba(20,16,40,.52);
  color: #fff;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  gap: 14px;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
#__loader__ span {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .02em;
}
/* Spinner ring */
#__loader__::before {
  content: '';
  width: 38px;
  height: 38px;
  border: 3px solid rgba(255,255,255,.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast ── */
#__toast__ {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #222;
  color: #fff;
  padding: 11px 22px;
  border-radius: 999px;
  display: none;
  z-index: 2100;
  font-size: 13.5px;
  font-weight: 500;
  opacity: 0;
  transition: opacity .25s ease, transform .25s ease;
  white-space: nowrap;
  max-width: 90vw;
  text-align: center;
  box-shadow: 0 6px 20px rgba(0,0,0,.28);
}
#__toast__.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Guest banner ── */
#__guest_banner__ {
  background: #fff8e1;
  color: #7a5c00;
  font-size: 12.5px;
  text-align: center;
  padding: 7px 10px;
  position: sticky;
  top: 52px;
  z-index: 950;
  font-weight: 500;
}
#__guest_banner__ a {
  color: var(--app-theme-color);
  font-weight: 700;
  text-decoration: underline;
}

/* ── Home screen ── */
.home-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 32px 26px 28px;
  box-shadow: var(--shadow-float);
  width: 100%;
  max-width: 360px;
  text-align: center;
}
.home-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.home-card h1 {
  font-size: 20px;
  margin: 0 0 18px;
  color: var(--app-theme-color);
  font-weight: 700;
  letter-spacing: -.02em;
}
.home-card .greeting {
  font-size: 13px;
  color: #aaa;
  margin: -10px 0 16px;
  font-weight: 500;
}
a.home-btn {
  display: block;
  background: var(--app-theme-color);
  color: #fff;
  text-decoration: none;
  padding: 14px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 12px;
  letter-spacing: -.01em;
  transition: opacity var(--transition), transform var(--transition);
}
a.home-btn:hover  { opacity: .9; transform: translateY(-1px); color: #fff; }
a.home-btn:active { transform: scale(.98); opacity: 1; }
a.home-btn:last-of-type { margin-bottom: 0; }
a.home-btn.signout  { background: #e74c3c; }
a.home-btn.signin   { background: #27ae60; }
a.home-btn.settings { background: #546e7a; }

/* ── Dashboard cards ── */
.dashboard-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 16px 0 22px;
}
.dash-card {
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: var(--radius-md);
  padding: 14px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.dash-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--app-theme-color);
}
.dash-label {
  font-size: 10.5px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-top: 3px;
  font-weight: 600;
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: #999;
  animation: fadeUp .3s ease both;
}
@keyframes fadeUp {
  from { opacity:0; transform:translateY(10px); }
  to   { opacity:1; transform:translateY(0); }
}
.empty-state-icon { font-size: 46px; margin-bottom: 14px; }
.empty-state-text { font-size: 15px; font-weight: 700; color: #555; margin: 0 0 6px; }
.empty-state-hint { font-size: 13px; color: #aaa; margin: 0; }
.empty-state-retry {
  margin-top: 18px;
  padding: 9px 24px;
  border: none;
  border-radius: 20px;
  background: var(--app-theme-color);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity var(--transition);
}
.empty-state-retry:hover { opacity: .85; }

/* ── Theme picker (home) ── */
.theme-picker { margin-top: 22px; }
.theme-picker-label {
  font-size: 11px;
  font-weight: 700;
  color: #bbb;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 0 0 10px;
}
.theme-swatches {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.theme-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: transform var(--transition), border-color var(--transition);
}
.theme-swatch:hover { transform: scale(1.15); }
.theme-swatch.selected {
  border-color: #333;
  box-shadow: 0 0 0 2px #fff inset;
}
.theme-swatch-auto {
  background: linear-gradient(135deg, #FFFFFF 50%, #1E1B2E 50%);
  border: 1.5px solid #ccc;
}

/* ── Contact action buttons in Info modal ── */
#contact_actions_div { animation: fadeUp .22s ease both; }
#contact_btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  padding: 10px 0 4px;
}
#contact_btns a {
  transition: opacity var(--transition), transform var(--transition) !important;
}
#contact_btns a:hover {
  opacity: .88;
  transform: scale(1.04) !important;
}
#contact_btns a:active {
  transform: scale(.96) !important;
}

/* ── Filter modal ── */
.filter-modal-label {
  font-weight: 600;
  font-size: 12.5px;
  color: #555;
  margin-bottom: 4px;
}
