/**
 * Saved Searches Widget Styles
 * Voxel Toolkit
 */

/* Hide when cloaked */
[v-cloak] {
    display: none !important;
}

/* Main Container */
.vt-saved-searches {
    width: 100%;
}

/* Grid Layout */
.vt-saved-searches-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.vt-saved-searches-grid.vx-disabled {
    opacity: 0.6;
    pointer-events: none;
}

/* Search Card */
.vt-search-card {
    background: var(--ts-shade-8, #fff);
    border: 1px solid var(--ts-shade-5, #d5d5d5);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.vt-search-card:hover {
    border-color: var(--ts-shade-5, #d0d0d0);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Card Header */
.vt-search-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    gap: 12px;
    border-bottom: 1px solid var(--ts-shade-6, #e4e4e4);
    background: var(--ts-shade-7, #f9f9f9);
}

.vt-search-card-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

/* Post Type Badge (Icon) */
.vt-search-post-type-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    background: var(--e-global-color-accent, var(--ts-accent-1, #4A7CFF));
    border-radius: 8px;
    color: #fff;
}

.vt-search-post-type-badge svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.vt-search-post-type-badge i {
    font-size: 18px;
}

/* Card Title */
.vt-search-card-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--ts-shade-1, #1a1a1a);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Card Actions */
.vt-search-card-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Action Button */
.vt-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--ts-shade-8, #fff);
    border: 1px solid var(--ts-shade-6, #e4e4e4);
    color: var(--ts-shade-2, #555);
    text-decoration: none;
    transition: all 0.15s ease;
    cursor: pointer;
}

.vt-action-btn:hover {
    background: var(--ts-shade-7, #f5f5f5);
    border-color: var(--ts-shade-5, #d0d0d0);
    color: var(--ts-shade-1, #1a1a1a);
}

.vt-action-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.vt-action-btn i {
    font-size: 16px;
}

/* Action Button States */
.vt-action-view:hover {
    background: var(--e-global-color-accent, var(--ts-accent-1, #4A7CFF));
    border-color: var(--e-global-color-accent, var(--ts-accent-1, #4A7CFF));
    color: #fff;
}

.vt-action-notification-on {
    background: #e8f5e9;
    border-color: #81c784;
    color: #2e7d32;
}

.vt-action-notification-on:hover {
    background: #c8e6c9;
    border-color: #66bb6a;
}

.vt-action-notification-off {
    background: #fff3e0;
    border-color: #ffb74d;
    color: #ef6c00;
}

.vt-action-notification-off:hover {
    background: #ffe0b2;
    border-color: #ffa726;
}

.vt-action-delete:hover {
    background: #ffebee;
    border-color: #ef9a9a;
    color: #c62828;
}

.vt-action-edit:hover {
    background: #e3f2fd;
    border-color: #64b5f6;
    color: #1565c0;
}

/* Loader in Actions */
.vt-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.vt-loader .ts-loader {
    width: 16px;
    height: 16px;
}

/* Card Body */
.vt-search-card-body {
    padding: 16px 18px;
    flex: 1;
}

/* Filters Container */
.vt-search-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Filter Tag */
.vt-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--ts-shade-7, #f5f5f5);
    border-radius: 20px;
    font-size: 13px;
    color: var(--ts-shade-2, #555);
}

.vt-filter-tag b,
.vt-filter-tag strong {
    font-weight: 600;
    color: var(--ts-shade-1, #1a1a1a);
}

.vt-filter-tag label {
    display: inline;
    font-weight: 500;
    color: var(--ts-shade-2, #666);
    margin: 0;
    padding: 0;
}

.vt-filter-tag label svg {
    width: 14px;
    height: 14px;
    fill: var(--ts-shade-3, #888);
}

/* Override Voxel inherited styles */
.vt-filter-tag .ts-form-group {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 0;
    width: auto;
    min-width: 0;
}

.vt-filter-tag .ts-saved-search-filter {
    display: inline;
    padding: 0;
    margin: 0;
    background: none;
    border: none;
    width: auto;
    min-width: 0;
}

.vt-filter-tag .ts-saved-search-filter-text {
    display: inline;
    padding: 0;
    margin: 0;
    font-size: inherit;
    color: inherit;
}

.vt-filter-tag .filter-icon {
    display: inline-flex;
    align-items: center;
}

.vt-filter-tag .filter-icon svg {
    width: 14px;
    height: 14px;
    fill: var(--ts-shade-3, #888);
}

/* No Filters */
.vt-search-no-filters {
    font-size: 13px;
    color: var(--ts-shade-3, #888);
    font-style: italic;
}

/* Card Footer */
.vt-search-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-top: 1px solid var(--ts-shade-6, #e4e4e4);
    background: var(--ts-shade-7, #fafafa);
    font-size: 12px;
    color: var(--ts-shade-3, #888);
    gap: 12px;
}

.vt-search-post-type-label {
    font-weight: 500;
    color: var(--ts-shade-2, #666);
}

.vt-search-date {
    margin-left: auto;
    white-space: nowrap;
}

/* Pagination */
.vt-searches-pagination {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 24px;
}

.vt-searches-pagination a {
    flex: 1;
}

/* Empty State */
.vt-searches-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
    color: var(--ts-shade-3, #888);
}

.vt-searches-empty svg {
    width: 48px;
    height: 48px;
    fill: var(--ts-shade-5, #ccc);
    margin-bottom: 16px;
}

.vt-searches-empty i {
    font-size: 48px;
    margin-bottom: 16px;
}

.vt-searches-empty p {
    margin: 0;
    font-size: 14px;
}

/* Loading State */
.vt-searches-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
}

/* Mobile Responsive */
@media (max-width: 600px) {
    .vt-search-card-header {
        padding: 12px 14px;
        flex-wrap: wrap;
    }

    .vt-search-card-header-left {
        flex: 1 1 100%;
        margin-bottom: 10px;
    }

    .vt-search-card-actions {
        flex: 1 1 100%;
        justify-content: flex-end;
    }

    .vt-action-btn {
        width: 38px;
        height: 38px;
    }

    .vt-search-card-body {
        padding: 14px;
    }

    .vt-search-card-footer {
        padding: 10px 14px;
        flex-wrap: wrap;
    }

    .vt-search-post-type-label {
        flex: 1 1 100%;
        margin-bottom: 4px;
    }

    .vt-search-date {
        margin-left: 0;
    }
}

/* Filter Type Specific Styles */
.vt-filter-tag[data-type="location"] svg,
.vt-filter-tag[data-type="keywords"] svg,
.vt-filter-tag[data-type="date"] svg,
.vt-filter-tag[data-type="range"] svg {
    width: 14px;
    height: 14px;
}

/* Override old class names for compatibility */
.ts-search-item {
    display: none;
}
