/**
 * Styles pour le widget de carte interactive
 */

/* Search and Filter Styles */
.ccl-exp-filters {
    margin-bottom: 20px;
}

.ccl-exp-search-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 15px;
}

.ccl-exp-search-input {
    width: 100% !important;;
    height: 72px;
    padding: 8px 16px 8px 24px !important;
    border-radius: 70px !important;;
    font-size: 16px;
    box-sizing: border-box !important;;
    box-shadow: 0px 10px 20px 0px #4A555E29;
    min-height: 48px;
    border: none !important;
    background-color: #F6F2F2;
}

.ccl-exp-search-input:focus {
    outline: none;
    border-color: #306E7B;
}

.ccl-exp-search-button {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    padding: 8px 20px !important;
    background: #306E7B !important;
    color: white !important;
    border: none !important;
    border-radius: 50px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    cursor: pointer !important;
    transition: background 0.3s ease !important;
    line-height: 30px;
}

.ccl-exp-search-button:hover {
    background: #245660;
}

.ccl-exp-filter-selectors {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.ccl-exp-filter-select {
    height: 45px;
    border: none;
    border-radius: 24px;
    font-size: 16px;
    line-height: 32px;
    font-weight: 600;
    color: #306E7B;
    cursor: pointer;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
    appearance: none;
    background: #F6F2F2 url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12"><path fill="%23306E7B" d="M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z"/></svg>') no-repeat right 15px center;
    padding: 8px 40px 10px 30px;
    box-shadow: 0px 10px 20px 0px #4A555E29;
}

.ccl-exp-filter-select:hover {
    border-color: #306E7B;
}

.ccl-exp-filter-select:focus {
    outline: none;
    border-color: #306E7B;
}

.ccl-exp-map-widget-container {
    display: grid;
    grid-template-columns: 30% 70%;
    gap: 30px;
    margin: 40px 0;
}

/* Colonne de gauche : Liste */
.ccl-exp-list-column {
    display: flex;
    flex-direction: column;
    min-height: 0; /* Important pour éviter les problèmes de flexbox */
}

.ccl-exp-total-count {
    color: #666;
    font-size: 14px;
}

.ccl-exp-list-items {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
    flex: 0 1 auto; /* Empêche l'expansion automatique */
}

.ccl-exp-list-item {
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.ccl-exp-list-item:hover {
    box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.15);
}

.ccl-exp-item-thumbnail {
    width: 100%;
    margin-bottom: 10px;
    position: relative;
}

.ccl-exp-item-thumbnail img {
    width: 100%;
    height: 100% !important;
    object-fit: cover;
    max-height: 250px;
}

.ccl-exp-item-thumbnail img:not(.ccl-exp-interviewee-image) {
    border-radius: 20px 20px 0 0 !important;
}

/* Respondent Badge */
.ccl-exp-respondent-badge {
    position: absolute;
    top: 0;
    left: 0;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 16px 16px 16px 0;
    margin: 16px 0 0 16px;
}

/* Interviewee Section */
.ccl-exp-interviewee {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.ccl-exp-interviewee-info {
    font-size: 14px;
    line-height: 1.4;
    text-overflow: ellipsis;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    max-height: 24px;
}

.ccl-exp-interviewee-info strong {
    font-weight: bold;
}

.ccl-exp-interviewee-info span {
    font-weight: normal;
}

.ccl-exp-item-thumbnail .ccl-exp-interviewee-image {
    width: 70px !important;
    height: 70px !important;
    border-radius: 50% !important;
    border: 4px solid #fff !important;
    position: absolute;
    left: 3%;
    bottom: -10%;
}

/* Categories */
.ccl-exp-categories {
    margin: 8px 0;
    font-size: 12px;
    color: #666;
    font-weight: 700;
    text-transform: uppercase;
}

.ccl-exp-item-content {
    flex: 1;
    padding: 15px;
}

.ccl-exp-item-title {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
}

.ccl-exp-item-title a {
    color: #2271b1;
    text-decoration: none;
}

.ccl-exp-item-title a:hover {
    text-decoration: underline;
}

.ccl-exp-item-location {
    margin: 0 0 8px 0;
    color: #666;
    font-size: 13px;
}

.ccl-exp-item-excerpt {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 13px;
    line-height: 1.5;
}

.ccl-exp-item-meta {
    margin: 0;
    font-size: 11px;
    color: #999;
}

/* Inspire Button */
.ccl-exp-inspire-button-container {
    text-align: center;
    margin-top: 12px;
}

.ccl-exp-inspire-button,
.ccl-exp-external-button {
    display: inline-block;
    padding: 10px 24px;
    border: 1px solid #306E7B;
    border-radius: 24px;
    background: #fff;
    color: #306E7B;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.ccl-exp-inspire-button:hover {
    background: #306E7B;
    color: #fff;
}

.ccl-exp-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

/* Pagination - Desktop */
.ccl-exp-pagination {
    margin-top: 20px;
    padding-top: 20px;
    flex-shrink: 0; /* Important : empêche la compression */
}

.ccl-exp-pagination-inner {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.ccl-exp-page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    border: none;
    background: transparent;
    border-radius: 50%;
    text-decoration: none;
    color: #000;
    font-weight: bold;
    font-size: 14px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.ccl-exp-page-link:hover:not(.ccl-exp-current):not(.ccl-exp-dots) {
    background: #DEECEF;
    color: #000;
}

.ccl-exp-page-link.ccl-exp-current {
    background: #306E7B;
    color: #fff;
    pointer-events: none;
    cursor: default;
}

.ccl-exp-page-link.ccl-exp-dots {
    pointer-events: none;
    cursor: default;
    font-weight: bold;
    color: #666;
}

/* Flèches Précédent/Suivant */
.ccl-exp-page-link.ccl-exp-prev,
.ccl-exp-page-link.ccl-exp-next {
    color: #306E7B;
    font-weight: bold;
    font-size: 24px;
    border-radius: 4px;
    padding: 0;
    min-width: 36px;
    height: 36px;
}

.ccl-exp-page-link.ccl-exp-prev:hover,
.ccl-exp-page-link.ccl-exp-next:hover {
    background: #DEECEF;
}

/* Colonne de droite : Carte */
.ccl-exp-map-column {
    position: sticky;
    top: 20px;
    height: fit-content;
    align-self: start; /* Important pour sticky */
}

#ccl-exp-map-container {
    width: 100%;
}

#map {
    width: 100%;
}

/* Responsive - Tablette et Mobile (1024px et moins) */
@media (max-width: 1024px) {
    .ccl-exp-map-widget-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* Filter responsive */
    .ccl-exp-filter-selectors {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Désactiver complètement le flex layout sur la colonne liste */
    .ccl-exp-list-column {
        display: block; /* Changer de flex à block */
    }
    
    .ccl-exp-map-column {
        position: static; /* Désactiver sticky */
        order: -1; /* Carte en premier */
    }
    
    .ccl-exp-list-items {
        margin-bottom: 30px; /* Assurer l'espace */
        display: flex;
        flex-direction: column;
        gap: 20px;
    }
    
    /* S'assurer que la pagination reste en bas */
    .ccl-exp-pagination {
        margin-top: 30px;
        padding-top: 20px;
        clear: both;
        position: relative; /* Force le positionnement normal */
    }
    
    #map {
        height: 500px !important;
        margin-bottom: 30px;
    }

    .ccl-exp-map-error-placeholder {
        height: 500px;
    }
}

/* Responsive - Mobile (768px et moins) */
@media (max-width: 768px) {
    /* Filter responsive - stack vertically */
    .ccl-exp-filter-selectors {
        grid-template-columns: 1fr;
    }
    
    .ccl-exp-map-widget-container {
        margin: 20px 0;
        gap: 15px;
    }
    
    .ccl-exp-list-items {
        gap: 15px;
        margin-bottom: 25px;
    }
    
    .ccl-exp-list-item {
        gap: 12px;
    }
    
    .ccl-exp-item-thumbnail {
        height: 180px;
    }
    
    .ccl-exp-item-title {
        font-size: 15px;
    }
    
    .ccl-exp-interviewee {
        gap: 10px;
        margin-bottom: 10px;
    }
    
    .ccl-exp-interviewee-info {
        font-size: 13px;
    }
    
    .ccl-exp-categories {
        font-size: 12px;
        margin: 6px 0;
    }
    
    .ccl-exp-inspire-button {
        padding: 8px 20px;
        font-size: 13px;
    }
    
    .ccl-exp-item-location,
    .ccl-exp-item-excerpt {
        font-size: 12px;
    }
    
    .ccl-exp-pagination {
        margin-top: 25px;
        padding-top: 15px;
    }

    .ccl-exp-external-logo img {
        max-width: 120px;
    }
    
    #map {
        height: 400px !important;
        border-radius: 8px !important;
        margin-bottom: 20px;
    }

    .ccl-exp-map-error-placeholder {
        height: 400px;
    }

    .ccl-exp-map-error-content {
        padding: 30px 20px;
    }

    .ccl-exp-map-error-content svg {
        width: 60px;
        height: 60px;
    }

    .ccl-exp-map-error-content h3 {
        font-size: 18px;
    }
}

/* Responsive - Petit mobile (480px et moins) */
@media (max-width: 480px) {
    .ccl-exp-map-widget-container {
        gap: 10px;
    }
    
    .ccl-exp-list-items {
        gap: 12px;
        margin-bottom: 20px;
    }
    
    .ccl-exp-pagination {
        margin-top: 20px;
        padding-top: 12px;
    }
    
    .ccl-exp-pagination-inner {
        gap: 4px;
    }
    
    .ccl-exp-page-link {
        min-width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .ccl-exp-page-link.ccl-exp-prev,
    .ccl-exp-page-link.ccl-exp-next {
        font-size: 20px;
        min-width: 32px;
        height: 32px;
    }
}

/* Fix spécifique pour éviter le chevauchement entre 768px et 1024px */
@media (min-width: 768px) and (max-width: 1024px) {
    .ccl-exp-list-column {
        display: block !important; /* Force block layout */
    }
    
    .ccl-exp-list-items {
        margin-bottom: 40px !important; /* Plus d'espace */
    }
    
    .ccl-exp-pagination {
        margin-top: 40px !important;
        padding-top: 25px !important;
        position: static !important;
        clear: both !important;
    }
}

/* Styles pour le placeholder d'erreur de carte */
.ccl-exp-map-error-placeholder {
    width: 100%;
    height: 728px;
    border: 2px dashed #ccc;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9f9f9;
}

.ccl-exp-map-error-content {
    text-align: center;
    padding: 40px;
    color: #666;
}

.ccl-exp-map-error-content svg {
    margin-bottom: 20px;
}

.ccl-exp-map-error-content h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 20px;
}

.ccl-exp-map-error-content p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
}

/* Flip Card Styles for External Experiences */
.ccl-exp-flip-card {
    perspective: 1000px;
    height: auto;
    min-height: 350px;
    background-color: #F8F6F8;
}

.ccl-exp-flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.ccl-exp-flip-card:hover .ccl-exp-flip-card-inner {
    transform: rotateY(180deg);
}

.ccl-exp-flip-card-front,
.ccl-exp-flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.ccl-exp-flip-card-back {
    background-color: #f8f9fa;
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    padding: 20px;
}

/* External Logo Styling */
.ccl-exp-external-logo {
    margin-top: 15px;
    text-align: center;
}

.ccl-exp-external-logo img {
    max-width: 150px;
    height: 40px !important;
}

/* External Button Styling */
.ccl-exp-external-button-container {
    margin-top: auto;
    padding-top: 20px;
    text-align: center;
}

.ccl-exp-external-button {
    text-align: center;
    padding: 10px;
}

.ccl-exp-external-button:after {
    content: " ";
    font-family: Font Awesome\ 5 Free;
    font-weight: 900;
    margin-left: 8px;
}

.ccl-exp-external-button:hover {
    background-color: #245660;
    color: white;
}

/* Back Side Content Layout */
.ccl-exp-flip-card-back .ccl-exp-item-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.ccl-exp-flip-card-back .ccl-exp-item-title {
    margin-bottom: 15px;
}

.ccl-exp-flip-card-back .ccl-exp-item-excerpt {
    flex-grow: 1;
}

@media (min-width: 1024px) {
    .ccl-exp-item-thumbnail img:not(.ccl-exp-interviewee-image) {
        min-height: 240px;
    }
}

@media (min-width: 480px) {
    .ccl-exp-flip-card {
        min-height: 450px;
    }
}