/* BCM Custom Search Styles */

.bcm-search-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.bcm-search-form {
    position: relative;
}

.bcm-search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #fff;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.bcm-search-input-wrapper:focus-within {
    border-color: #007cba;
    box-shadow: 0 0 0 1px #007cba, 0 2px 8px rgba(0, 124, 186, 0.15);
}

.bcm-search-input {
    flex: 1;
    padding: 12px 16px;
    border: none;
    outline: none;
    font-size: 16px;
    background: transparent;
    border-radius: 6px 0 0 6px;
}

.bcm-search-input::placeholder {
    color: #8c8f94;
}

.bcm-search-submit {
    background: #007cba;
    border: none;
    padding: 12px 16px;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    color: white;
    display: flex;
    align-items: center;
    transition: background-color 0.2s ease;
}

.bcm-search-submit:hover {
    background: #005a87;
}

.bcm-search-submit:focus {
    outline: 2px solid #005a87;
    outline-offset: 2px;
}

.bcm-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
    margin-top: 4px;
}

.bcm-search-loading {
    display: flex;
    align-items: center;
    padding: 16px;
    color: #8c8f94;
}

.bcm-search-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e1e5e9;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: bcm-spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes bcm-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.bcm-search-result-item {
    display: flex;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f1;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.bcm-search-result-item:hover,
.bcm-search-result-item.bcm-search-selected {
    background-color: #f6f7f7;
}

.bcm-search-result-item:last-child {
    border-bottom: none;
}

.bcm-search-result-thumbnail {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    margin-right: 12px;
    border-radius: 6px;
    overflow: hidden;
    background: #f0f0f1;
}

.bcm-search-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bcm-search-thumbnail-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e1e5e9 0%, #f0f0f1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.bcm-search-thumbnail-placeholder::before {
    content: "📄";
    font-size: 24px;
    opacity: 0.5;
}

.bcm-search-result-content {
    flex: 1;
    min-width: 0;
}

.bcm-search-result-title {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1d2327;
    line-height: 1.3;
    word-wrap: break-word;
}

.bcm-search-result-excerpt {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #50575e;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bcm-search-result-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bcm-search-result-type {
    font-size: 12px;
    color: #8c8f94;
    background: #f0f0f1;
    padding: 2px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.bcm-search-no-results,
.bcm-search-error {
    padding: 16px;
    text-align: center;
    color: #8c8f94;
    font-style: italic;
}

.bcm-search-error {
    color: #d63638;
}

/* Responsive Design */
@media (max-width: 768px) {
    .bcm-search-container {
        max-width: 100%;
        margin: 0;
    }
    
    .bcm-search-input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .bcm-search-result-thumbnail {
        width: 50px;
        height: 50px;
        margin-right: 10px;
    }
    
    .bcm-search-result-title {
        font-size: 15px;
    }
    
    .bcm-search-result-excerpt {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .bcm-search-input {
        padding: 10px 12px;
    }
    
    .bcm-search-submit {
        padding: 10px 12px;
    }
    
    .bcm-search-result-item {
        padding: 10px 12px;
    }
    
    .bcm-search-result-thumbnail {
        width: 40px;
        height: 40px;
        margin-right: 8px;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .bcm-search-input-wrapper {
        border-width: 3px;
    }
    
    .bcm-search-result-item:hover,
    .bcm-search-result-item.bcm-search-selected {
        background-color: #000;
        color: #fff;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .bcm-search-input-wrapper,
    .bcm-search-submit,
    .bcm-search-result-item {
        transition: none;
    }
    
    .bcm-search-spinner {
        animation: none;
        border-top-color: transparent;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .bcm-search-input-wrapper {
        background: #2c3338;
        border-color: #50575e;
    }
    
    .bcm-search-input {
        color: #f0f0f1;
    }
    
    .bcm-search-input::placeholder {
        color: #8c8f94;
    }
    
    .bcm-search-results {
        background: #2c3338;
        border-color: #50575e;
    }
    
    .bcm-search-result-item:hover,
    .bcm-search-result-item.bcm-search-selected {
        background-color: #50575e;
    }
    
    .bcm-search-result-title {
        color: #f0f0f1;
    }
    
    .bcm-search-result-excerpt {
        color: #c3c4c7;
    }
    
    .bcm-search-result-type {
        background: #50575e;
        color: #c3c4c7;
    }
    
    .bcm-search-thumbnail-placeholder {
        background: linear-gradient(135deg, #50575e 0%, #8c8f94 100%);
    }
} 