/* EZ Smart Courses — dashboard application layout
 * Single source of truth for the standalone account shell.
 * Visual components remain in front.css/home.css.
 */

body.ezsc-dashboard-app {
  min-height: 0;
  overflow: hidden;
}

body.ezsc-dashboard-app .ezsc-dashboard-shell {
  position: fixed;
  inset: 0;
  width: auto;
  height: auto;
  min-height: 0;
  padding: 10px;
  overflow: hidden;
  box-sizing: border-box;
}

body.admin-bar.ezsc-dashboard-app .ezsc-dashboard-shell {
  top: 32px;
}

body.ezsc-dashboard-app .ezsc-dashboard-frame {
  width: 100%;
  max-width: none;
  height: 100%;
  min-height: 0;
  padding: 0;
  gap: 12px;
  align-items: stretch;
  box-sizing: border-box;
}

body.ezsc-dashboard-app .ezsc-dashboard-sidebar {
  flex: 0 0 270px;
  width: 270px;
  height: auto;
  min-height: 0;
  max-height: 100%;
  align-self: stretch;
  overflow: hidden;
  border-radius: 24px;
  box-sizing: border-box;
}

body.ezsc-dashboard-app .ezsc-dashboard-sidebar-inner {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  box-sizing: border-box;
}

body.ezsc-dashboard-app .ezsc-dashboard-main {
  flex: 1 1 auto;
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  align-self: stretch;
  overflow: hidden;
  gap: 0;
}

body.ezsc-dashboard-app .ezsc-dashboard-content-card {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  box-sizing: border-box;
}

/* Tablet + mobile: the desktop sidebar becomes a fixed bottom navigation. */
.ezsc-dashboard-bottom-nav {
  display: none;
}

@media (max-width: 1024px) {
  body.ezsc-dashboard-app .ezsc-dashboard-sidebar {
    display: none;
  }

  body.ezsc-dashboard-app .ezsc-dashboard-frame {
    gap: 0;
  }

  body.ezsc-dashboard-app .ezsc-dashboard-main {
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
  }

  body.ezsc-dashboard-app .ezsc-dashboard-content-card {
    padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  }

  body.ezsc-dashboard-app .ezsc-dashboard-bottom-nav {
    position: fixed;
    z-index: 10020;
    right: 14px;
    left: 14px;
    bottom: max(10px, env(safe-area-inset-bottom, 0px));
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: stretch;
    min-height: 72px;
    padding: 8px 10px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 22px;
    background: linear-gradient(180deg, var(--ezsc-primary,#111827), color-mix(in srgb, var(--ezsc-primary,#111827) 88%, #ffffff));
    box-shadow: 0 18px 44px rgba(15,23,42,.24);
    box-sizing: border-box;
  }

  body.ezsc-dashboard-app .ezsc-dashboard-bottom-link {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 0;
    min-height: 56px;
    padding: 6px 4px;
    border-radius: 16px;
    color: rgba(255,255,255,.74);
    text-decoration: none;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
    box-sizing: border-box;
  }

  body.ezsc-dashboard-app .ezsc-dashboard-bottom-link img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    opacity: .76;
  }

  body.ezsc-dashboard-app .ezsc-dashboard-bottom-link.is-active {
    background: var(--ezsc-accent,#2563eb);
    color: #fff;
    box-shadow: 0 10px 24px color-mix(in srgb, var(--ezsc-accent,#2563eb) 26%, transparent);
  }

  body.ezsc-dashboard-app .ezsc-dashboard-bottom-link.is-active img {
    opacity: 1;
  }
}

@media (max-width: 782px) {
  body.admin-bar.ezsc-dashboard-app .ezsc-dashboard-shell {
    top: 46px;
  }
}

@media (max-width: 767px) {
  body.ezsc-dashboard-app .ezsc-dashboard-shell {
    padding: 8px;
  }

  body.ezsc-dashboard-app .ezsc-dashboard-frame {
    gap: 8px;
  }

  body.ezsc-dashboard-app .ezsc-dashboard-bottom-nav {
    right: 8px;
    left: 8px;
    min-height: 68px;
    padding-inline: 6px;
    border-radius: 20px;
  }

  body.ezsc-dashboard-app .ezsc-dashboard-bottom-link {
    min-height: 52px;
    font-size: 10px;
  }

  body.ezsc-dashboard-app .ezsc-dashboard-bottom-link img {
    width: 21px;
    height: 21px;
  }
}
