/* Модальное окно поиска */
.search-modal {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 500px;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 100px);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    overflow: hidden;
}

.search-modal.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.search-modal-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.search-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.search-modal-header h5 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.search-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.search-modal-close:hover {
    color: #000;
}

.search-modal-body {
    padding: 15px 20px;
    overflow-y: auto;
    max-height: 500px;
}

.search-loading,
.search-no-results,
.search-error {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
}

.search-error {
    color: #dc3545;
}

.search-results-wrapper {
    display: flex;
    flex-direction: column;
}

/* Стили для результатов поиска из шаблона */
.search-modal .search-result {
    border-bottom: 1px solid #e0e0e0;
    padding: 15px 0;
    transition: background-color 0.2s;
}

.search-modal .search-result:last-child {
    border-bottom: none;
}

.search-modal .search-result:hover {
    background-color: #f8f9fa;
}

.search-modal .search-result-link {
    display: block;
    text-decoration: none;
    color: #0066b3;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 8px;
}

.search-modal .search-result-link:hover {
    color: #004d85;
    text-decoration: underline;
}

.search-modal .search-result-description {
    margin: 0;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .search-modal {
        top: 60px;
        right: 10px;
        left: 10px;
        width: auto;
        max-width: none;
    }

    .search-modal-header h5 {
        font-size: 16px;
    }

    .search-result-title {
        font-size: 15px;
    }

    .search-result-description {
        font-size: 13px;
    }
}

/* Улучшенный внешний вид для десктопа */
@media (min-width: 769px) {
    .search-modal {
        max-height: 600px;
    }

    .search-modal-body {
        max-height: 550px;
    }
}

/* Скроллбар для модального окна */
.search-modal-body::-webkit-scrollbar {
    width: 6px;
}

.search-modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.search-modal-body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.search-modal-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}
