/* Shared design system for the Faculty module (faculty-facing pages).
   Amber -> Gold -> Brown gradient, white rounded cards, soft shadows.
   Mirrors staff/assets/staff.css / mess/assets/mess.css structure with a faculty- prefix. */

:root {
  --faculty-amber: #f59e0b;
  --faculty-primary: #d97706;
  --faculty-brown: #92400e;
  --faculty-green: #16a34a;
  --faculty-ink: #451a03;
  --faculty-muted: #a8927a;
  --faculty-bg: #fffaf0;
  --faculty-card-radius: 20px;
}

* { font-family: 'Inter', sans-serif; }
h1, h2, h3, h4, h5, .faculty-brand-text, .faculty-btn-primary { font-family: 'Poppins', sans-serif; }

/* ---------- Auth pages ---------- */
.faculty-auth-body {
  min-height: 100vh; margin: 0; display: flex; align-items: center; justify-content: center; padding: 32px 16px;
  background: linear-gradient(135deg, #78350f 0%, #d97706 35%, #f59e0b 70%, #fbbf24 100%);
  background-attachment: fixed;
}
.faculty-auth-shell { width: 100%; max-width: 430px; }

.faculty-brand-row { display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 18px; }
.faculty-brand-mark {
  width: 52px; height: 52px; border-radius: 16px;
  background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.35);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; color: #fff; backdrop-filter: blur(6px);
}
.faculty-brand-logo {
  width: 52px; height: 52px; border-radius: 16px; object-fit: contain;
  background: rgba(255,255,255,.9); border: 1px solid rgba(255,255,255,.35);
  padding: 4px; flex-shrink: 0;
}
.faculty-brand-text { color: #fff; font-weight: 800; font-size: 1.4rem; letter-spacing: .04em; line-height: 1.1; text-align: left; }
.faculty-brand-text small { display: block; font-size: .65rem; font-weight: 600; letter-spacing: .14em; color: rgba(255,255,255,.75); }

.faculty-auth-card {
  background: #fff; border-radius: var(--faculty-card-radius); padding: clamp(24px, 4vw, 36px);
  box-shadow: 0 24px 60px rgba(120,53,15,.35); animation: facultyPop .35s ease-out;
}
@keyframes facultyPop { 0% { opacity: 0; transform: scale(.96); } 100% { opacity: 1; transform: scale(1); } }

.faculty-input-icon { position: relative; }
.faculty-input-icon > i:first-child { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--faculty-primary); z-index: 2; }
.faculty-input-icon .form-control, .faculty-input-icon .form-select { padding-left: 2.4rem; border-radius: 12px; border: 1.5px solid #fde9c8; background: #fffbf2; }
.faculty-input-icon .form-control:focus, .faculty-input-icon .form-select:focus { border-color: var(--faculty-primary); box-shadow: 0 0 0 4px rgba(217,119,6,.12); background: #fff; }
.faculty-input-icon input[type="password"] { padding-right: 2.4rem; }
.faculty-input-icon .password-toggle-btn {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%); z-index: 2;
  border: none; background: none; color: #a8927a; padding: .2rem; line-height: 1; cursor: pointer;
}
.faculty-input-icon .password-toggle-btn:hover { color: var(--faculty-primary); }

.faculty-btn-primary {
  background: linear-gradient(120deg, var(--faculty-amber), var(--faculty-primary) 55%, var(--faculty-brown));
  background-size: 200% 200%; border: none; color: #fff; font-weight: 700;
  padding: .75rem 1rem; border-radius: 12px; box-shadow: 0 10px 24px rgba(217,119,6,.35);
  transition: transform .15s, box-shadow .15s, background-position .4s;
}
.faculty-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(217,119,6,.45); background-position: 100% 0; color: #fff; }
.faculty-btn-primary:disabled { opacity: .7; transform: none; cursor: not-allowed; }

.faculty-link { color: var(--faculty-primary); text-decoration: none; font-weight: 600; font-size: .9rem; }
.faculty-link:hover { text-decoration: underline; color: var(--faculty-brown); }
.faculty-req { color: #ef4444; }

/* ---------- App shell ---------- */
body.faculty-app-body { background: var(--faculty-bg); min-height: 100vh; margin: 0; padding-bottom: 90px; }

.faculty-card {
  background: #fff; border-radius: var(--faculty-card-radius);
  box-shadow: 0 8px 24px rgba(120,53,15,.08); border: 1px solid rgba(120,53,15,.05);
}

.faculty-app-header {
  background: linear-gradient(120deg, var(--faculty-amber), var(--faculty-primary) 60%, var(--faculty-brown));
  color: #fff; padding: 14px 16px 20px; border-radius: 0 0 22px 22px;
  box-shadow: 0 10px 28px rgba(217,119,6,.28); position: sticky; top: 0; z-index: 1030;
}
.faculty-header-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.faculty-profile-link { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; min-width: 0; }
.faculty-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: rgba(255,255,255,.25); display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-family: 'Poppins', sans-serif;
}
.faculty-profile-link .faculty-greet-name { font-weight: 700; font-family: 'Poppins', sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
.faculty-profile-link .faculty-greet-sub { font-size: .68rem; opacity: .8; }

.faculty-header-icons { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.faculty-header-icon-btn {
  position: relative; width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.3);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem; text-decoration: none; transition: background .15s;
}
.faculty-header-icon-btn:hover { background: rgba(255,255,255,.3); color: #fff; }
.faculty-header-badge {
  position: absolute; top: -4px; right: -4px; background: #fff; color: #ef4444; font-size: .62rem; font-weight: 800;
  min-width: 16px; height: 16px; border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 0 3px;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}

.faculty-app-content { max-width: 900px; margin: 0 auto; padding: 16px; }
.faculty-notif-unread { border-left: 4px solid var(--faculty-primary); }

.faculty-bottom-nav {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 1050;
  background: rgba(255,255,255,.88); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 14px 36px rgba(120,53,15,.2); display: flex; gap: 4px; border-radius: 22px; padding: 6px;
  border: 1px solid rgba(253,233,200,.8);
}
.faculty-bottom-nav-link {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  padding: .5rem 0; color: #a8927a; text-decoration: none; font-size: .64rem; font-weight: 700;
  border-radius: 16px; transition: color .2s, background .2s, box-shadow .2s;
}
.faculty-bottom-nav-link i { font-size: 1.25rem; transition: transform .2s; }
.faculty-bottom-nav-link.active {
  color: #fff; background: linear-gradient(135deg, var(--faculty-amber), var(--faculty-primary));
  box-shadow: 0 8px 18px rgba(217,119,6,.35);
}
.faculty-bottom-nav-link.active i { transform: translateY(-1px) scale(1.08); }
.faculty-bottom-nav-link:not(.active):hover { color: var(--faculty-primary); background: var(--faculty-bg); }

/* ---------- Stat cards / hero ---------- */
.faculty-stat-grid { margin-top: 12px; }
.faculty-stat-card { background: #fff; border-radius: 18px; padding: 16px; box-shadow: 0 10px 26px rgba(120,53,15,.1); height: 100%; }
.faculty-stat-icon {
  width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: #fff; margin-bottom: 10px;
}
.faculty-stat-value { font-size: 1.25rem; font-weight: 800; font-family: 'Poppins', sans-serif; line-height: 1.2; }
.faculty-stat-label { font-size: .74rem; color: #a8927a; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }

.faculty-welcome-hero {
  position: relative; overflow: hidden; border-radius: 22px; padding: 24px 20px;
  background: linear-gradient(135deg, var(--faculty-amber), var(--faculty-primary) 55%, var(--faculty-brown));
  color: #fff; box-shadow: 0 14px 34px rgba(217,119,6,.3);
}
.faculty-welcome-hero-blob { position: absolute; border-radius: 50%; background: rgba(255,255,255,.12); }
.faculty-welcome-hero-blob-1 { width: 130px; height: 130px; top: -50px; right: -30px; }
.faculty-welcome-hero-blob-2 { width: 90px; height: 90px; bottom: -40px; left: -20px; background: rgba(0,0,0,.08); }

/* ---------- Profile hero / info rows ---------- */
.faculty-profile-hero {
  position: relative; overflow: hidden; text-align: center; border-radius: 22px; padding: 30px 20px;
  background: linear-gradient(135deg, var(--faculty-amber), var(--faculty-primary) 55%, var(--faculty-brown));
  color: #fff; box-shadow: 0 14px 34px rgba(217,119,6,.3);
}
.faculty-profile-hero-blob { position: absolute; border-radius: 50%; background: rgba(255,255,255,.12); }
.faculty-profile-hero-blob-1 { width: 130px; height: 130px; top: -50px; right: -30px; }
.faculty-profile-hero-blob-2 { width: 90px; height: 90px; bottom: -40px; left: -20px; background: rgba(0,0,0,.08); }
.faculty-profile-hero-avatar {
  position: relative; width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 10px;
  background: rgba(255,255,255,.22); border: 2px solid rgba(255,255,255,.55);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem; font-weight: 800; font-family: 'Poppins', sans-serif;
}
.faculty-profile-status-pill {
  display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; font-weight: 700;
  padding: .3rem .7rem; border-radius: 999px; background: rgba(255,255,255,.18); color: #fff;
}
.faculty-profile-status-pill i { font-size: .5rem; color: #f1f5f9; }
.faculty-profile-status-pill.is-active i { color: #4ade80; }

.faculty-info-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #fdf0d5; }
.faculty-info-row:last-child { border-bottom: none; padding-bottom: 2px; }
.faculty-info-icon {
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
  background: var(--faculty-bg); color: var(--faculty-primary); box-shadow: inset 0 0 0 1.5px #fde9c8;
  display: flex; align-items: center; justify-content: center;
}
.faculty-info-label { font-size: .68rem; color: var(--faculty-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.faculty-info-value { font-weight: 700; color: var(--faculty-ink); }

/* ---------- List / schedule rows ---------- */
.faculty-list-row {
  display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 16px;
  box-shadow: 0 8px 24px rgba(120,53,15,.08); padding: 12px 14px; margin-bottom: 10px;
}
.faculty-list-icon {
  flex-shrink: 0; width: 42px; height: 42px; border-radius: 13px; display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem; color: #fff; background: linear-gradient(135deg, var(--faculty-amber), var(--faculty-primary));
}
.faculty-list-body { flex: 1; min-width: 0; }
.faculty-list-title { font-weight: 800; color: var(--faculty-ink); font-size: .9rem; }
.faculty-list-meta { font-size: .74rem; color: var(--faculty-muted); margin-top: 2px; display: flex; flex-wrap: wrap; gap: 2px 8px; }
.faculty-list-meta span { display: inline-flex; align-items: center; gap: 3px; }

.faculty-report-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #fdf0d5; }
.faculty-report-row:last-child { border-bottom: none; padding-bottom: 2px; }
.faculty-report-avatar {
  flex-shrink: 0; width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--faculty-amber), var(--faculty-primary));
  color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .82rem; font-family: 'Poppins', sans-serif;
}
.faculty-report-body { flex: 1; min-width: 0; }
.faculty-report-name { font-weight: 700; color: var(--faculty-ink); font-size: .88rem; }
.faculty-report-code { font-size: .7rem; color: var(--faculty-muted); }

#facultySearch, .faculty-search-input { border-radius: 999px; border: 1.5px solid #fde9c8; background: #fffbf2; }
#facultySearch:focus, .faculty-search-input:focus { border-color: var(--faculty-primary); box-shadow: 0 0 0 4px rgba(217,119,6,.12); background: #fff; }

::placeholder { color: #d6c3a5; opacity: 1; }

/* ---------- Test PDF viewer (PDF + OMR mode) ---------- */
.faculty-pdf-viewer { background: #fff; border-radius: 16px; box-shadow: 0 8px 24px rgba(69,26,3,.08); padding: 12px; margin-bottom: 14px; }
.faculty-pdf-canvas-wrap {
  position: relative; min-height: 160px; text-align: center;
  perspective: 1400px; overflow: auto; -webkit-overflow-scrolling: touch;
  touch-action: pan-y; max-height: 30vh;
}
.faculty-pdf-canvas-wrap.is-zoomed { text-align: left; touch-action: pan-x pan-y; }
.faculty-pdf-canvas-zoom { display: inline-block; transform-origin: top left; }
.faculty-pdf-canvas-wrap canvas { display: block; border-radius: 10px; box-shadow: 0 4px 16px rgba(69,26,3,.12); backface-visibility: hidden; margin: 0 auto; }
.faculty-pdf-canvas-wrap:not(.is-zoomed) canvas { max-width: 100%; }
.faculty-pdf-loading {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 8px; color: var(--faculty-muted); font-size: .85rem; font-weight: 600;
}
.faculty-pdf-controls { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 10px; }
.faculty-pdf-icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: none; background: var(--faculty-bg); color: var(--faculty-primary);
  display: flex; align-items: center; justify-content: center; font-size: 1rem; transition: background .15s;
}
.faculty-pdf-icon-btn:hover { background: #fde9c8; }
.faculty-pdf-page-indicator { font-size: .85rem; font-weight: 700; color: var(--faculty-ink); font-variant-numeric: tabular-nums; }

/* ---------- Complaints & Help (mirrors mess's complaint-* classes) ---------- */
.faculty-mode-group { display: flex; gap: 8px; background: #fdf0d5; border-radius: 14px; padding: 4px; }
.faculty-mode-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 10px; border-radius: 11px; border: none; background: transparent;
  color: var(--faculty-muted); font-weight: 700; font-size: .85rem; transition: background .15s, color .15s;
}
.faculty-mode-btn.active { background: #fff; color: var(--faculty-primary); box-shadow: 0 4px 12px rgba(217,119,6,.15); }

.faculty-category-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.faculty-category-chip {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px;
  border-radius: 12px; border: 1.5px solid #fde9c8; background: #fffbf2; color: var(--faculty-ink);
  font-size: .66rem; font-weight: 600; text-align: center; line-height: 1.15;
  transition: border-color .15s, background .15s, color .15s;
}
.faculty-category-chip i { font-size: 1.05rem; color: var(--faculty-primary); }
.faculty-category-chip:hover { border-color: var(--faculty-primary); }
.faculty-category-chip.active {
  background: linear-gradient(120deg, var(--faculty-amber), var(--faculty-primary) 60%, var(--faculty-brown));
  border-color: transparent; color: #fff;
}
.faculty-category-chip.active i { color: #fff; }

.faculty-photo-dropzone {
  border: 2px dashed #fde9c8; border-radius: 16px; background: #fffbf2;
  min-height: 100px; display: flex; align-items: center; justify-content: center;
  text-align: center; color: var(--faculty-muted); cursor: pointer; overflow: hidden;
  transition: border-color .15s, background .15s;
}
.faculty-photo-dropzone:hover { border-color: var(--faculty-primary); background: #fff; }
.faculty-photo-dropzone img { max-width: 100%; max-height: 180px; display: block; }
.faculty-photo-thumb { max-height: 130px; border-radius: 12px; border: 1px solid #fde9c8; display: block; }

.faculty-complaint-reply {
  background: var(--faculty-bg); border-radius: 12px; padding: 10px 12px; font-size: .85rem;
  border-left: 3px solid var(--faculty-primary); margin-top: 6px;
}
.faculty-complaint-reply i { color: var(--faculty-primary); }

/* Voice recorder - used both by faculty (voice complaint) and admin (voice
   reply); .recording pulses the mic button red while capturing. */
.faculty-record-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 10px; border-radius: 14px; border: 1.5px dashed #fde9c8;
  background: #fffbf2; color: var(--faculty-primary); font-weight: 700; font-size: .85rem;
  transition: border-color .15s, background .15s;
}
.faculty-record-btn:hover { border-color: var(--faculty-primary); }
.faculty-record-btn.recording {
  border-style: solid; border-color: #dc2626; background: #fef2f2; color: #dc2626;
  animation: facultyRecordPulse 1.4s ease-in-out infinite;
}
@keyframes facultyRecordPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,.25); } 50% { box-shadow: 0 0 0 8px rgba(220,38,38,0); } }
.faculty-record-timer { font-variant-numeric: tabular-nums; }
.faculty-audio-preview { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.faculty-audio-preview audio { flex: 1; height: 36px; }
