@use '../../../src/sedna.scss' as sedna;

.CodeBox {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.14);
  border: 0;
  border-radius: 4px;
  background: var(--panel-background-alt);
  &-demo {
    padding: 42px 24px 50px;
  }
  &-meta {
    position: relative;
  }
  &-code {
    overflow: hidden;
    max-height: 0;
    // transition: max-height 0.4s;
    &.is-expand {
      max-height: 99999px;
    }
    pre {
      margin: 0;
      border-radius: 0;
    }
  }
}

.CodeBox {
  &-title {
    position: absolute;
    top: -10px;
    margin-left: 16px;
    padding: 1px 8px;
    background: var(--panel-background-alt);
    border-radius: 2px 2px 0 0;
    font-weight: 500;
  }
  &-description {
    border-top: 1px solid var(--border-color);
    padding: 18px 24px 12px;
  }
  &-actions {
    padding: 4px 0;
    text-align: center;
    border-top: 1px dashed var(--border-color);
    opacity: 0.7;

    display: flex;
    justify-content: center;
  }
  &-action {
    padding: 0.5rem;
    cursor: pointer;
    font-size: 1.2rem;
  }
}

.CodeBox {
  &-demo {
    .Space > *,
    & > * {
      margin-right: 8px;
      margin-bottom: 12px;
    }
    #TopMenuDemo-context {
      height: 400px;
      border: 1px solid var(--border-color);
    }

    .TopMenuDemo {
      a {
        padding: 0 12px;
        line-height: 2.25rem;
        &:hover {
          background: var(--hover-background);
          color: var(--sn-color-1);
        }
      }
    }

    .TopMenuDemo {
      @include sedna.to(l) {
        &-wrapper {
          background: rgba(black, 0.5);
          position: fixed;
          width: 100vw;
          height: 100vh;
          z-index: 9999;
          left: -100vw;
          top: 0;
        }
        width: 220px;
        background: var(--panel-background);
        height: 100vh;
      }
    }

    .TopMenuDemo-is-show {
      .TopMenuDemo-wrapper {
        left: 0;
      }
    }

    .TopMenuDemo {
      @include sedna.from(l) {
        li ul {
          min-width: 200px;
          border: 1px solid var(--border-color);
        }
      }
    }

    #TopMenuDemo-toggle {
      @include sedna.from(l) {
        display: none;
      }
    }
  }
}

// GRID
.CodeBox-demo{
  .DocGrid{
    background: var(--panel-background) !important;
    & > * {
      min-height: 100px;
      background: var(--sn-color-1);
      color: var(--sn-color-1-i);
      font-weight: bold;
      display: grid;
      align-content: center;
      justify-content: center;
    }
  }
}
