@use "variables" as *;

/* Post Type Pills */

.ecw-post-type-pills {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.ecw-pills-section {
    &__title {
        font-size: 14px;
        font-weight: 600;
        margin: 0 0 15px 0;
        color: $color-text-primary;
    }
}

.ecw-pills-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ecw-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 2px solid $color-border;
    border-radius: 50px;
    background: white;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    cursor: grab;

    &:hover {
        border-color: var(--wp-admin-theme-color,#3858e9);
        background: color-mix(in srgb,var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9)) 4%,transparent);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }

    &:active {
        cursor: grabbing;
    }

    &__drag-handle {
        flex-shrink: 0;
        color: $color-drag-handle;
        transition: color 0.2s ease;
    }

    &:hover &__drag-handle {
        color: #2271b1;
    }

    &__label {
        font-weight: 500;
        color: $color-text-primary;
        flex: 1;
    }
}

/* Priority Pages Table */

.ecw-priority-pages-table {
    border-collapse: collapse;
    min-width: 500px;

    tr {
        &:hover {
            td {
                background-color: $color-surface-alt;
            }
            code {
                background: white;
            }
        }
        &:last-child {
            td {
                border-bottom: none;
            }
        }
    }

    th,
    td {
        padding: $spacing-sm $spacing-lg;
        text-align: left;
        &:first-child {
            padding-right: 0;
            padding-left: $spacing-md;
        }
    }

    th {
        font-weight: 600;
        background: $color-surface-muted;
        border-bottom: 2px solid $color-border-strong;
        input {
            margin: 0;
            border-radius: 2px;
        }
    }

    td {
        border-bottom: 1px solid $color-border;
    }

    .components-checkbox-control {
        margin-top: 0.2em;
    }

    &__col-priority {
        width: 20px;
    }

    &__col-title {
        width: auto;
        font-weight: 600;
    }

    &__col-url {
        width: 45%;

        code {
            background: $color-surface-alt;
            padding: 3px 8px;
            border-radius: 3px;
            font-size: 12px;
            color: #50575e;
            font-family: inherit;
        }
    }

    &__col-status {
        width: 55px;
        text-transform: capitalize;
    }
}

.ecw-priority-page-row {
    cursor: pointer;
    transition: background-color 0.15s ease;

    &--selected {
        background: #f0f6fc;

        &:hover {
            background: #e5f2ff;
        }
    }
}

/* No items message */

.ecw-no-items {
    color: $color-text-secondary;
    font-style: italic;
    margin: 20px 0;
}

/* Sitemap preview link */

.ecw-sitemap-preview {
    margin-top: 0;
    &__item {
        margin: 0 0 6px;
    }

    &__item:last-child {
        margin-bottom: 0;
    }

    &__link {
        font-weight: 500;
        text-decoration: none;

        &:hover {
            text-decoration: underline;
        }
    }
}

/* Helper text */

.ecw-helper-text {
    font-style: italic;
    margin: 0;
}
