/* =============================================================================
   BLADE FINDER – [blade_finder] ULTRA-MODERN UNIFIED BAR (assets/finder-style.css)
   ============================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ── CONTAINER ────────────────────────────────────────────────────────────── */
.bf-finder.bf-horizontal.bf-unified-bar {
    font-family: 'Inter', sans-serif;
    max-width: 1200px;
    margin: 40px auto;
    padding: 0; /* Remove padding for unified look */
    background: transparent;
    border: none;
    box-shadow: none;
}

/* ── UNIFIED WRAPPER ───────────────────────────────────────────────────────── */
.bf-steps-wrapper {
    display: flex;
    align-items: stretch;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 4px; /* Rectangular shape */
    padding: 4px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.06);
    gap: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bf-steps-wrapper:focus-within {
    border-color: #1a1a2e;
    box-shadow: 0 10px 40px rgba(26,26,46,0.12);
}

/* ── STEP ─────────────────────────────────────────────────────────────────── */
.bf-step {
    flex: 1;
    position: relative;
    padding: 10px 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-right: 1px solid #f1f5f9;
    min-width: 140px;
    transition: all 0.2s;
}

.bf-step:last-of-type {
    border-right: none;
}

.bf-step-specs {
    flex: 2.2;
    min-width: 320px;
}

.bf-step.bf-step-disabled {
    opacity: 0.95; /* Look normal */
    background: #ffffff;
    pointer-events: none;
}

/* ── ACTIVE STEP GLOW ─────────────────────────────────────────────────────── */
.bf-step.bf-step-active:not(.bf-step-disabled) {
    background: #ffffff;
    box-shadow: inset 0 0 0 2px #f1f5f9;
}

.bf-step.bf-step-active:not(.bf-step-disabled)::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 24px;
    right: 24px;
    height: 2px;
    background: #e13838;
    border-radius: 2px;
    animation: bf-pulse 2s infinite;
}

@keyframes bf-pulse {
    0% { opacity: 0.3; transform: scaleX(0.8); }
    50% { opacity: 1; transform: scaleX(1); }
    100% { opacity: 0.3; transform: scaleX(0.8); }
}

/* ── STEP LABEL + ICON ────────────────────────────────────────────────────── */
.bf-step-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #1e293b; /* Dark visible color */
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.bf-step-icon {
    color: #94a3b8;
    transition: color 0.2s;
}

.bf-step:not(.bf-step-disabled) .bf-step-icon {
    color: #e13838;
}

/* ── SELECT ───────────────────────────────────────────────────────────────── */
.bf-select {
    width: 100%;
    border: none;
    background: transparent;
    padding: 0;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394a3b8' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right center;
    outline: none;
}

.bf-select:disabled {
    color: #cbd5e1;
}

/* ── SPEC GRID ────────────────────────────────────────────────────────────── */
.bf-spec-grid {
    display: flex;
    gap: 20px;
}

.bf-spec-col {
    flex: 1;
}

/* ── SPINNER ──────────────────────────────────────────────────────────────── */
.bf-spinner {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: none;
    width: 14px;
    height: 14px;
    border: 2px solid #f1f5f9;
    border-top-color: #1a1a2e;
    border-radius: 50%;
    animation: bf-spin 0.6s linear infinite;
}

@keyframes bf-spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

/* ── ACTIONS (Search Button) ──────────────────────────────────────────────── */
.bf-finder-actions {
    display: flex;
    align-items: center;
    padding-right: 4px;
}

.bf-btn-find {
    height: 40px;
    padding: 0 24px;
    background: #e13838;
    color: #ffffff;
    border: none;
    border-radius: 4px; /* Rectangular shape */
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(26,26,46,0.2);
}

.bf-btn-find:hover:not(:disabled) {
    background: #c12e2e;
    color: #ffffff;
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(225,56,56,0.3);
}

.bf-btn-find:disabled {
    background: #f1f5f9;
    color: #cbd5e1;
    box-shadow: none;
    cursor: not-allowed;
}

.bf-btn-svg {
    transition: transform 0.3s;
}

.bf-btn-find:hover:not(:disabled) .bf-btn-svg {
    transform: translateX(4px);
}

/* ── SELECT2 OVERRIDES (Hidden for Unified Look) ─────────────────────────── */
/* In this ultra-modern theme, we want the dropdowns to feel like they are part of the bar */
.bf-unified-bar .select2-container--default .select2-selection--single {
    border: none !important;
    background: transparent !important;
    height: auto !important;
    padding: 0 !important;
    box-shadow: none !important;
}

.bf-unified-bar .select2-container--default .select2-selection--single .select2-selection__rendered {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    line-height: normal;
    padding: 0;
}

.bf-unified-bar .select2-container--default .select2-selection--single .select2-selection__arrow {
    display: none; /* Hide default arrow to use our background SVG arrow */
}

/* ── SELECT2 DROPDOWN MINIMAL THEME ───────────────────────────────────── */
/* ── SELECT2 DROPDOWN MINIMAL THEME ───────────────────────────────────── */
.select2-dropdown {
    border: 1px solid #e13838 !important;
    border-radius: 0 !important;
    box-shadow: 0 15px 45px rgba(0,0,0,0.12) !important;
    overflow: hidden;
    margin-top: 15px !important; /* Push it below the finder bar to avoid overlap */
    background: #ffffff !important;
    z-index: 999999 !important;
    min-width: 220px !important;
    font-family: 'Inter', sans-serif !important;
}

.select2-results__option {
    padding: 14px 24px !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    color: #000000 !important;
    border-bottom: 1px solid #f1f5f9 !important;
    white-space: nowrap !important;
    background-color: #f4f4f4 !important; /* Base Grey Background */
}

/* Hover/Highlighted State: Red Background with White Text */
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: #e13838 !important; 
    color: #ffffff !important;
    font-weight: 600 !important;
}

/* Selected state: Red text / Grey Background (consistent with base) */
.select2-container--default .select2-results__option--selected {
    background-color: #f4f4f4 !important;
    color: #e13838 !important;
    font-weight: 700 !important;
}

/* Hide Search Field for maximum stability and minimal look */
.select2-search--dropdown {
    display: none !important;
}

/* ── RESPONSIVE ───────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .bf-steps-wrapper {
        border-radius: 20px;
        flex-wrap: wrap;
        padding: 12px;
    }
    .bf-step {
        border-right: none;
        border-bottom: 1px solid #f1f5f9;
        min-width: 33.33%;
        padding: 15px 20px;
    }
    .bf-step-specs {
        min-width: 66.66%;
    }
    .bf-finder-actions {
        min-width: 100%;
        padding: 10px 0 0;
    }
    .bf-btn-find {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .bf-step, .bf-step-specs {
        min-width: 100%;
    }
    .bf-spec-grid {
        flex-direction: column;
        gap: 10px;
    }
}
