/* ==========================================================================
   Annuaire Écoles - Frontend Styles
   ========================================================================== */

/* Map wrapper */
.ae-annuaire {
    max-width: 1200px;
    margin: 0 auto 2rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Filters */
.ae-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.ae-filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ae-filter-group label {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
}

.ae-filter-group select,
.ae-filter-group input[type="text"] {
    padding: 0.4rem 0.8rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
    min-width: 150px;
}

/* Map */
#ae-map {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    z-index: 1;
}

/* Results count */
.ae-results-count {
    padding: 0.5rem 0;
    font-size: 0.85rem;
    color: #6c757d;
}

/* Popup card on map */
.ae-popup-card {
    min-width: 220px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.ae-popup-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    color: #212529;
}

.ae-popup-card .ae-popup-meta {
    font-size: 0.8rem;
    color: #495057;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.ae-popup-card .ae-popup-meta span {
    display: block;
}

.ae-popup-card .ae-popup-btn {
    display: inline-block;
    padding: 0.35rem 0.8rem;
    background: #0d6efd;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.8rem;
    transition: background 0.2s;
}

.ae-popup-card .ae-popup-btn:hover {
    background: #0b5ed7;
    color: #fff;
}

/* ==========================================================================
   Single Établissement Page
   ========================================================================== */

.ae-single-etablissement {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.ae-single-header {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #dee2e6;
}

.ae-single-logo {
    flex: 0 0 150px;
}

.ae-single-logo img {
    width: 150px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ae-single-title-area {
    flex: 1;
}

.ae-single-title {
    margin: 0 0 1rem;
    font-size: 1.8rem;
    color: #212529;
}

.ae-single-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    margin-bottom: 1rem;
}

.ae-meta-item {
    font-size: 0.9rem;
    color: #495057;
}

.ae-btn {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.ae-btn-site {
    background: #0d6efd;
    color: #fff;
}

.ae-btn-site:hover {
    background: #0b5ed7;
    color: #fff;
}

.ae-single-section {
    margin-bottom: 2rem;
}

.ae-single-section h2 {
    font-size: 1.3rem;
    color: #212529;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #0d6efd;
}

.ae-single-caracteristiques ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ae-single-caracteristiques li {
    padding: 0.4rem 0 0.4rem 1.5rem;
    position: relative;
    font-size: 0.95rem;
}

.ae-single-caracteristiques li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    color: #198754;
    font-weight: bold;
}

.ae-single-content {
    line-height: 1.7;
    font-size: 0.95rem;
    color: #333;
}

#ae-single-map {
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.ae-single-edit-cta {
    text-align: center;
    padding: 1.5rem;
    background: #f0f7ff;
    border: 1px dashed #0d6efd;
    border-radius: 8px;
}

.ae-btn-edit-large {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: #0d6efd;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    transition: background 0.2s;
}

.ae-btn-edit-large:hover {
    background: #0b5ed7;
    color: #fff;
}

/* ==========================================================================
   Frontend Edit Form
   ========================================================================== */

.ae-front-edit {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.ae-front-edit h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: #212529;
}

.ae-notice {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.ae-notice-success {
    background: #d1e7dd;
    border: 1px solid #badbcc;
    color: #0f5132;
}

.ae-notice-error {
    background: #f8d7da;
    border: 1px solid #f5c2c7;
    color: #842029;
}

.ae-school-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ae-school-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.ae-school-name {
    font-weight: 600;
    font-size: 1rem;
}

.ae-edit-form .ae-form-group {
    margin-bottom: 1.25rem;
}

.ae-edit-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
}

.ae-edit-form input[type="text"],
.ae-edit-form input[type="url"],
.ae-edit-form input[type="date"],
.ae-edit-form select,
.ae-edit-form textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.ae-edit-form textarea {
    resize: vertical;
}

.ae-form-row {
    display: flex;
    gap: 1rem;
}

.ae-form-half {
    flex: 1;
}

.ae-checkbox-group label {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-weight: normal;
    margin-right: 1rem;
}

.ae-current-thumb {
    margin-bottom: 0.5rem;
}

.ae-current-thumb img {
    max-width: 100px;
    height: auto;
    border-radius: 6px;
}

.ae-form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.ae-btn-edit {
    background: #0d6efd;
    color: #fff;
}

.ae-btn-edit:hover {
    background: #0b5ed7;
    color: #fff;
}

.ae-btn-save {
    background: #198754;
    color: #fff;
    border: none;
    cursor: pointer;
}

.ae-btn-save:hover {
    background: #157347;
}

.ae-btn-view {
    background: #6c757d;
    color: #fff;
}

.ae-btn-view:hover {
    background: #5c636a;
    color: #fff;
}

/* Responsive */
@media (max-width: 768px) {
    .ae-filters {
        flex-direction: column;
    }

    .ae-filter-group {
        width: 100%;
    }

    .ae-filter-group select,
    .ae-filter-group input[type="text"] {
        flex: 1;
    }

    .ae-single-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .ae-single-meta {
        justify-content: center;
    }
}
