/**
 * Bloor Pain Clinic - Inline Expandable Search Styles
 */

/* Inline Expandable Search Wrapper */
.bp-inline-search-wrap {
    position: relative;
    display: inline-block;
    vertical-align: middle;
}

.bp-inline-search-form {
    margin: 0;
}

/* Expandable Search Box Container */
.bp-inline-search-box {
    position: relative;
    display: flex;
    align-items: center;
    height: 42px;
    width: 42px;
    border-radius: 21px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.bp-inline-search-box:hover {
    border-color: #0066cc;
    background: #f8fafc;
}

.bp-inline-search-box.expanded,
.bp-inline-search-box:focus-within {
    width: 290px;
    background: #ffffff;
    border-color: #0066cc;
    box-shadow: 0 4px 18px rgba(0, 102, 204, 0.18);
}

/* Toggle Icon Button */
.bp-inline-search-toggle {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: #0f2b48;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.bp-inline-search-box.expanded .bp-inline-search-toggle,
.bp-inline-search-box:focus-within .bp-inline-search-toggle {
    color: #0066cc;
}

/* Input Field */
.bp-inline-search-input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.92rem;
    font-weight: 500;
    color: #0f2b48;
    width: 100%;
    padding: 0 35px 0 0;
    opacity: 0;
    transition: opacity 0.25s ease 0.05s;
}

.bp-inline-search-box.expanded .bp-inline-search-input,
.bp-inline-search-box:focus-within .bp-inline-search-input {
    opacity: 1;
}

.bp-inline-search-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

/* Remove Native Browser Clear (X) Icon to prevent double cross buttons */
.bp-inline-search-input::-webkit-search-cancel-button,
.bp-inline-search-input::-webkit-search-decoration,
.bp-inline-search-input::-webkit-search-results-button,
.bp-inline-search-input::-webkit-search-results-decoration,
.bp-search-input::-webkit-search-cancel-button,
.bp-search-input::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
    display: none !important;
}

/* Clear (X) Button */
.bp-inline-search-clear {
    position: absolute;
    right: 6px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.bp-inline-search-clear:hover {
    background: #f1f5f9;
    color: #0f2b48;
}

.bp-inline-search-box.has-value .bp-inline-search-clear {
    opacity: 1;
    visibility: visible;
}

/* Dropdown Live Search Results */
.bp-live-search-results {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 15px 35px rgba(15, 43, 72, 0.15);
    z-index: 9999;
    max-height: 400px;
    overflow-y: auto;
    display: none;
}

.bp-live-search-results.has-results {
    display: block;
}

.bp-live-search-header {
    padding: 10px 18px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    background: #f8fafc;
    border-bottom: 1px solid #edf2f7;
}

.bp-live-search-item {
    display: flex;
    align-items: center;
    padding: 12px 18px;
    text-decoration: none;
    color: #1e293b;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s ease;
}

.bp-live-search-item:last-child {
    border-bottom: none;
}

.bp-live-search-item:hover,
.bp-live-search-item:focus {
    background: #f0f7ff;
    color: #0066cc;
    outline: none;
}

.bp-live-search-thumb {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    object-fit: cover;
    margin-right: 12px;
    background: #e2e8f0;
    flex-shrink: 0;
}

.bp-live-search-thumb-placeholder {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: #eef5ff;
    color: #0066cc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    margin-right: 12px;
    flex-shrink: 0;
}

.bp-live-search-info {
    flex-grow: 1;
    overflow: hidden;
}

.bp-live-search-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 3px;
    color: #0f2b48;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bp-live-search-item:hover .bp-live-search-title {
    color: #0066cc;
}

.bp-live-search-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    color: #64748b;
}

.bp-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 8px;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.bp-badge-practitioner {
    background: #eef5ff;
    color: #0066cc;
}

.bp-badge-page {
    background: #fef3c7;
    color: #92400e;
}

.bp-badge-post {
    background: #ecfdf5;
    color: #065f46;
}

.bp-badge-default {
    background: #f1f5f9;
    color: #475569;
}

.bp-live-search-footer {
    padding: 10px 18px;
    text-align: center;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.bp-live-search-footer a {
    color: #0066cc;
    font-weight: 600;
    font-size: 0.88rem;
    text-decoration: none;
}

.bp-live-search-footer a:hover {
    text-decoration: underline;
}

.bp-live-search-loading,
.bp-live-search-empty {
    padding: 20px;
    text-align: center;
    color: #64748b;
    font-size: 0.9rem;
}

/* ==========================================================================
   SEARCH RESULTS PAGE STYLES (search.php)
   ========================================================================== */

.bp-search-hero {
    background: linear-gradient(135deg, #0f2b48 0%, #1a365d 100%);
    color: #ffffff;
    padding: 55px 0 50px 0;
    margin-bottom: 45px;
    text-align: center;
}

.bp-search-hero-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #ffffff;
}

.bp-search-query-highlight {
    color: #38bdf8;
    font-weight: 700;
}

.bp-search-hero-subtitle {
    font-size: 1.05rem;
    color: #cbd5e1;
    max-width: 620px;
    margin: 0 auto 25px auto;
}

/* Hero Search Box Bar */
.bp-hero-search-wrap {
    max-width: 580px;
    margin: 0 auto;
}

.bp-hero-search-group {
    position: relative;
    display: flex;
    align-items: center;
    background: #ffffff;
    height: 54px;
    border-radius: 27px;
    padding: 0 6px 0 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    transition: box-shadow 0.25s ease;
}

.bp-hero-search-group:focus-within {
    box-shadow: 0 10px 30px rgba(56, 189, 248, 0.35);
}

.bp-hero-search-icon {
    color: #0066cc;
    font-size: 1.1rem;
    margin-right: 12px;
    flex-shrink: 0;
}

.bp-hero-search-input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 1.02rem;
    font-weight: 500;
    color: #0f2b48;
    width: 100%;
    height: 100%;
}

.bp-hero-search-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.bp-hero-search-btn {
    height: 42px;
    padding: 0 24px;
    border-radius: 21px;
    background: #0f2b48;
    color: #ffffff;
    border: none;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.bp-hero-search-btn:hover {
    background: #0066cc;
}

/* Search Card Grid Layout */
.bp-search-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 340px));
    justify-content: center;
    gap: 30px;
    margin-bottom: 40px;
}

.bp-search-card {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 15px rgba(15, 43, 72, 0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.bp-search-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 30px rgba(15, 43, 72, 0.12);
}

.bp-search-card-img-wrap {
    position: relative;
    width: 100%;
    height: 220px;
    background: #f1f5f9;
    overflow: hidden;
}

.bp-search-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform 0.3s ease;
}

.bp-search-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef5ff;
    color: #0066cc;
}

.bp-search-card:hover .bp-search-card-img {
    transform: scale(1.04);
}

.bp-search-card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.bp-search-card-body {
    padding: 22px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.bp-search-card-title {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 6px;
}

.bp-search-card-title a {
    color: #0f2b48;
    text-decoration: none;
    transition: color 0.2s ease;
}

.bp-search-card-title a:hover {
    color: #0066cc;
}

.bp-search-card-subtitle {
    font-size: 0.88rem;
    font-weight: 600;
    color: #0066cc;
    margin-bottom: 10px;
}

.bp-search-card-excerpt {
    color: #64748b;
    font-size: 0.92rem;
    line-height: 1.55;
    margin-bottom: 18px;
    flex-grow: 1;
}

.bp-search-card-footer {
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}

.bp-search-card-btn {
    font-size: 0.9rem;
    font-weight: 600;
    color: #0066cc;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: gap 0.2s ease;
}

.bp-search-card-btn:hover {
    color: #0f2b48;
    gap: 10px;
}

@media (max-width: 575.98px) {
    .bp-inline-search-box.expanded,
    .bp-inline-search-box:focus-within {
        width: 200px;
    }
    .bp-live-search-results {
        width: 290px;
        right: -40px;
    }
    .bp-search-results-grid {
        grid-template-columns: 1fr;
    }
}
