/* Program Search - Clean Modern Design */

.program-search-form {
    background: #ffffff;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.06),
        0 1px 3px rgba(0, 0, 0, 0.04);
    margin-bottom: 2.5rem;
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.program-search-form:hover {
    box-shadow: 
        0 8px 30px rgba(0, 0, 0, 0.08),
        0 2px 6px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

/* Search Input Wrapper */
.search-input-wrapper {
    position: relative;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    z-index: 10;
}

.search-input-field {
    padding: 1rem 1.5rem 1rem 3.5rem;
    border: 2px solid #f1f5f9;
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    background: #fafbfc;
    width: 100%;
    color: #1e293b;
}

.search-input-field:hover {
    background: #ffffff;
    border-color: #e2e8f0;
}

.search-input-field:focus {
    border-color: var(--primary-color, #3498db);
    box-shadow: 
        0 0 0 4px rgba(52, 152, 219, 0.08),
        0 2px 8px rgba(52, 152, 219, 0.12);
    outline: none;
    background: #ffffff;
}

.search-input-wrapper:focus-within .search-icon {
    color: var(--primary-color, #3498db);
    transform: translateY(-50%) scale(1.1);
}

.search-input-field::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

/* Filter Select Wrapper */
.filter-select-wrapper {
    position: relative;
    width: 100%;
}

.filter-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1.05rem;
    transition: all 0.3s ease;
    z-index: 10;
    pointer-events: none;
}

.filter-select {
    padding: 1rem 3rem 1rem 3.5rem;
    border: 2px solid #f1f5f9;
    border-radius: 16px;
    background: #fafbfc;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    font-weight: 500;
    color: #1e293b;
    width: 100%;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath fill='%2394a3b8' d='M11.293 4.293L7 8.586 2.707 4.293A1 1 0 001.293 5.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1.25rem center;
}

.filter-select:hover {
    background: #ffffff;
    border-color: #e2e8f0;
}

.filter-select:focus {
    border-color: var(--primary-color, #3498db);
    box-shadow: 
        0 0 0 4px rgba(52, 152, 219, 0.08),
        0 2px 8px rgba(52, 152, 219, 0.12);
    outline: none;
    background: #ffffff;
}

.filter-select-wrapper:focus-within .filter-icon,
.filter-select-wrapper:hover .filter-icon {
    color: var(--primary-color, #3498db);
    transform: translateY(-50%) scale(1.1);
}

/* Select options styling */
.filter-select option {
    background: #ffffff;
    color: #1e293b;
    padding: 0.75rem;
}

/* Active Filter Indicator */
.filter-select:not([value=""]):valid {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.04), rgba(52, 152, 219, 0.02));
    border-color: var(--primary-color, #3498db);
    color: var(--primary-color, #3498db);
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 767px) {
    .program-search-form {
        padding: 1.5rem;
        border-radius: 18px;
    }
    
    .search-input-field,
    .filter-select {
        font-size: 0.9rem;
        padding: 0.875rem 2.5rem 0.875rem 3rem;
        border-radius: 14px;
    }
    
    .search-icon,
    .filter-icon {
        left: 1rem;
        font-size: 1rem;
    }
}

/* Loading State */
.htmx-request .program-search-form {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.htmx-request .program-search-form::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid rgba(52, 152, 219, 0.2);
    border-top-color: var(--primary-color, #3498db);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Smooth entrance animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.program-search-form {
    animation: fadeInUp 0.4s ease-out;
}

/* =====================================================
   Refonte recherche v2 — searchbar, sidebar, card, chips
   ===================================================== */

.search-page {
    max-width: 1500px;
    margin: 0 auto;
}

/* Quick search */
.quick-search .search-input-field {
    padding: 0.85rem 1.25rem 0.85rem 3rem;
    border-radius: 12px;
    font-size: 1rem;
}
.quick-search .search-icon { left: 1rem; }

/* Toolbar */
.search-toolbar {
    border-bottom: 1px solid #eef2f7;
    padding-bottom: 0.75rem;
}
.result-count {
    font-size: 1.05rem;
    color: #1e293b;
}
.sort-select {
    min-width: 200px;
}
.view-toggle .btn {
    padding: 0.4rem 0.85rem;
}

/* Active filter chips */
.active-filter-chip {
    display: inline-flex;
    align-items: center;
    background: #eef4ff;
    color: #1d4ed8;
    border: 1px solid #d6e2ff;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s ease;
}
.active-filter-chip:hover {
    background: #1d4ed8;
    color: #fff;
    border-color: #1d4ed8;
}

/* Sidebar */
.filters-sidebar {
    background: #fff;
    padding: 1.25rem;
    border: 1px solid #eef2f7;
    border-radius: 14px;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
}
.filters-title {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 1rem;
}
.filter-group-label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    color: #1e293b;
    margin-bottom: 0.4rem;
}

/* Typology chips */
.typology-chip {
    cursor: pointer;
    user-select: none;
}
.typology-chip input { display: none; }
.typology-chip span {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    transition: all 0.15s ease;
}
.typology-chip input:checked + span {
    background: var(--primary-color, #3498db);
    border-color: var(--primary-color, #3498db);
    color: #fff;
}
.typology-chip:hover span {
    border-color: var(--primary-color, #3498db);
    color: var(--primary-color, #3498db);
}
.typology-chip input:checked + span:hover {
    color: #fff;
}

/* =====================================================
   Program card
   ===================================================== */
.program-card {
    background: #fff;
    border: 1px solid #eef2f7;
    border-radius: 16px;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.program-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
    border-color: #d6e2ff;
}

.program-card__media {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background: #f1f5f9;
}
.program-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.program-card:hover .program-card__image {
    transform: scale(1.05);
}

.program-card__phase-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: rgba(15, 23, 42, 0.85);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    backdrop-filter: blur(6px);
}

.program-card__availability {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
}
.program-card__availability--ok {
    background: #d1fae5;
    color: #065f46;
}
.program-card__availability--sold {
    background: #fee2e2;
    color: #991b1b;
}

.program-card__body {
    padding: 1.1rem 1.15rem 1.15rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.program-card__title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}
.program-card__title a {
    color: #0f172a;
    text-decoration: none;
}
.program-card__title a:hover {
    color: var(--primary-color, #3498db);
}
.program-card__location {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 0.85rem;
}
.program-card__location i {
    color: var(--primary-color, #3498db);
    margin-right: 0.3rem;
}

.program-card__price {
    margin-bottom: 0.65rem;
    line-height: 1.2;
}
.program-card__price-label {
    display: block;
    font-size: 0.72rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}
.program-card__price-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
}
.program-card__price-value--muted {
    font-size: 1rem;
    color: #94a3b8;
    font-style: italic;
    font-weight: 500;
}

.program-card__typologies {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 0.85rem;
}
.program-card__typology-chip {
    background: #f1f5f9;
    color: #1e293b;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.18rem 0.55rem;
    border-radius: 4px;
}
.program-card__typology-chip--more {
    background: transparent;
    color: #64748b;
    border: 1px dashed #cbd5e1;
}

.program-card__meta {
    font-size: 0.8rem;
    color: #475569;
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.program-card__meta i {
    color: var(--primary-color, #3498db);
    margin-right: 0.25rem;
}

.program-card__cta {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color, #3498db);
    color: #fff;
    padding: 0.6rem 1rem;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s ease;
}
.program-card__cta:hover {
    background: #1d4ed8;
    color: #fff;
}

/* Empty state */
.empty-state {
    background: #fff;
    border: 2px dashed #e2e8f0;
    border-radius: 16px;
    padding: 3rem 1.5rem;
}

/* =====================================================
   Skeleton loader (HTMX request state)
   ===================================================== */
@keyframes skeleton-shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}
.htmx-request #programs-list .row {
    position: relative;
}
.htmx-request #programs-list .program-card {
    pointer-events: none;
    opacity: 0.65;
}
.htmx-request #programs-list .program-card__image {
    background: linear-gradient(90deg, #eef2f7 0%, #f8fafc 50%, #eef2f7 100%);
    background-size: 800px 100%;
    animation: skeleton-shimmer 1.4s linear infinite;
}

/* =====================================================
   Map view container
   ===================================================== */
.search-map-container {
    background: #fff;
    border: 1px solid #eef2f7;
    border-radius: 14px;
    overflow: hidden;
}
#search-programs-map {
    height: 75vh;
    min-height: 500px;
    width: 100%;
}

/* =====================================================
   Mobile tweaks
   ===================================================== */
@media (max-width: 767px) {
    .search-page { padding: 1rem !important; }
    .search-toolbar { gap: 0.5rem; }
    .sort-select { min-width: 0; flex: 1; }
    .program-card__title { font-size: 1rem; }
    .program-card__price-value { font-size: 1.15rem; }
}

/* =====================================================
   Pivot communautaire — hero, stats, CTA Suivre, bandeau promoteur
   ===================================================== */
.search-hero {
    padding: 1.5rem 0 0.5rem;
}
.search-hero__title {
    font-size: clamp(1.5rem, 2.5vw, 2.1rem);
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: #1f2a44;
    letter-spacing: -0.01em;
}
.search-hero__subtitle {
    color: #5b6b85;
    font-size: 1.02rem;
    margin-bottom: 0.8rem;
    max-width: 720px;
}
.search-hero__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.6rem;
    align-items: center;
    color: #4a5773;
    font-size: 0.92rem;
}
.search-hero__stat {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.search-hero__stat strong {
    color: #1f2a44;
    font-weight: 700;
}
.search-hero__stat-sep {
    color: #c2cbe0;
}
@media (max-width: 575px) {
    .search-hero__stat-sep { display: none; }
    .search-hero__stats { gap: 0.25rem 0.5rem; }
}

/* Badge "Communauté" sur les chantiers non revendiqués */
.program-card__unclaimed-badge {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    background: rgba(31, 42, 68, 0.86);
    color: #fff;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 600;
    padding: 0.22rem 0.6rem;
    letter-spacing: 0.01em;
    z-index: 2;
    backdrop-filter: blur(2px);
}

/* Stats communauté (followers + questions) */
.program-card__community-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin: 0.5rem 0 0.6rem;
    color: #4a5773;
    font-size: 0.88rem;
}
.community-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.community-stat i {
    color: #6c7a99;
}
.community-stat strong {
    color: #1f2a44;
    font-weight: 700;
}

/* Footer card : actions suivre + lien fiche */
.program-card__actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.6rem;
}
.program-card__follow-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.program-card__follow-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 1.5px solid var(--bs-primary, #2a6df4);
    color: var(--bs-primary, #2a6df4);
    background: #fff;
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
    text-decoration: none;
    white-space: nowrap;
}
.program-card__follow-btn:hover {
    background: var(--bs-primary, #2a6df4);
    color: #fff;
}
.program-card__follow-btn.is-following {
    background: var(--bs-primary, #2a6df4);
    color: #fff;
}
.program-card__follow-count {
    font-size: 0.82rem;
    color: #6c7a99;
    font-weight: 600;
}
.program-card__cta-secondary {
    margin-left: auto;
    color: #4a5773;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
}
.program-card__cta-secondary:hover {
    color: var(--bs-primary, #2a6df4);
}
.program-card__claim-hint {
    border-top: 1px dashed #e3e8f1;
    padding-top: 0.55rem;
}
.program-card__claim-hint a {
    font-weight: 600;
}

/* Card : variante "non revendiqué" — léger liseré */
.program-card--unclaimed {
    border: 1px solid #eef2f7;
}

/* Bandeau promoteur */
.promoter-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.2rem;
    background: linear-gradient(135deg, #f4f7ff 0%, #eef2fd 100%);
    border: 1px solid #d9e2f5;
    border-radius: 14px;
    color: #1f2a44;
}
.promoter-banner__icon {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff;
    color: var(--bs-primary, #2a6df4);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 2px 6px rgba(31, 42, 68, 0.06);
}
.promoter-banner__body {
    flex: 1 1 auto;
    font-size: 0.96rem;
    line-height: 1.45;
}
.promoter-banner__body strong {
    display: block;
    margin-bottom: 0.15rem;
}
.promoter-banner__actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex: 0 0 auto;
}
@media (max-width: 575px) {
    .promoter-banner {
        flex-wrap: wrap;
        padding: 0.9rem;
    }
    .promoter-banner__actions {
        width: 100%;
        justify-content: space-between;
    }
}

/* Hint léger sous les filtres */
.community-hint .alert {
    background: #f7f9ff;
    border-color: #e3eaf8;
}

/* Map popup — bloc community */
.map-popup__community {
    color: #4a5773;
    margin-top: 0.25rem;
}
.map-popup__community strong {
    color: #1f2a44;
}

