/* Conteneur des boutons admin */
.admin-buttons {
    display: flex;
    gap: 10px;
}

.btn-cleanup {
    padding: 8px 16px;
    background: #ff9800;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-cleanup:hover:not(:disabled) {
    background: #f57c00;
    transform: translateY(-1px);
}

.btn-cleanup:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Styles spécifiques au module Écoles */
#ecoles-section {
    padding: 20px;
}

.stats-header {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.stat-card.alert {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe5e5 100%);
    border-left: 4px solid #e53e3e;
}

.stat-icon {
    font-size: 2.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #2d3748;
}

.stat-label {
    font-size: 0.9rem;
    color: #718096;
}

.search-section, .subscriptions-section, .fermees-section, .admin-section {
    background: white;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.search-container {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 15px;
    font-size: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    transition: border-color 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: #4299e1;
}

.search-loading {
    padding: 15px;
    text-align: center;
    color: #718096;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-top: 5px;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 100;
}

.search-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #f7fafc;
    cursor: pointer;
    transition: background 0.2s;
}

.search-result-item:hover {
    background: #f7fafc;
}

.ecole-nom {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 5px;
}

.ecole-ville, .ecole-centre {
    font-size: 0.9rem;
    color: #718096;
}

.btn-add {
    padding: 8px 16px;
    background: #4299e1;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-add:hover {
    background: #3182ce;
}

.no-results {
    padding: 20px;
    text-align: center;
    color: #718096;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.btn-refresh {
    padding: 10px 20px;
    background: #48bb78;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-refresh:hover:not(:disabled) {
    background: #38a169;
}

.btn-refresh:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.subscriptions-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.fermees-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 450px; /* Environ 3 écoles visibles (chaque école ~140px) */
    overflow-y: auto;
    padding-right: 10px;
}

/* Style de la scrollbar pour la liste des écoles fermées */
.fermees-list::-webkit-scrollbar {
    width: 8px;
}

.fermees-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.fermees-list::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 10px;
}

.fermees-list::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

.fermee-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.subscription-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: #f7fafc;
    border-radius: 8px;
    border-left: 4px solid #48bb78;
    transition: all 0.2s;
}

.subscription-item.fermee {
    background: #fff5f5;
    border-left-color: #e53e3e;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge.ouverte {
    background: #c6f6d5;
    color: #22543d;
}

.status-badge.fermee {
    background: #fed7d7;
    color: #742a2a;
}

.subscription-info {
    flex: 1;
}

.ecole-nom-large {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
}

.ecole-details {
    display: flex;
    gap: 15px;
    margin-bottom: 5px;
}

.detail-item {
    font-size: 0.9rem;
    color: #718096;
}

.subscription-meta {
    font-size: 0.85rem;
    color: #a0aec0;
}

.subscription-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.toggle-switch input {
    display: none;
}

.toggle-slider {
    width: 50px;
    height: 26px;
    background: #cbd5e0;
    border-radius: 13px;
    position: relative;
    transition: background 0.2s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
    background: #48bb78;
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(24px);
}

.toggle-label {
    font-size: 0.9rem;
    color: #4a5568;
}

.btn-remove {
    padding: 8px 12px;
    background: #fc8181;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-remove:hover {
    background: #f56565;
}

.fermee-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #fff5f5;
    border-radius: 8px;
    border-left: 4px solid #e53e3e;
}

.fermee-icon {
    font-size: 2rem;
}

.fermee-info {
    flex: 1;
}

.fermee-nom {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 5px;
}

.fermee-ville, .fermee-centre, .fermee-raison {
    font-size: 0.9rem;
    color: #718096;
    margin-bottom: 3px;
}

.fermee-date {
    font-size: 0.85rem;
    color: #a0aec0;
    white-space: nowrap;
    margin-bottom: 8px;
}

.admin-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.btn-admin {
    flex: 1;
    padding: 12px 20px;
    background: #805ad5;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-admin:hover:not(:disabled) {
    background: #6b46c1;
}

.btn-admin:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.scrape-result {
    padding: 15px;
    border-radius: 6px;
    font-weight: 500;
}

.scrape-result.success {
    background: #c6f6d5;
    color: #22543d;
}

.scrape-result.error {
    background: #fed7d7;
    color: #742a2a;
}

.loading-state, .empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #718096;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.empty-hint {
    font-size: 0.9rem;
    color: #a0aec0;
    margin-top: 10px;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #e2e8f0;
    border-top-color: #4299e1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .stats-header {
        grid-template-columns: 1fr;
    }
    
    .subscription-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .subscription-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .admin-actions {
        flex-direction: column;
    }
}

/* Made with Bob */
