/* dfb-search.css */

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,600;1,400&family=Source+Sans+3:wght@400;600&display=swap');

/* ── Wrap ─────────────────────────────────────────────── */
.dfb-search-wrap {
    max-width: 760px;
    margin: 2rem auto;
    font-family: 'Source Sans 3', sans-serif;
    color: #1a1a1a;
}

/* ── Header ───────────────────────────────────────────── */
.dfb-search-header {
    margin-bottom: 2rem;
    border-left: 3px solid #8b1a1a;
    padding-left: 1rem;
}

.dfb-search-title {
    font-family: 'Lora', Georgia, serif;
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0 0 0.25rem;
    color: #1a1a1a;
    letter-spacing: -0.01em;
}

.dfb-search-sub {
    margin: 0;
    font-size: 0.875rem;
    color: #666;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* ── Query Builder ────────────────────────────────────── */
.dfb-query-builder {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* ── Row ──────────────────────────────────────────────── */
.dfb-row {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.dfb-row--removing {
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* ── Operator ─────────────────────────────────────────── */
.dfb-op-wrap {
    flex: 0 0 90px;
}

.dfb-op-label {
    display: inline-block;
    width: 90px;
    text-align: center;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #8b1a1a;
    padding: 0.55rem 0;
    border: 1px solid transparent;
}

.dfb-op {
    width: 90px;
    padding: 0.5rem 0.5rem;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fff;
    background: #8b1a1a;
    border: 1px solid #6e1414;
    border-radius: 3px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    text-align: center;
}

.dfb-op:focus {
    outline: 2px solid #8b1a1a;
    outline-offset: 2px;
}

/* ── Input ────────────────────────────────────────────── */
.dfb-input {
    flex: 1;
    padding: 0.55rem 0.75rem;
    font-family: 'Lora', Georgia, serif;
    font-size: 1rem;
    color: #1a1a1a;
    border: 1px solid #ccc;
    border-radius: 3px;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.dfb-input:focus {
    outline: none;
    border-color: #8b1a1a;
    box-shadow: 0 0 0 3px rgba(139, 26, 26, 0.1);
}

/* ── Remove ───────────────────────────────────────────── */
.dfb-remove {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid #ddd;
    border-radius: 3px;
    color: #999;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    line-height: 1;
}

.dfb-remove:hover {
    background: #fff0f0;
    color: #8b1a1a;
    border-color: #8b1a1a;
}

/* ── Actions ──────────────────────────────────────────── */
.dfb-search-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.dfb-btn-add {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    color: #8b1a1a;
    background: #fff;
    border: 1px solid #8b1a1a;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.dfb-btn-add:hover {
    background: #8b1a1a;
    color: #fff;
}

.dfb-plus {
    font-size: 1.1rem;
    line-height: 1;
}

.dfb-btn-search {
    padding: 0.55rem 1.75rem;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #fff;
    background: #1a1a1a;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.15s;
}

.dfb-btn-search:hover {
    background: #333;
}

.dfb-btn-search:disabled {
    background: #999;
    cursor: not-allowed;
}

/* ── Loading ──────────────────────────────────────────── */
.dfb-loading {
    display: flex;
    gap: 0.4rem;
    padding: 1.5rem 0;
    justify-content: center;
}

.dfb-loading span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #8b1a1a;
    animation: dfb-bounce 1s infinite ease-in-out;
}

.dfb-loading span:nth-child(2) { animation-delay: 0.15s; }
.dfb-loading span:nth-child(3) { animation-delay: 0.3s; }

@keyframes dfb-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40%            { transform: scale(1);   opacity: 1;   }
}

/* ── Results header ───────────────────────────────────── */
.dfb-results-header {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.dfb-count {
    font-family: 'Lora', Georgia, serif;
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
}

.dfb-limit {
    font-size: 0.8rem;
    color: #888;
}

/* ── Results list ─────────────────────────────────────── */
.dfb-results-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.dfb-result {
    padding: 0.875rem 0;
    border-bottom: 1px solid #eee;
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 0 1rem;
    align-items: baseline;
}

.dfb-result:last-child {
    border-bottom: none;
}

.dfb-ref {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #8b1a1a;
    text-transform: uppercase;
    white-space: nowrap;
    padding-top: 0.1rem;
}

.dfb-tekst {
    font-family: 'Lora', Georgia, serif;
    font-size: 0.975rem;
    line-height: 1.65;
    color: #2a2a2a;
}

.dfb-tekst mark {
    background: #fff3cd;
    color: inherit;
    padding: 0 0.1em;
    border-radius: 2px;
}

/* ── Messages ─────────────────────────────────────────── */
.dfb-no-results,
.dfb-message {
    font-family: 'Lora', Georgia, serif;
    font-style: italic;
    color: #666;
    padding: 1rem 0;
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 500px) {
    .dfb-result {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .dfb-op-wrap {
        flex: 0 0 75px;
    }

    .dfb-op,
    .dfb-op-label {
        width: 75px;
    }
}
