/* Structure Viewer 2.2 – Controls Bar */

.sv-controls-bar {
    background: var(--sv-surface);
    border: 1px solid var(--sv-border);
    border-radius: var(--sv-radius);
    padding: 20px 24px;
    margin-bottom: 20px;
}

.sv-main-form {
    width: 100%;
}

.sv-form-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 14px 18px;
    width: 100%;
}

.sv-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
}

.sv-form-group label {
    margin: 0;
    font-weight: 500;
    color: var(--sv-text-3);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ── Select boxes ──────────────────────────────────────────── */
/* Override WP admin CSS with high-specificity selectors */
.sv-app .sv-form-select,
.sv-app #sv-file-type-filter {
    padding: 7px 12px;
    border: 1px solid var(--sv-border-2) !important;
    border-radius: var(--sv-radius-sm);
    background-color: var(--sv-surface-2) !important;
    color: var(--sv-text) !important;
    min-width: 140px;
    font-size: 13px;
    margin: 0;
    height: 38px;
    box-sizing: border-box;
    line-height: 1.5;
    appearance: none !important;
    -webkit-appearance: none !important;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3e%3cpath d='M6 9l6 6 6-6'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 10px center !important;
    background-size: 14px !important;
    padding-right: 32px;
    transition: border-color var(--sv-transition), background-color var(--sv-transition);
    cursor: pointer;
}

.sv-app .sv-form-select:focus,
.sv-app #sv-file-type-filter:focus {
    border-color: var(--sv-accent) !important;
    box-shadow: 0 0 0 2px var(--sv-accent-dim);
    outline: none;
}

.sv-app .sv-form-select:hover,
.sv-app #sv-file-type-filter:hover {
    background-color: var(--sv-surface-3) !important;
}

.sv-app .sv-form-select option,
.sv-app #sv-file-type-filter option {
    background-color: var(--sv-surface-2);
    color: var(--sv-text);
}

/* ── Light mode select overrides ───────────────────────────── */
.sv-app.sv-light-mode .sv-form-select,
.sv-app.sv-light-mode #sv-file-type-filter {
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3e%3cpath d='M6 9l6 6 6-6'/%3e%3c/svg%3e") !important;
}

.sv-app.sv-light-mode .sv-form-select option,
.sv-app.sv-light-mode #sv-file-type-filter option {
    background-color: #ffffff;
    color: #0f172a;
}

/* ── Search group ──────────────────────────────────────────── */
.sv-search-group {
    flex: 2;
    min-width: 250px;
}

.sv-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.sv-search-box input,
.sv-form-input {
    background: var(--sv-surface-2);
    border: 1px solid var(--sv-border-2);
    border-radius: var(--sv-radius-sm);
    color: var(--sv-text);
    font-size: 13px;
    padding: 7px 12px;
    height: 38px;
    box-sizing: border-box;
    flex-grow: 1;
    min-width: 150px;
    outline: none;
    transition: border-color var(--sv-transition), box-shadow var(--sv-transition);
    line-height: 1.5;
}

.sv-search-box input::placeholder,
.sv-form-input::placeholder {
    color: var(--sv-text-3);
}

.sv-search-box input:focus,
.sv-form-input:focus {
    border-color: var(--sv-border-2);
    box-shadow: none;
    outline: none;
}

/* Kill WordPress admin default blue outline on all inputs inside sv-app */
.sv-app input:focus,
.sv-app select:focus,
.sv-app textarea:focus {
    box-shadow: none !important;
    border-color: var(--sv-border-2) !important;
    outline: none !important;
}

/* Search button */
.sv-search-box .button,
.sv-btn {
    height: 38px;
    box-sizing: border-box;
    line-height: 1 !important;
    padding: 0 18px !important;
    border-radius: var(--sv-radius-sm) !important;
    font-size: 13px !important;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--sv-transition);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--sv-border-2) !important;
    background: var(--sv-surface-3) !important;
    color: var(--sv-text) !important;
    box-shadow: none !important;
    margin: 0 !important;
    text-decoration: none !important;
}

.sv-search-box .button:hover,
.sv-btn:hover {
    background: var(--sv-surface-hover) !important;
    border-color: var(--sv-border-2) !important;
    color: var(--sv-text) !important;
}

.sv-search-box .button:active,
.sv-btn:active {
    background: var(--sv-surface-2) !important;
    transform: translateY(1px);
}

/* ── Checkbox group ────────────────────────────────────────── */
.sv-checkbox-group {
    display: flex;
    align-items: center;
    min-width: 120px;
    padding-bottom: 2px;
}

.sv-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    margin: 0;
    user-select: none;
}

.sv-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--sv-accent);
    cursor: pointer;
}

.sv-checkbox-text {
    font-size: 13px;
    color: var(--sv-text-2);
    white-space: nowrap;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .sv-form-group { flex: 1; min-width: 160px; }
    .sv-search-group { flex: 2; min-width: 280px; }
    .sv-checkbox-group { flex: none; order: 5; width: 100%; }
}

@media (max-width: 782px) {
    .sv-form-row { flex-direction: column; align-items: stretch; }
    .sv-form-group,
    .sv-search-group { width: 100%; min-width: auto; flex: none; }
    .sv-search-box { flex-direction: column; align-items: stretch; gap: 8px; }
    .sv-search-box input,
    .sv-search-box .button { width: 100%; }
    .sv-form-select, #sv-file-type-filter { width: 100%; }
    .sv-checkbox-group { order: unset; width: auto; }
}

@media (max-width: 480px) {
    .sv-controls-bar { padding: 14px; }
}