/* Empty CSS file */

html {
  font-size: 18px;
  font-family: Arial, Helvetica, sans-serif;
  background: #ebe2ff;
}

* {
  box-sizing: border-box;
}

/* hide FOUC */
[v-cloak] {
  display: none !important;
}

main {
  display: grid;
  grid-template-columns: 80ch 350px;
  grid-template-areas:
    "header header"
    "content sidebar";
  position: relative;
  max-width: calc(80ch + 350px + 1rem);
  margin: auto;
  gap: 1rem;
}

header {
  background: white;
  padding: 1rem;
  grid-area: header;

  label {
    display: block;
    margin: .25rem 0;
  }

  input {
    display: block;
    margin-bottom: .75rem;
    padding: .5rem;
    outline-color: blue;
    transition: background-color 0.2s ease;
  }

  input.saved {
    background-color: #d4edda;
    border-color: #28a745;
  }
}



#sidebar {
  grid-area: sidebar;
  position: absolute;
  left: 100%;
  top: 0;
  background: white;
  padding: 1rem;
  position: sticky;
  max-height: calc(100vh - 2rem);
  border-left: 8px solid #d69ed6;
  overflow-y: scroll;

  /* Fade out other content when popup is open */
  .name,
  .feedback-item {
    transition: opacity 0.3s ease;
  }

  &:has(.popup) {

    .name,
    .feedback-item {
      opacity: 0.3;
    }
  }

  input {
    display: inline-block;
    margin-top: .25rem;
    margin-bottom: .5rem;
  }

  .saved {
    display: inline-block;
    margin-left: .5rem;
    font-size: .8rem;
    color: #333;
  }

  h2 {
    text-align: center;
    font-size: 1.2rem;
  }

  .popup {
    border: 1px solid #ccc;
    padding: 8px;
    padding-top: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    width: 100%;
    background: #eee;
    margin-bottom: 1rem;
    position: relative;

    label {
      display: flex;
      cursor: pointer;
      gap: 4px;
      flex-wrap: wrap;
      background: white;
      border-radius: 4px;
      margin: .25rem;
      padding: .5rem;

      &:hover {
        background: #f9f9f9;
      }

      &.selected {
        background: #e3f2fd;
        outline: 2px solid #2196f3;
      }
    }

    &.selected label {
      display: inline-block;
    }

    input {
      display: none;
      margin: 0;
    }

    textarea {
      width: 100%;
      min-height: 6rem;
      margin: .5rem 0;
      border-radius: 4px;
      padding: .5rem;
      box-shadow: none;
      outline: 0;
    }

    button {
      background: black;
      color: white;
      padding: .5rem;
      border: 0;
      border-radius: 4px;
      display: inline-block;
      cursor: pointer;
      margin-right: 1rem;
    }

    .close-button {
      background: transparent;
      color: black;
      position: absolute;
      top: 0;
      right: 0;
      cursor: pointer;
      font-size: 1.1rem;
      padding: 0;
      padding-right: .5rem;
      margin: 0;
    }
  }
}

.feedback-item {
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 8px;
  /* box-shadow: 0 2px 4px rgba(0,0,0,0.1); */
  width: 100%;
  display: flex;
  align-items: flex-start;
  margin-bottom: 5px;
  cursor: pointer;

  &:hover {
    background: #eee;
  }

  .icon {
    font-size: 20px;
    flex-shrink: 0;
    line-height: 1;
  }

  .text {
    font-size: 14px;
    line-height: 1.4;
    flex: 1;
    margin: 0;
  }

  .content {
    flex: 1;
  }

  .meta {
    font-size: 0.75rem;
    color: #666;
    margin-top: 0.25rem;
    gap: 1rem;
  }

  .meta::before {
    content: "— ";
  }
  time {
    white-space: nowrap;
  }
  .icon {
    margin-right: .5rem;
  }
}

#content {
  background: white;
  width: 80ch;
  padding: 1rem;
  margin-right: auto;
  grid-area: content;

  pre {
    white-space: pre-wrap;
    font-size: .8rem;
  }
}

.no-feedback {
  text-align: center;
  color: #666;
  font-style: italic;
  padding: 1rem;
}

.user-count {
  text-align: center;
  color: #666;
  font-size: 0.9rem;
  margin: 0.5rem 0;
}


::highlight(commented-text) {
  background: rgba(255, 255, 167, 1);
  cursor: pointer;
}

::highlight(active-selection),
::highlight(hover-feedback) {
  background-color: #ffbdf5;
}
