@use "../../../styles/mixins";

.container {
  display: grid;
  grid-template-areas:
    "topbar"
    "main";
  grid-template-rows: auto 1fr;
  grid-template-columns: 1fr;
  height: 100vh;
  transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);

  @media (min-width: 768px) {
    grid-template-areas:
      "sidebar topbar"
      "sidebar main";
    grid-template-rows: auto 1fr;
    grid-template-columns: 280px 1fr;

    &.closed {
      grid-template-areas:
        "topbar"
        "main";
      grid-template-columns: 1fr;
    }
  }

  .main {
    grid-area: main;
    padding: var(--hi-spacing-lg);
    padding-bottom: calc(var(--hi-spacing-lg) + 40px);
    overflow: auto;
    background-color: #f9fafc;

    @include mixins.scrollbar;

    @media (max-width: 767px) {
      padding: 16px 16px 56px;
    }
  }

  .sidebarOpen {
    width: 28px;
    height: 28px;
    background: var(--hi-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 5;
    transition: all 0.2s ease;

    &:hover {
      transform: translateY(-50%) scale(1.05);
      box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    }

    @media (max-width: 767px) {
      display: none;
    }
  }

  .sidebarClose {
    @extend .sidebarOpen;
  }

  .overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 150;
    display: none;

    @media (max-width: 767px) {
      &.open {
        display: block;
      }
    }
  }

}
