/* WSB Saved Search Styles */

/* Page wrapper */
.wsb-savedsearch-main {
    padding: 20px 0 40px;
}

/* Header: title + "Add New" button */
.wsb-savedsearch-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.wsb-savedsearch-header h1 {
    margin: 0;
    font-size: 1.6rem;
    color: #1a1a1a;
}

/* Card list */
.wsb-savedsearch-list {
    display: grid;
    gap: 16px;
}

/* Individual card */
.wsb-savedsearch-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 20px 24px;
    transition: box-shadow 0.2s;
}

.wsb-savedsearch-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.wsb-savedsearch-card.wsb-inactive {
    opacity: 0.6;
    background: #fafafa;
}

/* Card header: title + badge */
.wsb-savedsearch-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 12px;
}

.wsb-savedsearch-card-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #1a1a1a;
}

/* Active/Paused badges */
.wsb-badge-active {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.wsb-badge-inactive {
    background: #e9ecef;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

/* Criteria tag pills */
.wsb-savedsearch-criteria {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.wsb-tag {
    display: inline-block;
    background: #f0f4f8;
    color: #444;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 0.82rem;
    font-weight: 500;
    border: 1px solid #dde4ec;
}

/* Meta info (dates) */
.wsb-savedsearch-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 14px;
    font-size: 0.82rem;
    color: #888;
}

/* Action buttons row */
.wsb-savedsearch-actions {
    display: flex;
    gap: 10px;
}

/* Small button variant */
.wsb-btn-small {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s;
    border: none;
}

.wsb-btn-small.wsb-btn-secondary {
    background: #666;
    color: #fff;
}

.wsb-btn-small.wsb-btn-secondary:hover {
    background: #555;
}

/* Danger button */
.wsb-btn-danger {
    background: #dc3545;
    color: #fff;
}

.wsb-btn-danger:hover {
    background: #c82333;
    color: #fff;
}

/* Empty state message */
.wsb-empty-state {
    text-align: center;
    padding: 48px 20px;
    color: #888;
    background: #fafafa;
    border: 1px dashed #ddd;
    border-radius: 6px;
}

.wsb-empty-state p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.5;
}

/* ── Add form ────────────────────────────── */

.wsb-savedsearch-form {
    max-width: 800px;
}

.wsb-form-intro {
    color: #666;
    margin-bottom: 24px;
    line-height: 1.5;
}

/* Override .wsb-form-row inside the saved search form to be a field wrapper */
.wsb-savedsearch-form .wsb-form-row {
    display: block;
    margin-bottom: 20px;
}

.wsb-savedsearch-form .wsb-form-row label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
}

.wsb-savedsearch-form .wsb-form-row label .required {
    color: #c73e3a;
}

.wsb-savedsearch-form .wsb-form-row input[type="text"],
.wsb-savedsearch-form .wsb-form-row input[type="number"],
.wsb-savedsearch-form .wsb-form-row select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.wsb-savedsearch-form .wsb-form-row input:focus,
.wsb-savedsearch-form .wsb-form-row select:focus {
    border-color: #c73e3a;
    outline: none;
    box-shadow: 0 0 0 2px rgba(199, 62, 58, 0.15);
}

/* Inline rows (2 columns side-by-side) */
.wsb-form-row-inline {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Submit row: flex for button + cancel link */
.wsb-savedsearch-form > .wsb-form-row:last-child {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 8px;
}

/* ── Responsive ──────────────────────────── */

@media (max-width: 600px) {
    .wsb-savedsearch-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .wsb-form-row-inline {
        grid-template-columns: 1fr;
    }

    .wsb-savedsearch-card {
        padding: 16px;
    }

    .wsb-savedsearch-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}
