.search-page {
  padding: 1rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;

  .search-header {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--s-half);
    justify-content: center;

    .search-field {
      width: 100%;
      max-width: 600px;
    }

    .include-completed-toggle {
      width: 100%;
      max-width: 600px;
    }
  }

  .search-results {
    flex: 1;
    overflow-y: auto;

    mat-list-item {
      cursor: pointer !important;
      height: auto !important;
      min-height: var(--s6);

      &::ng-deep .mdc-list-item {
        height: auto !important;
        min-height: var(--s6);
        padding-top: var(--s);
        padding-bottom: var(--s);
      }

      &:hover {
        background-color: var(--state-hover) !important;

        .view-details-btn {
          opacity: 0.4;

          &:hover {
            opacity: 1;
          }
        }
      }

      &::ng-deep {
        .search-result-content {
          width: 100%;
          cursor: pointer !important;

          .task-info {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            flex-wrap: wrap;

            .context-tag {
              flex-shrink: 0;
            }

            .task-title {
              font-weight: 500;
            }

            .task-archived,
            .task-done {
              text-decoration: line-through;
            }

            .task-subtask {
              font-style: italic;
            }

            .subtask-icon {
              font-size: 1.2rem;
              width: 1.2rem;
              height: 1.2rem;
              opacity: 0.7;
              margin-right: -0.25rem;
            }

            .subtask-breadcrumb {
              opacity: 0.6;
              overflow: hidden;
              text-overflow: ellipsis;
              white-space: nowrap;
              max-width: 10rem;
            }

            .task-icons {
              display: flex;
              align-items: center;
              gap: 0.25rem;

              .issue-icon,
              .archive-icon {
                font-size: 1.2rem;
                width: 1.2rem;
                height: 1.2rem;
                opacity: 0.7;
              }

              .archive-icon {
                color: var(--text-color-muted);
              }

              .view-details-btn {
                opacity: 0.4;

                :host-context(.isMousePrimary) & {
                  opacity: 0;
                }

                &:hover {
                  opacity: 1;
                }
              }
            }
          }
        }
      }
    }

    .no-results,
    .search-prompt {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 2rem;
      text-align: center;
      opacity: 0.6;

      mat-icon {
        font-size: 3rem;
        width: 3rem;
        height: 3rem;
        margin-bottom: 1rem;
      }

      p {
        margin: 0;
        font-size: 1.1rem;
      }
    }
  }
}

@media (max-width: 768px) {
  .search-page {
    padding: 0.5rem;

    .search-results {
      .search-result-item {
        .search-result-content {
          .task-info {
            .task-title {
              font-size: 0.9rem;
            }
          }
        }
      }
    }
  }
}
