/**
 * Search Modal Styles
 * Site-wide Meilisearch modal search interface
 */

/* Part Number Hint (shown when no results for PN-like query) */
.modal-pn-hint {
    background: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: 6px;
    padding: 10px 14px;
    margin: 0 0 10px 0;
    font-size: 13px;
    color: #1565c0;
}
.modal-pn-hint a {
    color: #0d47a1;
    font-weight: 600;
}

/* Modal Overlay */
.search-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    backdrop-filter: blur(2px);
}
.search-modal-overlay.active {
    display: flex;
    justify-content: center;
    padding-top: 80px;
}

/* Modal Container */
.search-modal {
    background: white;
    width: 95%;
    max-width: 900px;
    max-height: calc(100vh - 120px);
    border-radius: 12px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Modal Header */
.modal-search-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    background: #fafafa;
}
.modal-search-input-wrapper {
    position: relative;
}
.modal-search-input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    font-size: 18px;
    border: 2px solid #ddd;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.modal-search-input:focus {
    border-color: #004a8f;
}
.modal-close-btn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
}
.modal-close-btn:hover {
    color: #333;
}
.modal-search-stats {
    margin-top: 10px;
    font-size: 13px;
    color: #666;
}

/* Modal Results */
.modal-results {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}
.modal-result-item {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.15s;
    display: flex;
    gap: 15px;
    align-items: flex-start;
}
.modal-result-item:hover {
    background: #f8f9fa;
}
.modal-result-item:last-child {
    border-bottom: none;
}

/* Result Images */
.modal-result-image {
    flex-shrink: 0;
    width: 120px;
    border-radius: 6px;
}
.modal-result-image-placeholder {
    flex-shrink: 0;
    width: 120px;
    height: 80px;
    background: #e8e8e8;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bbb;
}

/* Result Content */
.modal-result-content {
    flex: 1;
    min-width: 0;
}
.modal-result-title {
    font-size: 16px;
    font-weight: 500;
    color: #004a8f;
    margin-bottom: 4px;
    line-height: 1.3;
}
.modal-result-category {
    display: inline-block;
    font-size: 10px;
    padding: 2px 6px;
    background: #e8e8e8;
    border-radius: 3px;
    text-transform: uppercase;
    color: #666;
    margin-left: 8px;
    vertical-align: middle;
}
.modal-result-url {
    font-size: 12px;
    color: #006621;
    margin-bottom: 6px;
}
.modal-result-description {
    font-size: 14px;
    color: #555;
    line-height: 1.4;
}

/* Modal States */
.modal-no-results {
    padding: 40px 20px;
    text-align: center;
    color: #666;
}
.modal-loading {
    padding: 40px 20px;
    text-align: center;
    color: #666;
}

/* Modal Footer */
.modal-footer {
    padding: 12px 20px;
    background: #fafafa;
    border-top: 1px solid #eee;
    font-size: 12px;
    color: #888;
    text-align: center;
}
.keyboard-hint {
    display: inline-flex;
    align-items: center;
    gap: 15px;
}
.keyboard-hint kbd {
    background: #e8e8e8;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: inherit;
    font-size: 11px;
}

/* PDF Result Styling */
.modal-pdf-icon-placeholder {
    flex-shrink: 0;
    width: 120px;
    height: 80px;
    background: linear-gradient(145deg, #fff 0%, #f5f5f5 100%);
    border: 1px solid #ddd;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
}
.modal-pdf-icon-placeholder .pdf-label {
    font-size: 10px;
    font-weight: 700;
    color: white;
    background: var(--glenair-blue, #2656A7);
    padding: 2px 6px;
    border-radius: 3px;
}
