/* ============================================
   MODULE RECHERCHE D'ÉCOLE - MICRO AJUSTEMENTS
   ============================================ */

:root {
    --portal-primary: #00a896;
    --portal-primary-rgb: 0, 168, 150;
    --portal-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.school-portal-search {
    width: 100%;
    margin: 2rem 0;
}

.shopportal-header-simple {
    margin-bottom: 1.5rem;
}

.shopportal-header-simple h2 {
    margin-bottom: 0.5rem;
}

.shopportal-header-simple p {
    color: #6c757d;
}

/* ============================================
   FORMULAIRE DE RECHERCHE
   ============================================ */
.school-search-form {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
    z-index: 100;
}

.school-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.school-input-wrapper .search-icon {
    position: absolute;
    left: 15px;
    color: #999;
    font-size: 20px;
    pointer-events: none;
}

.school-input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.school-input:focus {
    outline: none;
    border-color: var(--portal-primary);
    box-shadow: 0 0 0 3px rgba(var(--portal-primary-rgb), 0.1);
}

/* Loader */
.search-loader {
    position: absolute;
    right: 15px;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(0, 168, 150, 0.1);
    border-top: 2px solid var(--portal-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   SUGGESTIONS
   ============================================ */
.school-suggestions {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: white;
    border-radius: 8px;
    border: 1px solid #eee;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    max-height: 350px;
    overflow-y: auto;
    z-index: 1000;
    animation: slideIn 0.2s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scrollbar */
.school-suggestions::-webkit-scrollbar {
    width: 6px;
}

.school-suggestions::-webkit-scrollbar-track {
    background: transparent;
}

.school-suggestions::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

/* ============================================
   ITEMS DE SUGGESTION
   ============================================ */
.school-suggestion-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid #f9f9f9;
}

.school-suggestion-item:last-child {
    border-bottom: none;
}

.school-suggestion-item:hover,
.school-suggestion-item.selected {
    background: #f0f7f6;
}

.suggestion-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e6f6f4;
    border-radius: 6px;
    color: var(--portal-primary);
    margin-right: 12px;
    flex-shrink: 0;
}

.suggestion-icon .material-icons {
    font-size: 18px;
}

/* Contenu */
.suggestion-content {
    flex: 1;
    min-width: 0;
}

.suggestion-name {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggestion-name mark {
    background: rgba(0, 168, 150, 0.15);
    color: var(--portal-primary);
    padding: 0 2px;
    border-radius: 2px;
    font-weight: 700;
    text-decoration: none;
}

.suggestion-url {
    font-size: 0.8rem;
    color: #999;
}

/* Flèche */
.suggestion-arrow {
    margin-left: auto;
    color: var(--portal-primary);
    opacity: 0.3;
}

/* ============================================
   AUCUN RÉSULTAT
   ============================================ */
.school-no-results {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: white;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    border: 1px solid #eee;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.school-no-results .material-icons {
    font-size: 32px;
    color: #ddd;
    margin-bottom: 10px;
}

.school-no-results p {
    margin: 0;
    color: #666;
}

/* ============================================
   ALERTE
   ============================================ */
.school-search-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 1rem;
    background: #fff8e1;
    border-radius: 8px;
    color: #856404;
    border: 1px solid #ffe082;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 767px) {
    .school-input {
        padding: 12px 15px 12px 45px;
        font-size: 0.9rem;
    }

    .school-input-wrapper .search-icon {
        left: 12px;
        font-size: 18px;
    }

    .school-suggestions {
        max-height: 300px;
    }

    .school-suggestion-item {
        padding: 8px 12px;
    }

    .suggestion-icon {
        width: 28px;
        height: 28px;
        margin-right: 10px;
    }

    .suggestion-icon .material-icons {
        font-size: 16px;
    }

    .suggestion-name {
        font-size: 0.9rem;
    }

    .suggestion-url {
        font-size: 0.75rem;
    }
}