:host {
  display: block;
  width: 100%;
}

.project-card.flow-card {
  border-radius: 12px;
  padding: 1.25rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  background-color: #171717;
  border: 1px solid rgb(31, 31, 31);
  transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  cursor: pointer;

  &:hover {
    border-color: var(--gray-750);
    background-color: var(--gray-900);
  }

  .card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;

    .title-with-emoji {
      display: flex;
      align-items: center;
      gap: 1.25rem;
      flex: 1;
      min-width: 0;

      .emoji-wrapper {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 35px;
        height: 35px;
        background-color: rgba(255, 255, 255, 0.04);
        border-radius: 8px;
        padding: 4px;
        flex-shrink: 0;
        transition: all 0.2s ease;

        &:hover {
          transform: scale(1.05);
          background-color: rgba(255, 255, 255, 0.06);
        }
      }

      .project-emoji {
        font-size: 20px;
        line-height: 1;
        display: flex;
        align-items: center;
        justify-content: center;
      }

      .project-title {
        font-size: 16px;
        font-weight: 600;
        color: var(--gray-100);
        margin: 0;
        line-height: 1.3;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
    }

    .flow-actions {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-shrink: 0;

      .session-status-area {
        display: flex;
        align-items: center;
        gap: 6px;
      }

      .status-indicator {
        display: flex;
        align-items: center;
        gap: 4px;
        font-size: 12px;
        font-weight: 500;
        padding: 3px 6px;
        border-radius: 4px;
        height: 24px;
        cursor: pointer;
        transition: all 0.2s ease;

        i {
          font-size: 12px;
        }

        &.active {
          background-color: rgba(33, 150, 243, 0.1);
          color: #64b5f6;

          &:hover {
            background-color: rgba(33, 150, 243, 0.2);
          }
        }

        &.waiting {
          background-color: rgba(255, 152, 0, 0.1);
          color: #ffa726;

          &:hover {
            background-color: rgba(255, 152, 0, 0.2);
          }
        }
      }

      .history-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: rgba(255, 255, 255, 0.04);
        width: 28px;
        height: 28px;
        border-radius: 6px;
        color: #6b7280;
        cursor: pointer;
        transition: all 0.2s ease;
        border: none;
        padding: 0;

        &:hover {
          color: #8b5cf6;
          background-color: rgba(139, 92, 246, 0.08);
        }
      }

      .menu-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        border-radius: 6px;
        cursor: pointer;
        transition: all 0.2s ease;
        background-color: rgba(255, 255, 255, 0.04);
        color: #6b7280;

        &:hover,
        &.is-open {
          color: #8b5cf6;
          background-color: rgba(139, 92, 246, 0.08);
        }

        i {
          font-size: 16px;
        }
      }
    }
  }

  .project-description {
    color: var(--gray-400);
    font-size: 14px;
    overflow-wrap: break-word;
    min-height: calc(1.6 * 14px * 2);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;

    &.no-description {
      font-style: italic;
    }
  }

  .footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;

    .project-tags-container {
      display: flex;
      align-items: center;
      border-radius: 6px;
      flex: 1;

      .tags-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        color: #9ca3af;
        margin-right: 8px;
        flex-shrink: 0;

        svg {
          width: 16px;
          height: 16px;
        }
      }

      .tags-list {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        overflow: hidden;

        .tag {
          display: inline-flex;
          align-items: center;
          background-color: rgba(255, 255, 255, 0.04);
          color: #e5e7eb;
          padding: 6px 10px;
          border-radius: 4px;
          font-size: 11px;
          font-weight: 500;
          white-space: nowrap;
          transition: all 0.2s ease;

          &:hover {
            background-color: rgba(255, 255, 255, 0.08);
          }
        }
      }
    }
  }
}

.menu-container {
  position: absolute;
  top: 38px;
  right: 0;
  z-index: 100;

  .menu-options {
    background-color: #1f1f1f;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    min-width: 150px;
    overflow: hidden;
    position: relative;
    z-index: 101;
    padding: 0.5rem;

    .menu-option {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.65rem 1rem;
      border-radius: 6px;
      color: var(--gray-300);
      transition: background-color 0.2s ease, color 0.2s ease;

      i {
        font-size: 1rem;
      }

      span {
        font-size: 0.875rem;
      }

      &:hover {
        background-color: rgba(255, 255, 255, 0.04);
        color: var(--white);
      }

      &.delete:hover {
        background-color: rgba(220, 38, 38, 0.1);
        color: #ff5555;
      }
    }
  }
}
