@import url("./panel.css");
@import url("./toolbar.css");
@import url("./surface-card.css");

.list-page-shell {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.list-header {
    padding: 0.95rem;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    flex-wrap: wrap;
}

.list-title-group {
    display: flex;
    align-items: center;
    gap: 0.72rem;
    min-width: 280px;
}

.list-title-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--bg-elevated);
    color: var(--brand-500);
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.16);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.list-title-icon svg,
.list-title-icon i {
    width: 16px;
    height: 16px;
}

.list-title-group h1 {
    margin: 0;
    font-size: 1.15rem;
    color: var(--text-strong);
}

.list-title-group p {
    margin: 0.25rem 0 0;
    font-size: 0.84rem;
    color: var(--text-muted);
}

.list-controls {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex: 1;
    justify-content: flex-end;
    min-width: min(320px, 100%);
}

.list-controls > * {
    min-width: 0;
}

.list-controls .ui-toolbar-search {
    flex: 0 1 480px;
    max-width: 480px;
}

.list-controls .ui-toolbar-filter {
    flex: 0 0 auto;
}

.list-category-wrap {
    border: none;
    border-radius: 8px;
    background: var(--bg-surface);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
    padding: 0.55rem 0.7rem;
}

.list-table-scroll {
    overflow-x: auto;
}

.list-category-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.nav-category {
    border: 1px solid var(--border-main);
    border-radius: 999px;
    transition: all 0.2s ease;
}

.nav-category a {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 0.72rem;
    font-size: 12px;
    color: var(--text-main);
}

.nav-category.active,
.nav-category:hover {
    border-color: var(--brand-500);
    background: var(--brand-soft);
}

.nav-category.active a,
.nav-category:hover a {
    color: var(--text-strong);
}

.nav-category.active::after {
    display: none;
}

.list-result-wrap {
    min-height: 280px;
}

.grid-container {
    --list-grid-columns: 4;
    display: grid;
    grid-template-columns: repeat(var(--list-grid-columns), minmax(0, 1fr));
    gap: 0.72rem;
    align-items: stretch;
}

.no-more-data {
    grid-column: 1/-1;
    text-align: center;
    color: var(--text-muted);
    padding: 0.75rem;
    font-size: 13px;
}

.catalog-list-page .agent-card,
.catalog-list-page .workflow-card {
    border: none;
    border-radius: 8px;
    background: radial-gradient(circle at top right, rgba(37, 99, 235, 0.12), transparent 28%), var(--bg-surface);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    min-height: 100%;
}

.catalog-list-page .agent-card:hover,
.catalog-list-page .workflow-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 22px 44px rgba(2, 6, 23, 0.14);
}

.catalog-card-shell {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100%;
    padding: 1.1rem;
}

.catalog-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
}

.catalog-card-mark {
    width: 50px;
    height: 50px;
    font-size: 22px;
    line-height: 1;
    border-radius: 8px;
    background: rgba(37, 99, 235, 0.12);
    color: var(--brand-500);
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.catalog-card-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.72rem;
}

.catalog-card-title {
    margin: 0;
    font-size: 1.34rem;
    line-height: 1.18;
    letter-spacing: -0.03em;
    color: var(--text-strong);
}

.catalog-card-description {
    margin: 0;
    color: var(--text-main);
    font-size: 0.94rem;
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 6.8em;
}

.catalog-card-meta {
    display: flex;
    align-items: center;
    min-height: 24px;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.catalog-card-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.catalog-card-stat i,
.catalog-card-stat svg {
    width: 14px;
    height: 14px;
    color: var(--brand-500);
}

.catalog-card-actions {
    display: flex;
}

.catalog-list-page .agent-use-btn,
.catalog-list-page .workflow-use-btn {
    width: 100%;
    justify-content: center;
}

.catalog-list-page .agent-use-btn i,
.catalog-list-page .agent-use-btn svg,
.catalog-list-page .workflow-use-btn i,
.catalog-list-page .workflow-use-btn svg {
    width: 16px;
    height: 16px;
    color: currentColor;
}

.collection-list-page .workflow-card {
    border: none;
    border-radius: 8px;
    background: radial-gradient(circle at top right, rgba(37, 99, 235, 0.12), transparent 28%), var(--bg-surface);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    min-height: 100%;
}

.collection-list-page .workflow-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 22px 44px rgba(2, 6, 23, 0.14);
}

.collection-list-page .workflow-card .p-6 {
    padding: 1.1rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.collection-list-page .category-badge { width: fit-content; }

.collection-list-page .content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.72rem;
}

.collection-list-page .title-row {
    display: grid;
    grid-template-columns: 50px minmax(0, 1fr);
    gap: 0.62rem;
    align-items: center;
}

.collection-list-page .card-avatar {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    border: 1px solid rgba(37, 99, 235, 0.24);
    background: rgba(37, 99, 235, 0.12);
    color: var(--brand-500);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.collection-list-page .card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.collection-list-page .title-row h3 {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.25;
    color: var(--text-strong);
}

.collection-list-page .stat-item {
    display: inline-flex;
    align-items: center;
    gap: 0.34rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.collection-list-page .stat-item i {
    color: var(--brand-500);
    font-size: 0.78rem;
}

.collection-list-page .stat-label {
    color: var(--text-muted);
}

.collection-list-page .stat-value {
    color: var(--text-main);
    font-weight: 700;
}

.collection-list-page .description {
    margin: 0;
    color: var(--text-main);
    font-size: 0.84rem;
    line-height: 1.62;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 4.9em;
}

.collection-list-page .button-wrapper {
    display: flex;
    justify-content: flex-end;
}

.collection-list-page .workflow-use-btn,
.collection-list-page .workflow-projects-btn {
    justify-content: center;
}

@media (min-width: 1920px) {
    .grid-container {
        --list-grid-columns: 5;
    }
}

@media (max-width: 1280px) {
    .grid-container {
        --list-grid-columns: 3;
    }
}

@media (max-width: 1024px) {
    .grid-container {
        --list-grid-columns: 2;
    }

    .list-header {
        padding: 0.8rem;
    }

    .list-controls {
        justify-content: flex-start;
    }

    .list-controls .ui-toolbar-search {
        max-width: none;
    }

}

@media (max-width: 640px) {
    .grid-container {
        --list-grid-columns: 1;
    }

    .list-controls {
        width: 100%;
    }

    .dropdown-menu {
        left: 0;
        right: auto;
        width: 100%;
    }
}
