@layer reset, layout, components, overrides;

@layer compoments.demo {
  @scope (.shell-viewport) {
    .html,
    .body {
      margin: 0;
      padding: 0;
    }

    .html {
      background: white;
      color: black;
    }
  }
}

@layer components.browser {
  .shell-nav-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);;
    backdrop-filter: blur(16px);
    z-index: 10;
  }

  .shell-nav-bar button {
    background: transparent;
    border: 1px solid rgba(148, 163, 184, 0.2);;
    border-radius: 6px;
    color: #0f172a;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
  }

  .shell-nav-bar button:hover {
    background: rgba(255, 255, 255, 0.1);
  }

  .shell-nav-bar button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
  }

  .shell-url-bar {
    flex: 1;
    min-width: 0;
    max-width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 6px;
    padding: 0.35rem 0.75rem;
    display: flex;
    align-items: center;
    color: #0f172a;
    font-family: monospace;
    font-size: 0.85rem;
    background-color: white;
  }

  .shell-url-bar span {
    white-space: nowrap;
    overflow: hidden;
    flex: 1;
    -webkit-mask-image: linear-gradient(to right, black 85%, transparent 100%);
    mask-image: linear-gradient(to right, black 85%, transparent 100%);
  }

  .shell-frame {
    display: flex !important;
    flex-direction: column !important;
    width: 100%;
    height: 100%;
    border: 1px solid rgba(148, 163, 184, 0.2);;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(16px);
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  }

  .shell-viewport {
    width: 100%;
    flex: 1 !important;
    border: none;
    background: #ffffff !important;

    container-type: inline-size;
    overflow-y: auto;
    width: 100%;
    height: 100%;
  }
}

@layer layout {
  html {
    font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  }

  body {
    line-height: 1.6;
    display: flex;
    flex-direction: row;
    height: 100vh;
    width: 100vw;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: #f8fafc;
    color: #0f172a;

    @media (max-width: 800px) {
      flex-direction: column;
    }
  }

  #open-menu {
    position: fixed;
    left: 1rem;
    top: 1rem;
    z-index: 20;
  }

  #close-menu {
    position: absolute;
    top: 1rem;
    right: 1rem;
  }

  .shell-main {
    flex: 1;
    height: 100%;
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50vw;
    height: 80vh;
    align-self: center;

    @media (max-width: 800px) {
      width: 100%;
    }
  }

  .shell-sidebar {
    width: 50vw;
    max-width: 800px;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    border-left: 1px solid rgba(148, 163, 184, 0.2);
    backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    padding: 2rem;
    gap: 2rem;
    overflow-y: auto;
  }

  .shell-explanation {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  .shell-explanation > * {
    margin: 0;
  }

  .shell-explanation h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
  }

  .shell-explanation :is(p, ul, ol) {
    color: #64748b;
    line-height: 1.6;
  }

  /* Code Blocks Styling */
  pre {
    background: rgba(255, 255, 255, 0.8) !important;
    border: 1px solid rgba(148, 163, 184, 0.2) !important;
    border-radius: 12px !important;
    padding: 1.25rem !important;
    overflow-x: auto !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !important;
    font-size: 0.85rem !important;
    line-height: 1.5 !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(12px);
  }

  code {
    color: #0f172a !important;
  }

  .shell-sidebar h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #0f172a;
    margin-top: 1rem;
  }

  .shell-sidebar hr {
    border: 0;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    margin: 1.5rem 0;
  }

  .shell-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 30px;
    padding: 0 1rem;
    height: 40px;
    box-sizing: border-box;
    color: #64748b;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(16px);
    width: max-content;
  }

  .shell-back:hover {
    color: #0f172a;
  }
}

@layer reset {
  * {
    box-sizing: border-box;
  }
  html, body {
    height: 100%;
    margin: 0;
    padding: 0;
  }
  ul[class] {
    list-style: none;
    margin: 0;
    padding: 0;
  }
  input, select, textarea, button {
    font-family: inherit;
  }
  img {
    max-width: 100%;
    height: auto;
  }
}