/**
 * Styles pour la page de recherche d'établissements
 * 
 * @package Evofia
 * @since 1.0.0
 */

/* ==========================================
   HERO SECTION
   ========================================== */

   .hero-search {
    position: relative;
    min-height: 400px;
    background: linear-gradient(135deg, var(--evofia-blue) 0%, var(--evofia-green) 100%);
    background-image: url('../img/hero-formations.jpg');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 64, 82, 0.85);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
}

.hero-search h1 {
    color: #fff;
    font-weight: 600;
    text-align: center;
    margin-bottom: 30px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.search-form {
    max-width: 800px;
    margin: 0 auto;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    gap: 10px;
    background: #fff;
    border-radius: 50px;
    padding: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.search-icon {
    position: absolute;
    left: 25px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    pointer-events: none;
    z-index: 2;
}

.search-input {
    flex: 1;
    border: none !important;
    padding: 8px 20px 8px 20px !important;
    border-radius: 50px;
    outline: none;
    box-shadow: none !important;
}

.search-input:focus {
    outline: none;
    box-shadow: none !important;
}

.btn-search {
    padding: 8px 15px;
    font-weight: 500;
    border-radius: 50px;
    white-space: nowrap;
    background: var(--evofia-orange);
    border-color: var(--evofia-orange);
}

.btn-search:hover {
    background: #e67e00;
    border-color: #e67e00;
}

.btn-clear-search {
    padding: 2px 16px;
    border-radius: 50px;
    white-space: nowrap;
    background: #fff;
    border-color: #fff;
    color: #004052;
    border: 1px solid #004052;
}
.btn-clear-search:hover {
    background: #004052;
    border-color: #004052;
    color: #fff;
}

/* ==========================================
   SECTION RÉSULTATS
   ========================================== */

.results-section {
    padding: 60px 0;
}

/* ==========================================
   SIDEBAR FILTRES
   ========================================== */

.filters-sidebar {
    padding-right: 30px;
}

.filters-panel {
    background: #F0DCB4;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    height: 700px;
}

.filters-title {
    font-weight: 600;
    margin-bottom: 20px;
    color: #004052;
}

.filter-group {
    margin-bottom: 30px;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-group-title {
    font-weight: 600;
    margin-bottom: 15px;
    color: #004052;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-option {
    display: flex;
    align-items: center;
    /*padding: 8px 12px;*/
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    margin: 0;
    color: #004052;
}

.filter-option:hover {
    color: #0b5367;
}

.filter-checkbox {
    margin-right: 10px;
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.filter-label {
    cursor: pointer;
    flex: 1;
    color: #0b5367;
    line-height: 1;
}

.filter-option input:checked + .filter-label {
    font-weight: 600;
    color: var(--evofia-blue);
}

/* ==========================================
   CARTE
   ========================================== */

.map-wrapper {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

#ecoles-map {
    height: 700px;
    width: 100%;
}

.leaflet-container {
    font-family: inherit;
}

/* Marqueurs personnalisés avec image PNG */
.leaflet-marker-icon {
    /* Styles pour les markers avec image personnalisée */
    transition: transform 0.2s ease;
}

.leaflet-marker-icon:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

/* Popup de la carte */
.map-popup {
    padding: 5px;
}

.map-popup h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--evofia-blue);
}

.popup-address {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
}

.popup-formations {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 10px;
}

.popup-formations .badge {
    font-size: 11px;
    padding: 3px 8px;
}

/* ==========================================
   LISTE DES RÉSULTATS
   ========================================== */

.results-list {
    /*background: #fff;*/
    border-radius: 8px;
    padding: 30px;
    /*box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);*/
}

.results-header {
    margin-bottom: 20px;
}

.results-header h2 {
    font-weight: 700;
    color: #004052;
    margin-bottom: 5px;
}

.results-header .results-count {
    color: #004052;
    line-height: 1;
}

.results-count-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0px 20px;
    /*background: var(--evofia-cream);*/
    border-radius: 6px;
    margin-bottom: 25px;
}

.count-label {
    color:#004052;
}

.count-number {
    /*font-weight: 700;*/
    color:#004052;
}

.count-text {
    color:#004052;
}

/* ==========================================
   CARTES D'ÉCOLE
   ========================================== */

.ecoles-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.ecole-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    transition: all 0.3s;
    position: relative;
    padding : 20px 30px;
    background:#004052;
    border-radius:40px;
    color:#fff;
}

.ecole-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.ecole-card.highlight {
    border-color: var(--evofia-orange);
    box-shadow: 0 0 20px rgba(255, 140, 0, 0.3);
    animation: pulse 1s ease-in-out;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.ecole-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.ecole-title a {
    color: var(--evofia-blue);
    text-decoration: none;
    transition: color 0.2s;
}

.ecole-title a:hover {
    color: var(--evofia-green);
    text-decoration: none !important;
}

.ecole-address {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
    line-height: 1.6;
}

.ecole-description {
    font-size: 14px;
    color: #333;
    line-height: 1.6;
    margin-bottom: 15px;
}

.formations-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.badge-formation {
    background: var(--evofia-orange);
    color: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--evofia-orange);
}

.ecole-actions {
    display: flex;
    justify-content: flex-end;
}

.btn-details {
    padding: 7px 15px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 25px;
    text-decoration: none;
    transition: all 0.2s;
    color:#004052;
    background: #fff;
}
.btn-details:hover {
    background: var(--evofia-orange);
    color: #fff;
}
/* ==========================================
   MESSAGES ET LOADERS
   ========================================== */

.loading-message,
.loading-spinner {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.loading-spinner .spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--evofia-blue);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.no-results,
.error-message {
    text-align: center;
    padding: 60px 20px;
}

.no-results p,
.error-message p {
    font-size: 16px;
    color: #666;
    margin-bottom: 10px;
}

.error-message p {
    color: #d63638;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 991px) {
    .filters-sidebar {
        padding-right: 15px;
        margin-bottom: 30px;
    }
    
    .filters-panel {
        position: static;
    }
}

@media (max-width: 768px) {
    .hero-search {
        min-height: 300px;
        padding: 40px 20px;
    }
    
    .hero-search h1 {
        font-size: 1.8rem;
    }
    
    .search-input-wrapper {
        flex-direction: column;
        padding: 15px;
        border-radius: 15px;
    }
    
    .search-input {
        padding: 15px 20px !important;
    }
    
    .search-icon {
        display: none;
    }
    
    .btn-search {
        width: 100%;
        padding: 15px;
    }
    
    #ecoles-map {
        height: 350px;
    }
    
    .results-list {
        padding: 20px;
    }
    
    .results-header h2 {
        font-size: 1.5rem;
    }
    
    .ecole-card {
        padding: 20px;
    }
}

@media (max-width: 576px) {
    .filters-panel {
        padding: 20px;
    }
    
    .results-count-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* ==========================================================================
   PAGINATION
   ========================================================================== */

.pagination-wrapper {
    margin-top: 40px;
    margin-bottom: 40px;
}

.ecoles-pagination {
    display: flex;
    justify-content: center;
    margin: 30px 0;
}

.ecoles-pagination .pagination {
    gap: 8px;
}

.ecoles-pagination .page-item {
    margin: 0;
}

.ecoles-pagination .page-link {
    border: 1px solid #F1F1F1;
    color: #004052;
    background-color: #fff;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s ease;
    min-width: 45px;
    text-align: center;
}

.ecoles-pagination .page-link:hover {
    background-color: #004052;
    color: #fff;
    border-color: #004052;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 64, 82, 0.2);
}

.ecoles-pagination .page-item.active .page-link {
    background-color: #004052;
    color: #fff;
    border-color: #004052;
    box-shadow: 0 4px 12px rgba(0, 64, 82, 0.3);
}

.ecoles-pagination .page-item.disabled .page-link {
    border-color: #d0d0d0;
    color: #999;
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.6;
}

.ecoles-pagination .page-item.disabled .page-link:hover {
    background-color: #f5f5f5;
    color: #999;
    transform: none;
    box-shadow: none;
}

/* Boutons Précédent / Suivant */
.ecoles-pagination .page-item:first-child .page-link,
.ecoles-pagination .page-item:last-child .page-link {
    padding: 10px 24px;
    font-weight: 600;
}

/* Ellipses */
.ecoles-pagination .page-item.disabled .page-link {
    padding: 10px 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .ecoles-pagination .pagination {
        gap: 5px;
    }
    
    .ecoles-pagination .page-link {
        padding: 8px 12px;
        font-size: 0.9rem;
        min-width: 40px;
    }
    
    .ecoles-pagination .page-item:first-child .page-link,
    .ecoles-pagination .page-item:last-child .page-link {
        padding: 8px 16px;
    }
}

@media (max-width: 576px) {
    .ecoles-pagination .pagination {
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .ecoles-pagination .page-link {
        padding: 6px 10px;
        font-size: 0.85rem;
        min-width: 35px;
    }
    
    .ecoles-pagination .page-item:first-child .page-link,
    .ecoles-pagination .page-item:last-child .page-link {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

#recherche-etablissements {
    background: url('../img/Machine 3.png') no-repeat bottom left 10%;
    background-size: 25%;
}

.site-main #recherche-etablissements {
    padding-bottom: 100px;
}