/**
 * Styles pour les nouvelles fonctionnalités UX
 * Module: ps_formations
 */

/* Lien formateur */
.trainer-link {
    color: #3bc8dd;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.trainer-link:hover {
    color: #12A8BE;
    transform: translateX(2px);
}

.trainer-link .material-icons {
    font-size: 16px;
}

/* ============================================
   PARTAGE SOCIAL
   ============================================ */

.share-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.share-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.share-title .material-icons {
    font-size: 18px;
    color: #3bc8dd;
}

.share-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: #fff;
    border: 2px solid #3bc8dd;
    border-radius: 8px;
    color: #3bc8dd;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    width: 100%;
}

.share-btn:hover {
    background: #3bc8dd;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 200, 221, 0.3);
}

.share-btn .material-icons {
    font-size: 18px;
}

/* Variantes de couleurs supprimées - on garde un style unifié */
.share-btn.linkedin:hover {
    background: #3bc8dd;
    border-color: #3bc8dd;
}

.share-btn.email:hover {
    background: #3bc8dd;
    border-color: #3bc8dd;
}

.share-btn.copy:hover {
    background: #3bc8dd;
    border-color: #3bc8dd;
}

.share-toast {
    position: fixed;
    bottom: -100px;
    right: 24px;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    padding: 14px 20px;
    font-size: 14px;
    font-weight: 600;
    z-index: 9999;
    transition: bottom 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.share-toast.show {
    bottom: 24px;
}

.share-toast.share-toast-success {
    border-left: 4px solid #4CAF50;
    color: #2e7d32;
}

.share-toast.share-toast-error {
    border-left: 4px solid #f44336;
    color: #c62828;
}

/* ============================================
   BADGES DE POPULARITÉ
   ============================================ */

.badge-popular {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #FF6B6B, #FF8E53);
    color: #fff;
    padding: 5px 12px;
    border-radius: 14px;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
    z-index: 2;
}

.badge-urgent {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #FFF3CD;
    color: #856404;
    border: 1px solid #FFE5A0;
    padding: 5px 12px;
    border-radius: 14px;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    animation: urgentPulse 2s infinite;
    z-index: 2;
}

@keyframes urgentPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.badge-new {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #4CAF50;
    color: #fff;
    padding: 5px 12px;
    border-radius: 14px;
    font-size: 11px;
    font-weight: 700;
    z-index: 2;
}

.occupancy-bar {
    margin: 12px 0;
    background: #f0f0f0;
    border-radius: 8px;
    height: 8px;
    position: relative;
    overflow: hidden;
}

.occupancy-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    border-radius: 8px;
    transition: width 0.4s ease;
}

.occupancy-fill.high {
    background: linear-gradient(90deg, #FF9800, #FF5722);
}

.occupancy-fill.full {
    background: linear-gradient(90deg, #f44336, #c62828);
}

.occupancy-text {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
    display: block;
}

/* ============================================
   FILTRES AVANCÉS
   ============================================ */

.formations-filters {
    margin-bottom: 32px;
    padding: 0 4px;
    overflow: hidden;
    /* Empêche les débordements */
}

.filters-advanced {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    overflow: hidden;
    /* Empêche le débordement */
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

/* Footer avec bouton reset DANS le bloc */
.filters-footer {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    /* Permet le shrink */
}

.filter-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    /* Empêche le retour à la ligne */
}

.filter-label .material-icons {
    font-size: 16px;
    color: #3bc8dd;
}

.filter-select {
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    /* Force le select à prendre toute la largeur du conteneur */
    box-sizing: border-box;
}

.filter-select:hover {
    border-color: #3bc8dd;
}

.filter-select:focus {
    outline: none;
    border-color: #3bc8dd;
    box-shadow: 0 0 0 3px rgba(59, 200, 221, 0.1);
}

/* Slider de prix - ALIGNEMENT PARFAIT */
.price-range-slider {
    position: relative;
    padding: 25px 15px 15px;
    background: #fff;
    border-radius: 8px;
    height: 70px;
    display: flex;
    align-items: flex-start;
}

/* Barre de fond visible */
.price-range-slider::before {
    content: '';
    position: absolute;
    top: 37px;
    left: 15px;
    right: 15px;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    z-index: 1;
}

/* Barre de progression bleue */
.price-range-slider::after {
    content: '';
    position: absolute;
    top: 37px;
    left: 15px;
    right: 15px;
    height: 6px;
    background: linear-gradient(90deg, #3bc8dd, #12A8BE);
    border-radius: 3px;
    z-index: 2;
    pointer-events: none;
}

/* LES DEUX INPUTS EXACTEMENT AU MÊME ENDROIT */
.price-range-slider input[type="range"] {
    position: absolute;
    top: 37px;
    left: 15px;
    width: calc(100% - 30px);
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    pointer-events: none;
    outline: none;
    margin: 0;
    padding: 0;
    border: none;
    z-index: 3;
}

.price-range-slider input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
}

.price-range-slider input[type="range"]::-moz-range-track {
    width: 100%;
    height: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
}

/* Curseurs - PARFAITEMENT CENTRÉS SUR LA LIGNE */
.price-range-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 3px solid #3bc8dd;
    margin-top: -7px;
}

.price-range-slider input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 3px solid #3bc8dd;
}

.price-range-slider input[type="range"]:active::-webkit-slider-thumb {
    box-shadow: 0 4px 12px rgba(59, 200, 221, 0.5);
    transform: scale(1.1);
}

.price-range-slider input[type="range"]:active::-moz-range-thumb {
    box-shadow: 0 4px 12px rgba(59, 200, 221, 0.5);
    transform: scale(1.1);
}

.price-display {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    width: 100%;
    margin-top: 30px;
}

/* Compteur de résultats - EN DEHORS du bloc */
.results-count-only {
    font-size: 15px;
    color: #333;
    font-weight: 700;
    margin-bottom: 24px;
    padding: 0 4px;
}

.btn-reset-filters {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: #fff;
    border: 2px solid #3bc8dd;
    border-radius: 8px;
    color: #3bc8dd;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-reset-filters:hover {
    background: #3bc8dd;
    color: #fff;
    transform: translateY(-1px);
}

.btn-reset-filters .material-icons {
    font-size: 18px;
}

/* Toast filtres */
.filter-toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    z-index: 9999;
    transition: bottom 0.3s ease;
}

.filter-toast.show {
    bottom: 24px;
}

/* ============================================
   MOBILE OPTIMISATIONS
   ============================================ */

/* Sticky FAB */
.mobile-sticky-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.mobile-sticky-fab.hidden {
    transform: translateY(100px);
    opacity: 0;
}

.mobile-sticky-fab .fab-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background: linear-gradient(135deg, #3bc8dd, #12A8BE);
    color: #fff;
    border: none;
    border-radius: 28px;
    font-size: 16px;
    font-weight: 700;
    box-shadow: 0 6px 20px rgba(59, 200, 221, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-sticky-fab .fab-btn:active {
    transform: scale(0.95);
}

.mobile-sticky-fab .material-icons {
    font-size: 20px;
}

/* Bouton toggle filtres mobile */
.mobile-filter-toggle {
    display: none;
    /* Affiché uniquement sur mobile via media query */
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #fff;
    border: 2px solid #3bc8dd;
    border-radius: 24px;
    color: #3bc8dd;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 20px;
    width: 100%;
    justify-content: center;
    position: relative;
}

.mobile-filter-toggle .material-icons {
    font-size: 20px;
}

.mobile-filter-toggle .filter-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ff4757;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

/* Bottom Sheet */
.mobile-filter-sheet {
    position: fixed;
    inset: 0;
    z-index: 10000;
    pointer-events: none;
}

.mobile-filter-sheet.active {
    pointer-events: all;
}

.mobile-filter-sheet .sheet-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-filter-sheet.active .sheet-overlay {
    opacity: 1;
}

.mobile-filter-sheet .sheet-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 24px 24px 0 0;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-filter-sheet.active .sheet-content {
    transform: translateY(0);
}

.mobile-filter-sheet .sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.mobile-filter-sheet .sheet-header h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: #1a1a1a;
}

.mobile-filter-sheet .sheet-close {
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #666;
}

.mobile-filter-sheet .sheet-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.mobile-filter-sheet .sheet-body .filter-group {
    margin-bottom: 20px;
}

.mobile-filter-sheet .sheet-footer {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid #e0e0e0;
}

.mobile-filter-sheet .sheet-footer button {
    flex: 1;
    padding: 14px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    border: none;
}

.mobile-filter-sheet .btn-reset {
    background: #f5f5f5;
    color: #666;
}

.mobile-filter-sheet .btn-apply {
    background: linear-gradient(135deg, #3bc8dd, #12A8BE);
    color: #fff;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .mobile-filter-toggle {
        display: flex;
    }

    .share-buttons {
        flex-direction: column;
        width: 100%;
    }

    .share-btn {
        width: 100%;
        justify-content: center;
    }

    .filter-row {
        grid-template-columns: 1fr;
    }

    .results-count-only {
        text-align: center;
    }

    .filters-footer {
        justify-content: center;
    }

    .btn-reset-filters {
        width: 100%;
    }

    /* Touch targets optimisés */
    .filter-select,
    .btn-reset-filters,
    .share-btn {
        min-height: 44px;
    }

    /* Slider de prix - ajustement mobile */
    .price-range-slider {
        padding: 30px 10px 15px;
        height: 70px;
    }

    .price-range-slider::before,
    .price-range-slider::after {
        top: 36px;
        left: 10px;
        right: 10px;
    }

    .price-range-slider input[type="range"] {
        top: 36px;
        left: 10px;
        right: 10px;
        width: calc(100% - 20px);
    }
}

@media (max-width: 480px) {
    .mobile-sticky-fab {
        right: 16px;
        bottom: 16px;
    }

    .mobile-sticky-fab .fab-btn {
        padding: 12px 20px;
        font-size: 14px;
    }

    .filter-label {
        font-size: 10px;
    }

    .results-count-only {
        font-size: 14px;
    }
}