/* SPA page routing — hide all pages until JS activates one */
.row[id^="page"] {
  display: none !important;
}

.row[id^="page"].page-active {
  display: flex !important;
}

/* Nav items hidden until logged in */
#menuAccount,
#menuMessaging,
#menuSearch {
  display: none;
}

#editPrivateUser,
#editCompanyUser {
  display: none;
}

.register-type-card {
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.register-type-card:hover {
  background-color: rgba(44, 123, 229, 0.08);
}

.register-type-card.border-primary {
  border-width: 2px;
}

.navbar-brand {
  margin-left: 1rem;
}

.fm-brand {
  padding-top: 0;
  padding-bottom: 0;
}

.navbar-brand.fm-brand > img.fm-brand-lockup {
  display: block;
  height: 3rem;
  max-height: 3rem;
  width: auto;
}

/* Auth layout (Dashkit sign-in-cover) */
.auth-page.page-active {
  border-top: 2px solid var(--bs-primary);
  background-color: #f9fbfd;
}

.auth-layout {
  min-height: calc(100vh - 120px);
}

.auth-cover-panel {
  min-height: calc(100vh - 120px);
  border-radius: 0;
}

.bg-cover {
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

/* Messaging */
.messaging-inbox-list {
  max-height: 70vh;
  overflow-y: auto;
}

.fm-application-process-editor .fm-application-process-step-input {
  min-width: 0;
}

.fm-application-process-editor .avatar-title {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 600;
}

.profile-company-talent-view .list-group-activity .list-group-item,
.profile-company-talent-main .list-group-activity .list-group-item {
  position: relative;
}

.profile-company-talent-main .list-group-activity .list-group-item {
  padding-left: 0;
  padding-right: 0;
}


.messaging-thread-pane {
  min-height: 70vh;
}

.messaging-messages-pane {
  background-color: #f9fbfd;
  min-height: 420px;
  max-height: 60vh;
}

#messagingInboxList .list-group-item.active {
  background-color: #edf2f9;
}

#messagingThread.d-none {
  display: none !important;
}

#messagingThread:not(.d-none) {
  display: flex !important;
  flex-direction: column;
  flex-grow: 1;
}

/* Bottom right text */
.bottom-right {
  position: absolute;
  bottom: 0px;
  right: 0px;
}

.text-over-image-overlay {
  position: absolute;
  text-align: center;
  top: 50%;
  left: 50%;
  color: white;
  transform: translate(-50%, -50%);
}

/* Profile map (Leaflet) */
.fm-map {
  width: 100%;
  height: 100%;
}

.fm-map--empty {
  background: var(--bs-light);
  color: var(--bs-secondary);
}

.fm-map__placeholder {
  height: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  text-align: center;
  font-size: 0.875rem;
}

.fm-map .leaflet-control-zoom {
  border: none;
  box-shadow: 0 0.125rem 0.375rem rgba(18, 38, 63, 0.12);
}

.fm-map .leaflet-control-zoom a {
  width: 2rem;
  height: 2rem;
  line-height: 2rem;
  color: #12263f;
  background: #fff;
}

.fm-map .leaflet-control-zoom a:hover {
  background: #edf2f9;
}

.fm-map .leaflet-control-attribution {
  font-size: 0.625rem;
}

/* Search page (crm-contacts style) */
.search-filter-menu {
  min-width: 20rem;
  max-width: 24rem;
}

.search-filter-list {
  max-height: 12rem;
  overflow-y: auto;
}

.search-filter-list .list-group-item {
  cursor: pointer;
  user-select: none;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

.search-name-cell {
  white-space: nowrap;
}

.search-name-cell .avatar {
  flex-shrink: 0;
}

/* Profile inline editing */
.fm-field-edit {
  line-height: 1;
  opacity: 0.55;
}

.fm-field-edit:hover {
  opacity: 1;
}

.fm-editable-field .fm-inline-edit-form {
  max-width: 20rem;
  margin-left: auto;
}

/* Home dashboard */

#homeDashboard .header-tabs .nav-link {
  cursor: default;
}

#homeDashboard .home-messages-table tbody tr {
  border-top: none;
  border-bottom: none;
}

#homeDashboard .home-messages-table tbody td {
  border: none;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

#homeDashboard .home-messages-table tbody tr:first-child td {
  padding-top: 1rem;
}

#homeDashboard .home-messages-row {
  cursor: pointer;
}

#homeDashboard .home-messages-row:hover td {
  background-color: #f9fbfd;
}

#pageProfile .header-body {
  position: relative;
  z-index: 2;
  overflow: visible;
}

#pageProfile .profile-header-main {
  align-items: flex-start;
}

#pageProfile .profile-header-info {
  min-width: 0;
  padding-top: 0;
}

#pageProfile .profile-header-info .header-pretitle {
  margin-top: 0;
}

#pageProfile .profile-header-headline {
  margin-top: 0.25rem;
}

#pageProfile .profile-header-headline.d-none {
  margin-top: 0;
}

#pageProfile .profile-header-info .profile-header-badges:empty {
  display: none;
}

#pageProfile #profileHeaderName {
  line-height: 1.2;
  color: #12263f;
}

#pageProfile .profile-header-name-field {
  min-width: 0;
}

#pageProfile .profile-header-name-row {
  min-width: 0;
}

#pageProfile .profile-header-name-field .fm-field-edit {
  flex-shrink: 0;
  line-height: 1;
  opacity: 0.65;
}

#pageProfile .profile-header-name-field .fm-field-edit:hover {
  opacity: 1;
}

#pageProfile .profile-header-name-field .fm-inline-edit-form {
  width: 100%;
  max-width: 20rem;
  margin-left: 0;
}

#pageProfile .profile-header-avatar {
  position: relative;
  display: block;
}

#pageProfile .profile-header-avatar--editable {
  cursor: pointer;
}

#pageProfile .profile-header-avatar--editable:focus-visible {
  outline: 2px solid #2c7be5;
  outline-offset: 2px;
  border-radius: 50%;
}

#pageProfile .profile-header-avatar-edit {
  z-index: 2;
  pointer-events: none;
  font-size: 1.5rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

#pageProfile .profile-header-avatar--editable::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(18, 38, 63, 0);
  transition: background 0.15s ease;
  pointer-events: none;
}

#pageProfile .profile-header-avatar--editable:hover::after,
#pageProfile .profile-header-avatar--editable:focus-visible::after {
  background: rgba(18, 38, 63, 0.35);
}

.fm-profile-video-wrap {
  background-color: #f9fbfd;
  line-height: 0;
}

.fm-profile-video {
  display: block;
  width: 100%;
  max-height: min(70vh, 720px);
  background-color: #f9fbfd;
  object-fit: contain;
  vertical-align: top;
}

#pageProfile .avatar-title .fe-user,
#pageProfile .avatar-title .fe-briefcase {
  font-size: 1.75rem;
}

#pageProfile .header-avatar-top .avatar-title .fe-user,
#pageProfile .header-avatar-top .avatar-title .fe-briefcase {
  font-size: 2.5rem;
}

#pageProfile .header-tabs .nav-link {
  cursor: pointer;
}

#pageProfile #profileTalentStatTabs .nav-link {
  cursor: pointer;
}

#pageProfile .profile-stat-tabs {
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

#pageProfile .profile-stat-tabs::-webkit-scrollbar {
  display: none;
}

#pageProfile .profile-stat-tabs .nav-item {
  flex-shrink: 0;
}

#pageProfile .profile-header-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

#pageProfile .profile-header-badges .badge {
  font-weight: 500;
}

#pageProfile .profile-header-actions .btn {
  min-height: 2.5rem;
}

#pageProfile .profile-about-hero {
  background: linear-gradient(135deg, #f9fbfd 0%, #edf2f9 100%);
  border: none;
}

#pageProfile .profile-about-summary {
  line-height: 1.6;
}

#pageProfile .profile-view-about {
  padding: 0;
}

#pageProfile .profile-view-about > .card:first-child {
  margin-top: 0;
}

#pageProfile .profile-view-stack > .card:last-child {
  margin-bottom: 0;
}

#pageProfile .profile-view-post-card {
  overflow: hidden;
}

#pageProfile .profile-view-video-top {
  line-height: 0;
  padding: 1.25rem 0;
}

#pageProfile .profile-view-video-top .fm-profile-video-wrap {
  border-radius: 0;
  margin-bottom: 0;
  width: 100%;
}

@media (min-width: 992px) {
  #pageProfile .profile-view-video-top {
    padding: 1.25rem;
  }

  #pageProfile .profile-view-video-top .fm-profile-video-wrap {
    border-radius: 0.375rem;
    max-width: 30rem;
    margin-left: auto;
    margin-right: auto;
  }
}

#pageProfile .profile-view-post-card > .card-body {
  padding-top: 1.25rem;
}

#pageProfile .profile-view-video-top + .card-body {
  padding-top: 0;
}

#pageProfile .profile-view-cv-card .card-body > .card {
  margin-bottom: 0;
  box-shadow: none;
}

#pageProfile .profile-view-company-about .avatar-sm {
  width: 2rem;
  height: 2rem;
}

#pageProfile .profile-view-stack .card-header-title .fe {
  opacity: 0.85;
}

#editCompanyUser .card-header-title .fe {
  opacity: 0.85;
}

#pageProfile .profile-address-display {
  white-space: normal;
  word-break: break-word;
  line-height: 1.4;
}

.fm-company-address-lines .fm-company-address-line + .fm-company-address-line {
  margin-top: 0.125rem;
}

.fm-company-address-badge.fm-company-address-badge {
  white-space: normal;
  text-align: left;
  line-height: 1.35;
  max-width: 100%;
}

.fm-company-address-badge .fe-map-pin {
  vertical-align: top;
  margin-top: 0.15rem;
}

#pageProfile .profile-address-field .fm-inline-edit-form {
  width: 100%;
}

#editCompanyUser .table-responsive {
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 767.98px) {
  #pageProfile .profile-header-actions {
    width: 100%;
  }

  #pageProfile .profile-header-actions .btn {
    width: 100%;
    margin-right: 0 !important;
    margin-bottom: 0.5rem;
  }

  #pageProfile .profile-view-company-about .col-6 {
    flex: 0 0 100%;
    max-width: 100%;
  }

  #companyTeamInviteSection .col-md-4 .btn {
    margin-top: 0.25rem;
  }
}

#pageProfile .profile-cv-preview-wrap {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#pageProfile .profile-cv-preview-frame {
  display: block;
  width: 100%;
  height: min(70vh, 900px);
  border: 1px solid var(--bs-border-color, #e3ebf6);
  border-radius: 0.375rem;
  background-color: #f9fbfd;
}

#pageProfile .profile-cv-preview-docx {
  max-height: min(70vh, 900px);
  overflow: auto;
  padding: 1.25rem;
  border: 1px solid var(--bs-border-color, #e3ebf6);
  border-radius: 0.375rem;
  background-color: #fff;
  font-size: 0.9375rem;
  line-height: 1.6;
}

#pageProfile .profile-cv-preview-docx p {
  margin-bottom: 0.75rem;
}

#pageProfile .profile-cv-preview-docx p:last-child {
  margin-bottom: 0;
}

#pageProfile .profile-cv-preview-fallback {
  border: 1px solid var(--bs-border-color, #e3ebf6);
  border-radius: 0.375rem;
  background-color: #f9fbfd;
}

#pageProfile .profile-empty-state {
  padding-left: 1rem;
  padding-right: 1rem;
}

#pageProfile .avatar-xs .fe {
  font-size: 0.75rem;
}

#pageProfile .fm-pill-group .btn.active,
#pageProfile .fm-toggle-group .btn.active {
  color: #fff;
}

#pageProfile .choices__inner {
  min-height: 2.75rem;
}

#pageProfile .choices__list--multiple .choices__item {
  background-color: #2c7be5;
  border-color: #2c7be5;
}

@media (max-width: 767.98px) {
  #pageProfile .header-title,
  #pageProfile #profileHeaderName {
    font-size: 1.35rem;
  }

  #pageProfile .header-avatar-top {
    width: 4.5rem;
    height: 4.5rem;
  }

  #pageProfile .profile-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  #pageProfile .profile-header-actions .btn {
    flex: 1 1 auto;
    min-width: calc(50% - 0.25rem);
  }

  #pageProfile .profile-header-actions .btn-primary {
    flex-basis: 100%;
  }

  #pageProfile #profileTalentStatTabs .nav-link {
    min-width: 5.5rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  #pageProfile #profileTalentStatTabs h3 {
    font-size: 1.25rem;
  }

  #pageProfile .header-tabs .nav-link {
    font-size: 0.8125rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    white-space: nowrap;
  }

  #pageProfile .col-xl-4 > .card {
    margin-bottom: 1rem;
  }
}

@media (max-width: 767.98px) {
  #pageProfile .fm-editable-field .fm-inline-edit-form {
    max-width: 100%;
    margin-left: 0;
  }

  #pageProfile .profile-save-bar {
    position: sticky;
    bottom: 0;
    z-index: 10;
    background: #f9fbfd;
    padding: 0.75rem 0;
    margin-left: -0.25rem;
    margin-right: -0.25rem;
    border-top: 1px solid #e3ebf6;
  }
}

@media (min-width: 768px) {
  #pageProfile .profile-save-bar {
    padding-bottom: 1rem;
  }
}

/* Align list items with card-header title padding */
#homeDashboard .home-profile-list .list-group-item,
#homeDashboard .home-vacancy-list .list-group-item {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

#homeDashboard .home-profile-list .fe-image,
#homeDashboard .home-profile-list .fe-user,
#homeDashboard .home-profile-list .fe-search {
  font-size: 1.125rem;
  vertical-align: -0.125em;
}

.fm-status-dot {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.fm-status-dot--active {
  background-color: var(--bs-success);
}

.fm-status-dot--inactive {
  background-color: var(--bs-danger);
}

.rich-text-editor-wrap {
  width: 100%;
}

.rich-text-editor-wrap .ql-toolbar.ql-snow {
  width: 100%;
  border-top-left-radius: var(--bs-border-radius, 0.375rem);
  border-top-right-radius: var(--bs-border-radius, 0.375rem);
}

.rich-text-editor.ql-container,
.rich-text-editor.ql-snow.ql-container,
.ql-toolbar.ql-snow + .rich-text-editor.ql-container {
  width: 100%;
  height: auto;
  min-height: 8rem;
  border-bottom-left-radius: var(--bs-border-radius, 0.375rem);
  border-bottom-right-radius: var(--bs-border-radius, 0.375rem);
}

.rich-text-editor .ql-editor,
.rich-text-editor.ql-container .ql-editor {
  height: auto;
  min-height: 8rem;
  overflow-y: visible;
}

.rich-text-display p:last-child {
  margin-bottom: 0;
}

.rich-text-display ul,
.rich-text-display ol {
  margin-bottom: 0.5rem;
  padding-left: 1.25rem;
}

.rich-text-display blockquote {
  margin-bottom: 0.5rem;
  padding-left: 1rem;
  border-left: 3px solid var(--bs-border-color);
  color: var(--bs-secondary-color);
}
