/*
* demo.css
* File include item demo only specific css only
******************************************************************************/

.menu .app-brand.demo {
  height: 64px;
}

.app-brand-logo.demo svg {
  width: 34px;
  height: 24px;
}

.app-brand-text.demo {
  font-size: 1.375rem;
}

/* ! For .layout-navbar-fixed added fix padding top to .layout-page */
/* Default navbar */
.layout-navbar-fixed .layout-wrapper:not(.layout-without-menu) .layout-page {
  padding-top: 64px !important;
}
.layout-navbar-fixed .layout-wrapper:not(.layout-horizontal):not(.layout-without-menu) .layout-page {
  padding-top: 72px !important;
}
/* Navbar page z-index issue solution */
.content-wrapper .navbar {
  z-index: auto;
}

/*
* Content
******************************************************************************/

.demo-blocks > * {
  display: block !important;
}

.demo-inline-spacing > * {
  margin: 1rem 0.375rem 0 0 !important;
}

/* ? .demo-vertical-spacing class is used to have vertical margins between elements. To remove margin-top from the first-child, use .demo-only-element class with .demo-vertical-spacing class. For example, we have used this class in forms-input-groups.html file. */
.demo-vertical-spacing > * {
  margin-top: 1rem !important;
  margin-bottom: 0 !important;
}
.demo-vertical-spacing.demo-only-element > :first-child {
  margin-top: 0 !important;
}

.demo-vertical-spacing-lg > * {
  margin-top: 1.875rem !important;
  margin-bottom: 0 !important;
}
.demo-vertical-spacing-lg.demo-only-element > :first-child {
  margin-top: 0 !important;
}

.demo-vertical-spacing-xl > * {
  margin-top: 5rem !important;
  margin-bottom: 0 !important;
}
.demo-vertical-spacing-xl.demo-only-element > :first-child {
  margin-top: 0 !important;
}

/* Dropdown buttons going out of small screens */
@media (max-width: 576px) {
  #dropdown-variation-demo .btn-group .text-truncate {
    width: 254px;
    position: relative;
  }
  #dropdown-variation-demo .btn-group .text-truncate::after {
    position: absolute;
    top: 45%;
    right: 0.65rem;
  }
}

/*
* Layout demo
******************************************************************************/

.layout-demo-wrapper {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  margin-top: 1rem;
}
.layout-demo-placeholder img {
  width: 900px;
}
.layout-demo-info {
  text-align: center;
  margin-top: 1rem;
}

/* Keep globally upgraded Select2 fields aligned with Bootstrap form controls. */
.select2-container:not(.select2-container--open) {
  width: 100% !important;
  max-width: 100%;
}

.select2-container .select2-selection--single,
.select2-container .select2-selection--multiple {
  width: 100%;
}

/* Phone-first table to cards responsive styling */
@media (max-width: 767.98px) {
  .phone-first-card-header {
    align-items: flex-start !important;
    flex-direction: column !important;
  }

  .phone-first-actions {
    width: 100% !important;
    display: flex !important;
    gap: 0.5rem !important;
  }

  .phone-first-actions .btn {
    flex: 1 1 0 !important;
    min-width: 0 !important;
  }

  .phone-first-wrap {
    overflow-x: visible !important;
  }

  .phone-first-table {
    min-width: 0 !important;
  }

  .phone-first-table thead {
    display: none !important;
  }

  .phone-first-table,
  .phone-first-table tbody,
  .phone-first-table tr,
  .phone-first-table td {
    display: block !important;
    width: 100% !important;
  }

  .phone-first-table tbody {
    padding: 1rem !important;
  }

  .phone-first-table tr {
    border: 1px solid var(--bs-border-color) !important;
    border-radius: .5rem !important;
    margin-bottom: 1rem !important;
    overflow: hidden !important;
    background-color: var(--bs-card-bg) !important;
  }

  .phone-first-table tr:last-child {
    margin-bottom: 0 !important;
  }

  .phone-first-table td {
    border-bottom: 1px solid var(--bs-border-color) !important;
    padding: .875rem 1rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 1rem !important;
  }

  .phone-first-table td:last-child {
    border-bottom: 0 !important;
  }

  .phone-first-table td[data-label] {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 1rem !important;
  }

  .phone-first-table td[data-label]::before {
    content: attr(data-label);
    color: var(--bs-secondary-color) !important;
    font-size: .8125rem !important;
    font-weight: 600 !important;
    flex: 0 0 auto !important;
    text-align: left !important;
  }

  /* Override custom flex cell layout when stacked */
  .phone-first-table td.details-cell,
  .phone-first-table td.student-details-cell {
    display: block !important;
    text-align: left !important;
  }

  .phone-first-table td.details-cell::before,
  .phone-first-table td.student-details-cell::before {
    display: block !important;
    margin-bottom: .625rem !important;
  }
}

/* Student dashboard phone UI */
.student-mobile-dashboard {
  display: none;
}

@media (max-width: 767.98px) {
  body.student-mobile-app {
    --student-mobile-safe-top: max(env(safe-area-inset-top), 18px);
    background: #f6f8fb;
    overflow-x: hidden;
  }

  body.student-mobile-app.is-android-app {
    --student-mobile-safe-top: max(env(safe-area-inset-top), 26px);
  }

  body.student-mobile-app .content-footer {
    display: none !important;
  }

  body.student-mobile-app .layout-wrapper,
  body.student-mobile-app .layout-page,
  body.student-mobile-app .content-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    overflow-x: hidden !important;
  }

  body.student-mobile-app .content-wrapper {
    background: #f6f8fb;
  }

  body.student-mobile-app:not(.student-dashboard-screen) .container-p-y {
    max-width: 430px !important;
    margin: 0 auto !important;
    padding: 18px 14px calc(88px + env(safe-area-inset-bottom)) !important;
  }

  body.student-mobile-app:not(.student-dashboard-screen) .card {
    border: 1px solid #e7edf5;
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
  }

  body.student-mobile-app:not(.student-dashboard-screen) .card-body,
  body.student-mobile-app:not(.student-dashboard-screen) .card-header {
    padding: 18px;
  }

  body.student-mobile-app:not(.student-dashboard-screen) h4 {
    color: #172033;
    font-size: 24px;
    line-height: 1.15;
  }

  .student-app-mobile-header {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 42px 44px;
    align-items: center;
    gap: 9px;
    width: calc(100% - 24px);
    max-width: 430px;
    margin: calc(var(--student-mobile-safe-top) + 10px) auto 6px;
    padding: 9px;
    border: 1px solid #edf1f6;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
    opacity: 1;
    filter: none;
    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
    position: relative;
    z-index: 2;
  }

  .student-app-schoolmark,
  .student-app-icon-btn,
  .student-app-avatar {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e6ebf2;
    border-radius: 10px;
    background: #ffffff;
  }

  .student-app-schoolmark {
    color: #2463eb;
    font-size: 16px;
    font-weight: 700;
  }

  .student-app-school-title {
    min-width: 0;
  }

  .student-app-school-title span {
    display: block;
    overflow: hidden;
    color: #101828;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .student-app-school-title small {
    display: block;
    color: #667085;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.2;
  }

  .student-app-icon-btn {
    position: relative;
    color: #344054;
    font-size: 19px;
  }

  .student-app-icon-btn span {
    position: absolute;
    top: 8px;
    right: 9px;
    width: 7px;
    height: 7px;
    border: 1px solid #ffffff;
    border-radius: 50%;
    background: #f04438;
  }

  .student-app-avatar {
    padding: 0;
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .student-app-avatar img {
    width: 42px !important;
    height: 42px !important;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 8px 18px rgba(36, 99, 235, 0.15);
  }

  .student-mobile-dashboard {
    display: block;
    width: 100%;
    max-width: 440px;
    box-sizing: border-box;
    min-height: 100vh;
    margin: 0 auto;
    padding: 14px 14px calc(84px + env(safe-area-inset-bottom));
    color: #111827;
    background: linear-gradient(180deg, #fbfcff 0%, #f5f8fc 42%, #eef4f8 100%);
    overflow-x: hidden;
  }

  .student-mobile-dashboard a {
    color: inherit;
  }

  .student-mobile-topbar {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    opacity: 1;
    filter: none;
    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
  }

  .student-mobile-schoolmark,
  .student-mobile-icon-btn {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
  }

  .student-mobile-schoolmark {
    color: #2463eb;
    font-size: 17px;
    font-weight: 800;
  }

  .student-mobile-icon-btn {
    position: relative;
    color: #1f2937;
    font-size: 20px;
  }

  .student-mobile-icon-btn span {
    position: absolute;
    top: 8px;
    right: 9px;
    width: 7px;
    height: 7px;
    border: 1px solid #ffffff;
    border-radius: 50%;
    background: #f04438;
  }

  .student-mobile-school span,
  .student-mobile-profile h1,
  .student-mobile-feature strong,
  .student-mobile-wide-card strong,
  .student-mobile-tile strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .student-mobile-school span {
    display: block;
    color: #111827;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.2;
  }

  .student-mobile-school small {
    display: block;
    color: #6b7280;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.2;
  }

  .student-mobile-profile {
    position: relative;
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) 30px;
    align-items: center;
    gap: 12px;
    min-height: 78px;
    margin-bottom: 14px;
    padding: 11px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 8px;
    background:
      linear-gradient(90deg, rgba(37, 99, 235, 0.08), transparent 34%),
      #ffffff;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
  }

  .student-mobile-profile img {
    width: 56px !important;
    min-width: 56px !important;
    max-width: 56px !important;
    height: 56px !important;
    min-height: 56px !important;
    max-height: 56px !important;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.18);
  }

  .student-mobile-profile h1 {
    max-width: 100%;
    margin: 0 0 3px;
    color: #111827;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.15;
  }

  .student-mobile-profile p {
    margin: 0;
    color: #64748b;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.35;
  }

  .student-mobile-profile p span {
    margin-left: 6px;
  }

  .student-mobile-main-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 10px;
  }

  .student-mobile-feature,
  .student-mobile-wide-card,
  .student-mobile-tile {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.92);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.07);
    transform: translateZ(0);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
  }

  .student-mobile-feature:active,
  .student-mobile-wide-card:active,
  .student-mobile-tile:active {
    transform: scale(0.985);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  }

  .student-mobile-feature {
    min-height: 128px;
    padding: 14px;
  }

  .student-mobile-feature-learning {
    background: linear-gradient(135deg, #ecf7ff 0%, #ffffff 72%);
    border-color: #c9e8ff;
  }

  .student-mobile-feature-notice {
    background: linear-gradient(135deg, #f8f1ff 0%, #ffffff 72%);
    border-color: #eadbff;
  }

  .student-mobile-feature-icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    border-radius: 50%;
    color: #ffffff;
    background: linear-gradient(135deg, #2d8cff, #1166df);
    box-shadow: 0 12px 22px rgba(45, 140, 255, 0.22);
    font-size: 21px;
  }

  .student-mobile-feature-notice .student-mobile-feature-icon {
    background: linear-gradient(135deg, #8b5cf6, #6d3ee7);
    box-shadow: 0 12px 22px rgba(139, 92, 246, 0.22);
  }

  .student-mobile-feature strong,
  .student-mobile-wide-card strong,
  .student-mobile-tile strong {
    display: block;
    color: #111827;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.18;
  }

  .student-mobile-feature small,
  .student-mobile-wide-card small,
  .student-mobile-wide-card em,
  .student-mobile-tile small {
    display: block;
    color: #6b7280;
    font-size: 10.5px;
    font-style: normal;
    font-weight: 600;
    line-height: 1.3;
  }

  .student-mobile-feature em {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 13px;
    padding: 7px 10px;
    border-radius: 7px;
    color: #1f3f66;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
    font-size: 10.5px;
    font-style: normal;
    font-weight: 800;
  }

  .student-mobile-wide-card {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) 38px;
    align-items: center;
    gap: 12px;
    min-height: 86px;
    margin-bottom: 10px;
    padding: 13px;
    background: linear-gradient(135deg, #effdf4 0%, #ffffff 76%);
    border-color: #c8efd7;
  }

  .student-mobile-wide-icon {
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #ffffff;
    background: linear-gradient(135deg, #21a366, #0f8d59);
    box-shadow: 0 12px 22px rgba(15, 141, 89, 0.2);
    font-size: 22px;
  }

  .student-mobile-wide-card > .icon-base {
    color: #21a366;
    font-size: 30px;
    opacity: 0.78;
  }

  .student-mobile-tile-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
  }

  .student-mobile-tile {
    min-height: 88px;
    padding: 10px 9px;
  }

  .student-mobile-tile span {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    border-radius: 7px;
    color: #ffffff;
    font-size: 18px;
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.12);
  }

  .student-mobile-tile strong {
    font-size: 11.5px;
    line-height: 1.2;
  }

  .student-mobile-tile small {
    margin-top: 3px;
    font-size: 9.5px;
  }

  .student-mobile-tile .bg-orange {
    background: #ff8a3d;
  }

  .student-mobile-tile .bg-pink {
    background: #f472b6;
  }

  .student-mobile-tile .bg-cyan {
    background: #06b6d4;
  }

  .student-mobile-tile .bg-yellow {
    background: #f5b82e;
  }

  .student-mobile-bottom-nav {
    position: fixed;
    left: 50%;
    bottom: 0;
    z-index: 1040;
    width: 100%;
    max-width: 440px;
    display: flex;
    gap: 2px;
    padding: 9px 9px calc(9px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(226, 232, 240, 0.9);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 -14px 30px rgba(15, 23, 42, 0.1);
    transform: translateX(-50%);
  }

  .student-mobile-bottom-nav a {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: #7b8797;
    font-size: 9px;
    font-weight: 600;
    line-height: 1.1;
  }

  .student-mobile-bottom-nav i {
    font-size: 18px;
  }

  .student-mobile-bottom-nav a.active {
    color: #2463eb;
  }
}
