/* Variables CSS harmonisées avec la charte graphique */
:root {
    --primary-color: #07411E;
    --primary-dark: #052E15;
    --primary-light: #0A5C2B;
    --secondary-color: #ABC41B;
    --secondary-dark: #8FA118;
    --secondary-light: #C4DE1F;
    --accent-color: #FFB100;
    --accent-dark: #E69D00;
    --accent-light: #FFC033;
    --danger-color: #e74c3c;
    --dark-color: #2c3e50;
    --light-color: #f8f9fa;
    --text-color: #333;
    --text-light: #666;
    --border-color: #e9ecef;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 20px rgba(0,0,0,0.15);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

/* Styles de base */
body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #f8f9fa;
}







.gie-main {
    min-height: 100vh;
    padding-top: 45px; /* Compensation pour le header fixe */
}

/* Section Hero */
.gie-hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 60px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.gie-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../images/hero-bg.jpg') center/cover;
    opacity: 0.1;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 40px;
    opacity: 0.9;
}

/* Statistiques du hero */
.hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.15);
}

.stat-card i {
    font-size: 2rem;
    color: var(--accent-color);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    background: none;
    -webkit-background-clip: initial;
    -webkit-text-fill-color: initial;
    color: white;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Section de recherche */
.search-section {
    background: white;
    padding: 30px 0;
    box-shadow: var(--shadow);
}

.search-filters {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.search-filters {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.search-box {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

.search-box input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(7, 65, 30, 0.1);
}

.search-box i {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

.filter-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-group select {
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: white;
    font-size: 0.9rem;
    min-width: 150px;
    cursor: pointer;
    transition: var(--transition);
}

.filter-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Section des résultats */
.results-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 10px;
}

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

.results-count {
    font-size: 1.1rem;
    color: var(--text-light);
}

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

.view-options {
    display: flex;
    gap: 5px;
    background: var(--bg-light);
    padding: 5px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.view-btn {
    padding: 8px 12px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.view-btn.active {
    background: var(--secondary-color);
    color: white;
    box-shadow: 0 2px 8px rgba(171, 196, 27, 0.3);
}

.view-btn:hover:not(.active) {
    background: rgba(171, 196, 27, 0.1);
    color: var(--secondary-color);
}

.action-btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.action-btn:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
}

/* Grille des G.I.E - 3 colonnes */
.gie-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-bottom: 40px;
}

.gie-grid.list-view {
    grid-template-columns: 1fr;
    gap: 15px;
}

/* Vue liste pour les cartes G.I.E */
.gie-card.list-view {
    display: flex;
    align-items: center;
    padding: 20px;
    gap: 20px;
}

.gie-card.list-view .gie-card-header {
    width: 120px;
    height: 120px;
    border-radius: 10px;
    flex-shrink: 0;
}

.gie-card.list-view .gie-card-body {
    flex: 1;
    padding: 0;
}

.gie-card.list-view .gie-name {
    font-size: 1.3rem;
    margin-bottom: 8px;
}

.gie-card.list-view .gie-sector {
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.gie-card.list-view .gie-location {
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.gie-card.list-view .gie-card-footer {
    border: none;
    padding: 0;
    margin-left: auto;
    flex-shrink: 0;
}

.gie-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.gie-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.gie-card-header {
    position: relative;
    height: 200px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.gie-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 10px;
}

.gie-type-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary-color);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.gie-statut-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--secondary-color);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.gie-card-body {
    padding: 25px;
}

.gie-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 10px;
    line-height: 1.3;
}

.gie-sector {
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.gie-location {
    color: var(--text-light);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gie-address {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 15px;
    line-height: 1.4;
}

.gie-card-footer {
    padding: 0 25px 25px;
}

.gie-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.gie-president,
.gie-members {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.gie-president strong,
.gie-members strong {
    font-size: 0.8rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gie-president span,
.gie-members span {
    font-weight: 500;
    color: var(--text-color);
}

.gie-actions {
    display: flex;
    gap: 10px;
}

.gie-action-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.gie-action-btn.primary {
    background: var(--primary-color);
    color: white;
}

.gie-action-btn.secondary {
    background: var(--light-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.gie-action-btn:hover {
    transform: translateY(-2px);
}

.gie-action-btn.primary:hover {
    background: var(--primary-light);
}

.gie-action-btn.secondary:hover {
    background: #e9ecef;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 40px;
}

.pagination-btn {
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-color);
    cursor: pointer;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.pagination-btn:hover,
.pagination-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-numbers {
    display: flex;
    gap: 5px;
}

.page-number {
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-color);
    cursor: pointer;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.page-number:hover,
.page-number.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Messages d'état */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.no-results i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.3;
    color: var(--accent-color);
}

.error-message {
    background: #fee;
    color: var(--danger-color);
    padding: 15px;
    border-radius: var(--border-radius);
    border: 1px solid #fcc;
    margin: 20px 0;
    text-align: center;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gie-card {
    animation: fadeIn 0.6s ease-out;
}

/* Responsive */
@media (max-width: 1200px) {
    .gie-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group select {
        min-width: auto;
    }
    
    .gie-grid {
        grid-template-columns: 1fr;
    }
    
    .results-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .gie-info {
        grid-template-columns: 1fr;
    }
    
    .gie-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .hero-stats {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
    }
    
    .pagination {
        flex-wrap: wrap;
    }
}

/* Styles d'impression */
@media print {
    .gie-hero,
    .search-section,
    .results-actions,
    .pagination {
        display: none;
    }
    
    .gie-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .gie-card-header {
        height: 100px;
    }
}

/* Styles pour la modal des détails GIE */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.3s ease-out;
    padding: 20px;
    box-sizing: border-box;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalFadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Badges de statut */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.actif,
.status-badge.active {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
}

.status-badge.inactif,
.status-badge.inactive {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.status-badge.en-attente,
.status-badge.pending {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
}

.status-badge.suspendu,
.status-badge.suspended {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 700px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
    margin: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--background-light);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-radius: 16px 16px 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.modal-body {
    padding: 20px 24px;
}

.modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.modal-section {
    background: var(--light-color);
    border-radius: 12px;
    padding: 18px 20px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.modal-section.full-width {
    grid-column: 1 / -1;
}

.modal-section h3 {
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-section h3::before {
    content: '';
    width: 3px;
    height: 16px;
    background: var(--accent-color);
    border-radius: 2px;
}

.modal-section p {
    margin: 8px 0;
    line-height: 1.5;
    color: var(--text-color);
    font-size: 0.95rem;
}

.modal-section strong {
    color: var(--primary-color);
    font-weight: 600;
    min-width: 100px;
    display: inline-block;
}

.modal-section a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.modal-section a:hover {
    color: var(--accent-dark);
    text-decoration: underline;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 18px 24px;
    border-top: 1px solid var(--background-light);
    background: var(--light-color);
    border-radius: 0 0 16px 16px;
}

.modal-footer .gie-action-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    border: none;
}

.modal-footer .gie-action-btn.primary {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(255, 177, 0, 0.3);
}

.modal-footer .gie-action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 177, 0, 0.4);
}

.modal-footer .gie-action-btn.secondary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(7, 65, 30, 0.3);
}

.modal-footer .gie-action-btn.secondary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(7, 65, 30, 0.4);
}

/* Responsive pour la modal */
@media (max-width: 768px) {
    .modal {
        padding: 15px;
    }
    
    .modal-content {
        width: 100%;
        max-height: 90vh;
    }
    
    .modal-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .modal-header {
        padding: 15px 20px;
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .modal-header h2 {
        font-size: 1.3rem;
    }
    
    .modal-body {
        padding: 15px 20px;
    }
    
    .modal-section {
        padding: 15px 18px;
    }
    
    .modal-footer {
        padding: 15px 20px;
        flex-direction: column;
    }
    
    .modal-footer .gie-action-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .modal {
        padding: 10px;
    }
    
    .modal-content {
        max-height: 95vh;
    }
    
    .modal-header h2 {
        font-size: 1.2rem;
    }
    
    .modal-section h3 {
        font-size: 1rem;
    }
    
    .modal-section strong {
        min-width: 80px;
    }
    
    .modal-section p {
        font-size: 0.9rem;
    }
}