/* =============================================================
   DASHBOARD.CSS — Luxor University Faculty Portal
   ============================================================= */

/* ─── CSS Variables ──────────────────────────────────────────── */
:root {
  --navy: #00024a;
  --primary: #2d308f;
  --accent: #3d42c8;
  --accent-light: #cfd1ff;
  --gold: #daad4c;
  --gold-sep: #987935;
  --bg-content: #f8f7f2;
  --text-muted: #8c8989;
  --green-check: #21df67;
  --red-x: #ff797c;
  --shadow-card: 0 3px 7px rgba(0, 0, 0, 0.25);
}

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

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: "Rubik", sans-serif;
  font-weight: 400;
  /* outer body uses the dark navy gradient visible behind the sidebar */
  background: linear-gradient(to bottom, #000269 0%, #000136 100%);
}

/* ─── Layout wrapper ─────────────────────────────────────────── */
.layout-wrapper {
  height: 100vh;
  overflow: hidden;
}

/* ══════════════════════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════════════════════ */
.sidebar {
  width: 260px;
  min-width: 260px;
  background-color: var(--navy);
  height: 100vh;
  overflow: hidden;
  flex-shrink: 0;
}

.sidebar-icon {
  width: 15px;
  height: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.sidebar-logo-img {
  width: auto;
  height: 42px;
  object-fit: contain;
  /* Invert the coloured logo to white for the dark sidebar */
  filter: brightness(0) invert(1);
}

.sidebar-uni-name {
  font-weight: 600;
  color: #ffffff;
  font-size: 10.5px;
  line-height: 1.5;
}

.sidebar-uni-subtitle {
  font-weight: 400;
  color: #d9d9d9;
  font-size: 7px;
  line-height: 1.4;
}

.hamburger-btn {
  border: none !important;
  background: transparent !important;
  line-height: 1;
  flex-shrink: 0;
}

.hamburger-btn i {
  font-size: 25px;
}

/* Gold horizontal separators */
.sidebar-sep {
  border: none;
  border-top: 1.2px solid var(--gold-sep);
  margin: 0;
  opacity: 1;
}

/* Scrollable nav area */
.sidebar-nav {
  overflow-y: auto;
  overflow-x: hidden !important;
  scrollbar-width: none;
}
.sidebar-nav::-webkit-scrollbar { 
  width: 0; 
  height: 0;
}
/* Section labels */
.nav-section-label {
  font-weight: 400;
  color: var(--gold);
  font-size: 8px;
  text-align: start;
  padding: 6px 14px 2px;
  margin: 0;
  letter-spacing: 0.02em;
}

/* Nav items */
.sidebar-item {
  font-weight: 600;
  font-size: 10px;
  color: #ffffff !important;
  text-decoration: none !important;
  transition: background-color 0.15s ease;
  /* In Bootstrap RTL, first child of flex row = visual RIGHT.
     We put <span> (text) first → right side,  <i> (icon) second → left side. */
  justify-content: flex-start; /* items packed toward RTL start = visual right */
}

.sidebar-item:hover {
  background-color: rgba(21, 34, 123, 0.45) !important;
}

/* Active: lوحة التحكم */
.sidebar-item.active {
  background-color: #15227b !important;
}

/* Secondary accent: البيانات الأكاديمية */
.sidebar-item.sidebar-item-accent {
  background-color: var(--navy) !important;
}

.sidebar-item i {
  font-size: 13px;
  flex-shrink: 0;
  /* icon is last DOM child → appears on the visual LEFT in RTL flex */
}

/* ══════════════════════════════════════════════════════════════
   MAIN WRAPPER
   ══════════════════════════════════════════════════════════════ */
.main-wrapper {
  min-width: 0;
}

/* ─── Header bar ───────────────────────────────────────────── */
.header-bar {
  height: 89px;
}

.header-container {
  position: relative;
  transition: 0.3s;
  border: none;
  border-radius: 10px;
}
.header-container:hover {
  background: #f0f0ff;
  cursor: pointer;
}

.header-dropdown {
  left: 0;
  right: auto;
  min-width: 170px;
}

.header-border {
  height: 2px;
  background-color: var(--primary);
  flex-shrink: 0;
}

.header-avatar {
  width: 50px;
  height: 50px;
  object-fit: cover;
  flex-shrink: 0;
}

.header-user-name {
  font-weight: 600;
  color: var(--primary);
  font-size: 12.5px;
}

.header-uni-logo {
  height: 55px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.header-uni-name {
  font-weight: 600;
  color: var(--primary);
  font-size: 13.8px;
  line-height: 1.3;
}

.header-uni-subtitle {
  font-weight: 400;
  color: rgba(45, 48, 143, 0.5);
  font-size: 9px;
}

/* ─── Content area ─────────────────────────────────────────── */
.content-area {
  background-color: var(--bg-content);
  /* fill the remaining height after header (89px) + border (2px) */
  height: 100%;
}

/* ─── Welcome heading ───────────────────────────────────────── */
.welcome-heading {
  font-weight: 600;
  color: var(--primary);
  font-size: 22px;
}

.date-text {
  font-weight: 400;
  color: #555555;
  font-size: 12px;
}

/* ══════════════════════════════════════════════════════════════
   PROFILE CARD
   ══════════════════════════════════════════════════════════════ */
.profile-card {
  border: none;
  border-radius: 10px;
  box-shadow: var(--shadow-card);
}

.profile-photo {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 50%;
  flex-shrink: 0;
}

.profile-name {
  font-weight: 600;
  color: var(--primary);
  font-size: 20px;
}

.profile-role,
.profile-faculty {
  font-weight: 600;
  color: rgba(45, 48, 143, 0.5);
  font-size: 13px;
  line-height: 1.9;
}

/* ─── Action buttons ───────────────────────────────────────── */
.btn-edit-profile {
  background-color: var(--primary);
  color: #ffffff;
  font-weight: 600;
  font-size: 10px;
  border: none;
  border-radius: 7px;
  padding: 9px 15px;
  min-width: 155px;
  white-space: nowrap;
  transition: background-color 0.15s;
}
.btn-edit-profile:hover,
.btn-edit-profile:focus {
  background-color: #1e2070;
  color: #ffffff;
}

.btn-preview-profile {
  background-color: #ffffff;
  color: var(--accent);
  font-weight: 600;
  font-size: 10px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  padding: 9px 15px;
  min-width: 155px;
  white-space: nowrap;
  transition: background-color 0.15s;
}
.btn-preview-profile:hover,
.btn-preview-profile:focus {
  background-color: #f0f0ff;
  color: var(--accent);
  border: 1px solid var(--accent);
}

/* ─── Profile info fields ───────────────────────────────────── */
.profile-divider {
  border-color: rgba(207, 209, 255, 0.55);
  opacity: 1;
  margin: 16px 0;
}

/* Force LTR order so fields appear email→phone→date→degree→specialty
   from visual left to right — matching the Figma design */
.profile-info-row {
  align-items: stretch;
}

.profile-info-field {
  padding: 8px 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column !important;
}

.info-vdivider {
  width: 1px;
  background-color: rgba(207, 209, 255, 0.55);
  align-self: stretch;
  margin: 6px 0;
  flex-shrink: 0;
}

.info-field-label {
  font-weight: 600;
  color: var(--navy);
  font-size: 12px;
}

.info-field-icon {
  color: var(--navy);
  font-size: 12px;
}

.info-field-value {
  font-weight: 600;
  color: var(--primary);
  font-size: 9px;
  text-align: center;
  margin: 4px 0 0;
  direction: ltr; /* keep email / phone LTR */
}

/* ══════════════════════════════════════════════════════════════
   STAT MINI CARDS
   ══════════════════════════════════════════════════════════════ */
.stat-card {
  border: none;
  border-radius: 10px;
  box-shadow: var(--shadow-card);
}

.stat-cta {
  font-size: 12px !important;
}

.stat-icon-bubble {
  width: 35px;
  height: 35px;
  border-radius: 17.5px;
  background-color: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
  font-size: 18px;
}

.stat-label {
  font-weight: 600;
  color: var(--navy);
  font-size: 12px;
  line-height: 1.5;
}

.stat-number {
  font-weight: 600;
  color: var(--navy);
  font-size: 24px;
  line-height: 1.2;
}

.stat-unit {
  font-weight: 600;
  color: var(--primary);
  font-size: 10px;
}

.stat-cta {
  font-weight: 600;
  font-size: 8px;
  color: var(--accent) !important;
  text-decoration: none !important;
  transition: color 0.15s;
}
.stat-cta:hover {
  color: #1d22a0 !important;
}
.stat-cta i {
  font-size: 16px;
}

/* ══════════════════════════════════════════════════════════════
   BOTTOM PANELS
   ══════════════════════════════════════════════════════════════ */
.bottom-panel {
  border: none;
  border-radius: 10px;
  box-shadow: var(--shadow-card);
}

.panel-title {
  font-weight: 600;
  color: var(--navy);
  font-size: 15px;
}

.panel-icon {
  color: var(--navy);
  font-size: 18px;
  flex-shrink: 0;
}

/* ─── Bio panel ─────────────────────────────────────────────── */
.bio-container {
  border: 1px solid var(--accent-light) !important;
  background-color: rgba(217, 217, 217, 0.13);
  height: 85%;
}

.bio-text {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 12.6px;
  line-height: 1.7;
  direction: ltr;
}

/* ─── Completion panel ──────────────────────────────────────── */
.completion-percent {
  font-weight: 600;
  color: var(--navy);
  font-size: 24px;
  line-height: 1;
}

.completion-label {
  font-weight: 600;
  color: var(--primary);
  font-size: 8px;
}

.completion-progress {
  height: 5px;
  border-radius: 999px;
  background-color: var(--accent-light);
}

.completion-bar {
  background-color: var(--accent);
  border-radius: 999px;
}

/* Checklist box */
.completion-list {
  border: 1px solid var(--accent-light) !important;
  background-color: rgba(217, 217, 217, 0.13);
  overflow-y: scroll;
}

.completion-item {
  font-weight: 600;
  font-size: 10px;
  color: var(--text-muted);
  /* text is first DOM child → RIGHT in RTL, icon last → LEFT */
}

.icon-ok {
  color: var(--green-check);
  font-size: 15px;
  flex-shrink: 0;
}

.icon-fail {
  color: var(--red-x);
  font-size: 15px;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════════
   SIDEBAR COLLAPSE STATE
   ══════════════════════════════════════════════════════════════ */
.sidebar-collapsed .layout-wrapper {
  overflow: hidden;
}

.sidebar-collapsed .sidebar {
  width: 78px;
  min-width: 78px;
  transition: width 0.25s ease, min-width 0.25s ease;
}

.sidebar-collapsed .sidebar-header {
  padding-left: 0.5rem !important;
  padding-right: 0.5rem !important;
}

.sidebar-collapsed .sidebar-header div {
    justify-content: center !important;
}

.sidebar-collapsed .sidebar-logo-img {
    display: none;
}

.sidebar-collapsed .sidebar-uni-name,
.sidebar-collapsed .sidebar-uni-subtitle,
.sidebar-collapsed .nav-section-label,
.sidebar-collapsed .sidebar-sep,
.sidebar-collapsed .sidebar-item span {
  display: none !important;
}

.sidebar-collapsed .sidebar-item {
  justify-content: center !important;
  padding-left: 0.5rem !important;
  padding-right: 0.5rem !important;
}

.sidebar-collapsed .sidebar-item i,
.sidebar-collapsed .sidebar-item .sidebar-icon {
  margin: 0 auto;
}

.sidebar-collapsed .sidebar-item {
  position: relative;
}

.sidebar-collapsed .sidebar-item[title]::after {
  content: attr(title);
  position: absolute;
  right: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 2, 74, 0.96);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  padding: 6px 8px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 30;
}

.sidebar-collapsed .sidebar-item[title]:hover::after,
.sidebar-collapsed .sidebar-item[title]:focus-visible::after {
  opacity: 1;
}

.sidebar-collapsed .main-wrapper {
  min-width: 0;
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE ADJUSTMENTS
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
  .sidebar {
    width: 200px;
    min-width: 200px;
  }

  .sidebar-uni-subtitle {
    display: none;
  }

  .profile-info-row {
    flex-wrap: wrap;
  }

  .info-vdivider {
    display: none;
  }

  .profile-info-field {
    flex: 0 0 33.333%;
    border-bottom: 1px solid rgba(207, 209, 255, 0.4);
    padding: 10px 8px;
  }
}

@media (max-width: 959px) {
  body {
    overflow-x: hidden;
  }

  .layout-wrapper {
    width: calc(100% - 72px);
    max-width: calc(100% - 72px);
    margin-right: 72px;
    height: 100% !important;
    overflow: hidden;
    transition: width 0.25s ease, margin-right 0.25s ease;
  }

  .sidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 72px;
    min-width: 72px;
    height: 100%;
    overflow: hidden;
    z-index: 30;
    transition: width 0.25s ease, min-width 0.25s ease;
  }

  .sidebar-header {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }

  .sidebar-header > div {
    justify-content: center !important;
  }

  .sidebar-logo-img {
    display: none;
  }

  .sidebar-uni-name,
  .sidebar-uni-subtitle,
  .nav-section-label,
  .sidebar-sep,
  .sidebar-item span {
    display: none !important;
  }

  .sidebar-item {
    justify-content: center !important;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
    position: relative;
  }

  .sidebar-item i,
  .sidebar-item .sidebar-icon {
    margin: 0 auto;
  }

  .sidebar-item[title]::after {
    content: attr(title);
    position: absolute;
    right: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 2, 74, 0.96);
    color: #fff;
    font-size: 10px;
    line-height: 1.2;
    padding: 6px 8px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 30;
  }

  .sidebar-item[title]:hover::after,
  .sidebar-item[title]:focus-visible::after {
    opacity: 1;
  }

  .sidebar-mobile-expanded .layout-wrapper {
    width: 100%;
    max-width: 100%;
    margin-right: 0;
  }

  .sidebar-mobile-expanded .sidebar {
    width: 100vw;
    min-width: 100vw;
    z-index: 50;
    overflow-y: auto;
  }

  .sidebar-mobile-expanded .sidebar-nav,
  .sidebar-mobile-expanded .nav-section-label,
  .sidebar-mobile-expanded .sidebar-sep,
  .sidebar-mobile-expanded .sidebar-item span,
  .sidebar-mobile-expanded .sidebar-uni-name,
  .sidebar-mobile-expanded .sidebar-uni-subtitle {
    display: block !important;
  }

  .sidebar-mobile-expanded .sidebar-header > div {
    justify-content: space-between !important;
    width: 100%;
  }

  .sidebar-mobile-expanded .sidebar-header,
  .sidebar-mobile-expanded .sidebar-item {
    display: flex !important;
  }

  .sidebar-mobile-expanded .sidebar-item {
    justify-content: flex-start !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  .sidebar-mobile-expanded .sidebar-item i,
  .sidebar-mobile-expanded .sidebar-item .sidebar-icon {
    margin: 0;
  }

  .sidebar-mobile-expanded .sidebar-logo-img {
    display: block;
  }

  .sidebar-mobile-expanded .main-wrapper {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  .header-bar {
    height: 76px;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  .header-uni-logo {
    height: 45px;
  }

  .header-uni-name {
    font-size: 12px;
  }

  .header-uni-subtitle {
    font-size: 8px;
  }

  .header-user-name {
    font-size: 11px;
  }

  .content-area {
    /* height: auto;
    min-height: calc(100vh - 78px); */
    padding-left: 18px;
    padding-right: 18px;
  }

  .welcome-heading {
    font-size: 18px;
  }
  .page-subtitle {
    font-size: 10px;
  }


  .date-text {
    font-size: 11px;
  }

  .profile-card .card-body {
    padding: 1.2rem !important;
  }

  .profile-card .d-flex.justify-content-between.align-items-start {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
  }

  .profile-card .d-flex.justify-content-between.align-items-start > div:last-child {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .btn-edit-profile,
  .btn-preview-profile {
    min-width: 0;
    width: 100%;
  }

  .profile-info-row {
    flex-wrap: wrap;
  }

  .profile-info-field {
    flex: 0 0 33.333%;
    padding: 10px 8px;
  }

  .profile-photo {
    width: 88px;
    height: 88px;
  }

  .profile-name {
    font-size: 18px;
  }

  .profile-role,
  .profile-faculty {
    font-size: 12px;
  }

  .stat-card .card-body {
    padding: 0.9rem !important;
  }

  .stat-icon-bubble {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }

  .stat-label {
    font-size: 11px;
  }

  .stat-number {
    font-size: 22px;
  }

  .bio-text {
    font-size: 12px;
  }

  .completion-item {
    font-size: 10.5px;
  }
}

@media (max-width: 768px) {
  .layout-wrapper {
    display: block;
    height: auto;
    overflow: visible;
  }

  .sidebar {
    width: 72px;
    min-width: 72px;
  }

  .sidebar-mobile-expanded .sidebar {
    width: 100vw;
    min-width: 100vw;
  }

  .header-bar {
    height: auto;
    padding-top: 12px;
    padding-bottom: 12px;
    /* flex-wrap: wrap; */
    gap: 10px;
  }

  .header-user-name {
    font-size: 10px;
  }

  .header-uni-subtitle {
    display: none;
  }

  .content-area {
    padding: 1rem !important;
  }

  .welcome-heading {
    font-size: 16px;
  }
  .page-subtitle {
    font-size: 12px;
  }

  .date-text {
    font-size: 10px;
  }

  .profile-card .card-body > .d-flex {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .profile-card .card-body > .d-flex > :first-child {
    width: 100%;
  }

  .profile-card .card-body > .d-flex > :last-child {
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: stretch;
  }

  .profile-photo {
    width: 72px;
    height: 72px;
  }

  .profile-name {
    font-size: 16px;
  }

  .profile-info-field {
    flex: 0 0 50%;
  }

  .btn-edit-profile,
  .btn-preview-profile {
    min-width: 0;
    width: 100%;
    font-size: 9px;
    padding: 9px 12px;
  }

  .stat-card .card-body {
    padding: 0.8rem !important;
  }

  .stat-label {
    font-size: 10px;
  }

  .stat-number {
    font-size: 20px;
  }

  .panel-title {
    font-size: 14px;
  }

  .bio-text {
    font-size: 11.5px;
  }
}

@media (max-width: 480px) {
  .header-uni-logo {
    height: 38px;
  }

  .header-avatar {
    width: 38px;
    height: 38px;
  }

  .header-user-name {
    font-size: 9px;
  }

  .welcome-heading {
    font-size: 15px;
  }
  .page-subtitle {
    font-size: 10px;
  }

  .date-text {
    font-size: 9px;
  }

  .profile-card .card-body {
    padding: 1rem !important;
  }

  .profile-photo {
    width: 60px;
    height: 60px;
  }

  .profile-name {
    font-size: 15px;
  }

  .profile-role,
  .profile-faculty {
    font-size: 11px;
  }

  .profile-info-field {
    flex: 0 0 100%;
    border-bottom: 1px solid rgba(207, 209, 255, 0.4);
  }

  .row.g-3 .col-6 {
    width: 100%;
    flex: 0 0 100%;
    max-width: 100%;
  }

  .btn-edit-profile,
  .btn-preview-profile {
    font-size: 8px;
    padding: 8px 10px;
  }

  .info-field-label,
  .info-field-icon {
    font-size: 11px;
  }

  .info-field-value {
    font-size: 8px;
  }

  .stat-icon-bubble {
    width: 30px;
    height: 30px;
    font-size: 15px;
  }

  .completion-percent {
    font-size: 20px;
  }
  .date-pill {
    font-size: 8px;
    padding: 0 5px;
  }
  .date-pill i {
    font-size: 10px;
  }
}