:root {
  color-scheme: dark;
}
html {
  background-color: #0d0d0d;
}

body {
  font-size: 16px;
}

.app-layout {
  height: 100vh;
  padding: 16px;
  gap: 0; /* Adjusted gap for resize handle */
  display: grid;
  grid-template:
    "left handle aside" auto
    "left handle aside" 1fr / 1fr 16px 1fr; /* Initial layout updated */

  .left-pane {
    grid-area: left;
    align-content: start;
    display: grid;
    gap: 16px;
    padding-inline-end: 12px;

    overflow-y: auto;
    scrollbar-gutter: stable;
    scroll-padding-block-start: 16px; /* offset the gap */
  }

  .app-header {
    position: sticky;
    background-color: #222;
    z-index: 1;
    top: 0;
    box-shadow: var(--mri-shadow-16);

    .outline-container {
      display: grid;
      grid-template-columns: 1fr auto;
      border-radius: 8px;
      border: 1px solid #444;

      &:focus-within {
        outline: 2px solid #0090d3;
        outline-offset: -2px;
        background-color: #000;
      }
    }

    input[type="search"] {
      border: none;
      outline: none;
      background: none;

      &:placeholder-shown {
        text-overflow: ellipsis;
      }
    }

    button {
      color: #aaa;
      border-radius: 0 8px 8px 0;
      border: none;
      outline: none;
      background: #222;
      transition: none;
      font-size: 16px;

      &:hover,
      &:focus-visible {
        color: white;
        background-color: #000;
      }
    }
  }

  .app-aside {
    grid-area: aside;
  }
}

.app-header {
  input {
    width: 100%;
    font-size: 16px;
    height: auto;
    padding: 12px;
  }
}

.icon {
  display: grid;
  grid-template-rows: auto auto;
  place-items: center;
  border: 1px solid #444;
  border-radius: 8px;
  gap: 16px;
  padding: 16px;
  background: #222;
  color: #bbb;
  font-weight: normal;
  transition: none;
  position: relative; /* Added for overlay positioning */

  &[data-selected="true"] {
    color: white;
    outline: 2px solid #999;
    outline-offset: -2px;
  }

  &:focus,
  &:hover {
    background-color: #111;
    outline: 2px solid #0090d3;
    outline-offset: -2px;

    /* On hover, show second SVG and hide first when there are multiple SVGs */
    .svg-container:has(.icon-svg:nth-child(2)) .icon-svg:nth-child(1) {
      opacity: 0;
    }

    .svg-container:has(.icon-svg:nth-child(2)) .icon-svg:nth-child(2) {
      opacity: 1;
    }
  }
}

.svg-container {
  position: relative;
  width: 48px;
  height: 48px;
}

.icon-svg {
  position: absolute;
  top: 0;
  left: 0;
}

/* Hide second SVG by default when there are multiple SVGs */
.svg-container:has(.icon-svg:nth-child(2)) .icon-svg:nth-child(2) {
  opacity: 0;
}

.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.icon-name {
  font-size: 18px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  text-align: center;
}

mark {
  color: black;
  font-weight: bold;
  background-color: #fff;
}
.copy-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #0d0d0d;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  color: white;
  pointer-events: none;
}

.copy-overlay.icon-copy-error {
  color: #ff6b6b; /* A reddish color for errors */
  background-color: rgba(50, 10, 10, 0.9); /* Dark red semi-transparent background */
}
.icon-doc-section {
  display: grid;
  gap: 8px;
  p {
    font-size: 16px;
  }

  code-snippet {
    margin-bottom: 16px;
  }
}

.icon-details {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 16px;
  border: 1px solid #444;
  background-color: #1f1f1f;
  height: 100%;
  overflow: auto;
  scrollbar-gutter: stable;
  border-radius: 8px;

  h1,
  h2,
  h3,
  h4,
  p {
    margin: 0;
  }

  menu button {
    padding: 8px 24px;
    font-size: 16px;
  }

  .mri-control-group button:not(.mri-active):not(:hover):not(:focus) {
    color: #999;
  }
}

.icon-option {
  display: grid;
  align-items: start;
  gap: 8px;

  h2 {
    font-size: 16px;
    text-transform: capitalize;
    grid-column: 1 / -1;
  }
}

.icon-info {
  align-content: start;
  display: grid;
  gap: 8px;

  menu {
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
}

@container (min-width: 40rem) {
  .icon-option {
    grid-template-columns: auto 1fr;
  }
}

.icon-option-list {
  margin-top: 16px;
  display: grid;
  gap: 16px;
  container-type: inline-size;
}

.icon-preview {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  padding: 2rem;
  background-color: #0d0d0d;
  border-radius: 8px;
  border: 1px solid #444;
  cursor: pointer;
  transition: background-color 0.2s;
}

.coding-agent-prompt {
  margin-top: 8px;
}

.subtle-text {
  color: var(--mri-color-text-3);
  a {
    color: inherit;
    &:hover {
      color: var(--mri-color-text-1);
    }
  }
}
.resize-handle {
  grid-area: handle;
  cursor: col-resize;
  width: 16px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none; /* Prevent text selection during drag */
  opacity: 0.5;

  &[data-resizing],
  &:hover {
    &::before {
      background-color: #0090d3; /* Change color on hover */
    }
  }

  &[data-resizing] {
    opacity: 1; /* Full opacity when resizing */
  }
}

.resize-handle::before {
  content: "";
  width: 4px;
  border-radius: 2px;
  position: relative;
  height: 100%; /* Adjust for visual appearance */
  background-color: transparent;
}
.result-status {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  color: #aaa;

  kbd {
    background-color: #333;
    color: #fff;
    padding: 2px 6px;
    margin-inline: 4px;
    border-radius: 4px;
  }
}
