/**
 * @package     Ifsthe
 * @subpackage  com_ifsthe
 * @author      i-FormaSite
 * @copyright   (C) 2025 i-FormaSite
 * @license     GNU General Public License version 2 or later
 */

/* ==========================================================================
   IFSTHE Site Styles
   ========================================================================== */

/* Variables CSS par défaut (peuvent être surchargées par les paramètres du composant) */
:root {
    --ifsthe-primary: #993366;
    --ifsthe-primary-dark: #7a2952;
    --ifsthe-badge: #993366;
}

/* Component Container */
.com-ifsthe-therapeutes,
.com-ifsthe-therapeute {
    padding: 1rem 0;
}

/* ==========================================================================
   BACK TO LIST LINK
   ========================================================================== */

.ifsthe-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: linear-gradient(135deg, var(--ifsthe-primary), var(--ifsthe-primary-dark));
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(153, 51, 102, 0.3);
}

.ifsthe-back-link:hover {
    transform: translateX(-5px);
    box-shadow: 0 4px 12px rgba(153, 51, 102, 0.4);
    color: #fff !important;
    text-decoration: none !important;
}

.ifsthe-back-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.ifsthe-back-icon svg {
    width: 100%;
    height: 100%;
}

/* Filters Section */
.ifsthe-filters {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
}

.ifsthe-filters .form-control,
.ifsthe-filters .form-select {
    border-radius: 0.25rem;
}

/* Card Styling */
.ifsthe-card {
    position: relative;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    border: 1px solid #e9ecef;
}

.ifsthe-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

.ifsthe-card .card-img-top {
    height: 200px;
    object-fit: cover;
}

.ifsthe-card .card-title a {
    color: inherit;
    text-decoration: none;
}

.ifsthe-card .card-title a:hover {
    color: var(--ifsthe-primary);
}

/* Categories */
.ifsthe-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.ifsthe-categories .badge {
    font-weight: normal;
}

/* Pagination */
.ifsthe-pagination {
    display: flex;
    justify-content: center;
}

/* Detail View */
.ifsthe-detail {
    background: #fff;
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* Header avec image ronde à gauche */
.ifsthe-header-content {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 1.5rem !important;
}

.ifsthe-header-image {
    flex-shrink: 0 !important;
    width: 150px !important;
    min-width: 150px !important;
}

.ifsthe-avatar,
img.ifsthe-avatar {
    width: 150px !important;
    height: 150px !important;
    max-width: 150px !important;
    max-height: 150px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    border: 4px solid var(--ifsthe-primary) !important;
    box-shadow: 0 4px 12px rgba(153, 51, 102, 0.2) !important;
}

.ifsthe-header-info {
    flex: 1 !important;
}

.ifsthe-header-info h1 {
    margin-bottom: 0.5rem;
    color: #333;
}

.ifsthe-header-info .lead {
    color: #666;
    margin-bottom: 0.5rem;
}

.ifsthe-header h1 {
    margin-bottom: 0.5rem;
}

.ifsthe-image img {
    max-width: 100%;
    height: auto;
}

.ifsthe-description .content {
    line-height: 1.7;
}

/* ==========================================================================
   CONTACT SECTION - Nouvelle disposition (v2.2)
   ========================================================================== */

.ifsthe-contact-section {
    background: transparent;
    padding: 0;
}

.ifsthe-section-title {
    color: var(--ifsthe-primary);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 0.5rem 0;
    padding-bottom: 0.35rem;
    border-bottom: 2px solid var(--ifsthe-primary);
}

/* Contact Box */
.ifsthe-contact-box {
    background: transparent;
    padding: 0;
    height: 100%;
}

.ifsthe-contact-grid {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.ifsthe-contact-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    color: #333 !important;
    text-decoration: none !important;
    transition: color 0.2s ease;
}

/* Adresse multi-lignes - aligner en haut */
.ifsthe-contact-row:first-child {
    align-items: flex-start;
}

.ifsthe-contact-row:first-child .ifsthe-contact-icon-box {
    margin-top: 2px;
}

.ifsthe-contact-row:hover {
    color: var(--ifsthe-primary) !important;
    text-decoration: none !important;
}

.ifsthe-contact-icon-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    min-width: 24px;
    color: var(--ifsthe-primary);
    font-size: 0.9rem;
    flex-shrink: 0;
}

.ifsthe-contact-value {
    flex: 1;
    font-size: 0.9rem;
    line-height: 1.35;
    color: #333;
}

/* Messaging Box */
.ifsthe-messaging-box {
    background: transparent;
    padding: 0;
    height: 100%;
}

.ifsthe-messaging-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ifsthe-msg-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    color: #fff !important;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 0.9rem;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.ifsthe-msg-btn:hover {
    transform: translateX(5px);
    filter: brightness(1.1);
    color: #fff !important;
    text-decoration: none !important;
}

.ifsthe-msg-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

/* ==========================================================================
   EVENTS LIST - Nouveau design timeline
   ========================================================================== */

.ifsthe-evenements h2 {
    color: var(--ifsthe-primary);
    margin-bottom: 1.5rem;
}

.ifsthe-events-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ifsthe-event-card {
    display: flex;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ifsthe-event-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 20px rgba(153, 51, 102, 0.15);
}

/* Date block à gauche */
.ifsthe-event-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 90px;
    padding: 1rem;
    background: linear-gradient(135deg, var(--ifsthe-primary), var(--ifsthe-primary-dark));
    color: #fff;
    text-align: center;
}

.ifsthe-event-day {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.ifsthe-event-month {
    font-size: 0.9rem;
    text-transform: uppercase;
    font-weight: 600;
    margin-top: 0.25rem;
}

.ifsthe-event-year {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-top: 0.15rem;
}

/* Événements sur plusieurs jours */
.ifsthe-event-multiday {
    min-width: 100px;
}

.ifsthe-event-multiday .ifsthe-event-day {
    font-size: 1.5rem;
}

.ifsthe-event-day-range {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
}

.ifsthe-event-separator {
    font-size: 1rem;
    margin: 0.15rem 0;
    opacity: 0.7;
}

/* Contenu à droite */
.ifsthe-event-content {
    flex: 1;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ifsthe-event-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.ifsthe-event-desc {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
}

.ifsthe-event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.85rem;
    color: #888;
}

.ifsthe-event-time {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.ifsthe-event-location {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--ifsthe-primary);
    text-decoration: none;
}

.ifsthe-event-location:hover {
    text-decoration: underline;
}

.ifsthe-event-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--ifsthe-primary);
    color: #fff !important;
    text-decoration: none;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background 0.2s ease;
    align-self: flex-start;
}

.ifsthe-event-link:hover {
    background: var(--ifsthe-primary-dark);
    color: #fff !important;
    text-decoration: none;
}

/* ==========================================================================
   CONTACT CARD - Sidebar (v2.1 - Design moderne épuré)
   ========================================================================== */

.ifsthe-contact-card {
    background: linear-gradient(145deg, var(--ifsthe-primary), var(--ifsthe-primary-dark));
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(153, 51, 102, 0.3);
    min-width: 280px;
}

.ifsthe-contact-title {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 1.25rem 0;
    text-align: center;
}

.ifsthe-contact-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

/* Item de contact - style épuré sans fond */
.ifsthe-contact-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.6rem 0.5rem;
    color: #fff !important;
    text-decoration: none !important;
    transition: all 0.2s ease;
    border-radius: 8px;
}

.ifsthe-contact-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff !important;
    text-decoration: none !important;
}

/* Adresse - alignement haut pour multi-lignes */
.ifsthe-contact-item.ifsthe-contact-address {
    align-items: flex-start;
}

.ifsthe-contact-item.ifsthe-contact-address .ifsthe-contact-icon {
    margin-top: 2px;
}

/* Icône - ronde et compacte */
.ifsthe-contact-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    min-width: 32px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--ifsthe-primary);
    border-radius: 50%;
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* Texte - aligné à gauche */
.ifsthe-contact-text {
    flex: 1;
    font-size: 0.9rem;
    line-height: 1.4;
    text-align: left;
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
}

/* Emails et URLs - ne pas couper au milieu */
.ifsthe-contact-item[href^="mailto:"] .ifsthe-contact-text,
.ifsthe-contact-item[href^="http"] .ifsthe-contact-text {
    word-break: break-all;
    hyphens: none;
    -webkit-hyphens: none;
}

/* Séparateur avant messageries */
.ifsthe-messaging {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

/* Contact Subtitle (Messageries) */
.ifsthe-contact-subtitle {
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 0.75rem 0;
    text-align: center;
    opacity: 0.9;
}

/* ==========================================================================
   MESSAGERIES INSTANTANÉES - WhatsApp, Signal, Telegram
   ========================================================================== */

.ifsthe-messaging {
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.ifsthe-messaging-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ifsthe-messaging-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    color: #fff !important;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 0.95rem;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.ifsthe-messaging-btn:hover {
    transform: translateX(5px);
    filter: brightness(1.1);
    color: #fff !important;
    text-decoration: none !important;
}

.ifsthe-messaging-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

/* WhatsApp */
.ifsthe-whatsapp {
    background: #25D366;
}

.ifsthe-whatsapp:hover {
    background: #20bd5a;
}

/* Signal */
.ifsthe-signal {
    background: #3A76F0;
}

.ifsthe-signal:hover {
    background: #2d63d6;
}

/* Telegram */
.ifsthe-telegram {
    background: #0088cc;
}

.ifsthe-telegram:hover {
    background: #0077b5;
}

/* Address Link */
.ifsthe-address-link {
    transition: color 0.2s ease;
}

.ifsthe-address-link:hover {
    color: var(--ifsthe-primary) !important;
}

.ifsthe-address-link .icon-out-2 {
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.ifsthe-address-link:hover .icon-out-2 {
    opacity: 1;
}

/* ==========================================================================
   CARD FOOTER - Voir les détails
   ========================================================================== */

.ifsthe-card .ifsthe-card-footer,
.ifsthe-card .card-footer.ifsthe-card-footer {
    background-color: var(--ifsthe-primary) !important;
    background: var(--ifsthe-primary) !important;
    border-top: none !important;
    border-radius: 0 0 calc(0.375rem - 1px) calc(0.375rem - 1px) !important;
    padding: 0 !important;
}

.ifsthe-card .ifsthe-details-link,
a.ifsthe-details-link {
    display: block !important;
    width: 100% !important;
    padding: 1rem 1rem !important;
    color: #fff !important;
    text-align: center !important;
    text-decoration: none !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    transition: background-color 0.2s ease;
}

.ifsthe-card .ifsthe-details-link:hover,
a.ifsthe-details-link:hover {
    background-color: var(--ifsthe-primary-dark) !important;
    color: #fff !important;
    text-decoration: none !important;
}

/* ==========================================================================
   EVENTS BADGE - Pictogramme événements (haut droite)
   ========================================================================== */

.ifsthe-events-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: #fff;
    color: var(--ifsthe-primary);
    padding: 0.4rem 0.6rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.ifsthe-events-badge .icon-calendar {
    font-size: 1rem;
    color: var(--ifsthe-primary);
}

.ifsthe-events-count {
    min-width: 1rem;
    text-align: center;
    color: var(--ifsthe-primary);
    font-weight: 700;
}

/* ==========================================================================
   CARD BODY - Structure en blocs
   ========================================================================== */

/* Tous les éléments du card-body en blocs séparés */
.ifsthe-card .card-body {
    display: flex;
    flex-direction: column;
}

.ifsthe-card .card-title {
    display: block !important;
    width: 100% !important;
    margin-bottom: 0.25rem;
}

.ifsthe-card .card-subtitle {
    display: block !important;
    width: 100% !important;
    margin-bottom: 0.5rem !important;
}

/* ==========================================================================
   CATEGORIES - Sur ligne séparée
   ========================================================================== */

.ifsthe-card .ifsthe-categories {
    display: block !important;
    width: 100% !important;
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
    clear: both;
}

.ifsthe-categories .badge {
    font-weight: normal;
    font-size: 0.75rem;
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
    display: inline-block;
    background-color: var(--ifsthe-primary) !important;
}

/* ==========================================================================
   PUBLICITES DANS LA GRILLE
   ========================================================================== */

/* Carte publicitaire - mêmes dimensions que .ifsthe-card */
.ifsthe-ad-card {
    position: relative;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #fff;
}

.ifsthe-ad-card img {
    max-width: 100%;
    height: auto;
    display: block;
}

.ifsthe-ad-card .ifsthe-ad-link {
    display: block;
    width: 100%;
    transition: opacity 0.2s ease;
}

.ifsthe-ad-card .ifsthe-ad-link:hover {
    opacity: 0.9;
}

/* Label "Publicité" discret en bas */
.ifsthe-ad-label {
    display: block;
    text-align: center;
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Variante bannière pleine largeur */
.ifsthe-ad-card--banner {
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
}

.ifsthe-ad-card--banner .ifsthe-ad-link {
    flex: 1;
}

.ifsthe-ad-card--banner img {
    width: 100%;
}

.ifsthe-ad-card--banner .ifsthe-ad-label {
    width: 100%;
}

/* ==========================================================================
   ANIMATIONS (sur les cartes uniquement)
   ========================================================================== */

/* Animation: Fade */
.ifsthe-animate-fade {
    opacity: 0;
    animation: ifsthe-fadeIn 0.6s ease-out forwards;
}

@keyframes ifsthe-fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

/* Animation: Slide */
.ifsthe-animate-slide {
    opacity: 0;
    transform: translateY(40px);
    animation: ifsthe-slideUp 0.6s ease-out forwards;
}

@keyframes ifsthe-slideUp {
    0% {
        opacity: 0;
        transform: translateY(40px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animation: Zoom */
.ifsthe-animate-zoom {
    opacity: 0;
    transform: scale(0.7);
    animation: ifsthe-zoomIn 0.6s ease-out forwards;
}

@keyframes ifsthe-zoomIn {
    0% {
        opacity: 0;
        transform: scale(0.7);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

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

@media (max-width: 767.98px) {
    .ifsthe-filters .row > div {
        margin-bottom: 0.75rem;
    }

    .ifsthe-detail {
        padding: 1rem;
    }

    /* Contact section sur mobile */
    .ifsthe-contact-section {
        padding: 1rem;
    }

    .ifsthe-contact-box,
    .ifsthe-messaging-box {
        padding: 1rem;
    }

    .ifsthe-msg-btn {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }

    .ifsthe-card .card-img-top {
        height: 150px;
    }

    /* Badge événements sur mobile */
    .ifsthe-events-badge {
        top: 8px;
        right: 8px;
        padding: 0.3rem 0.5rem;
        font-size: 0.75rem;
    }

    .ifsthe-events-badge .icon-calendar {
        font-size: 0.85rem;
    }

    /* Footer sur mobile */
    .ifsthe-details-link {
        padding: 0.85rem 0.75rem;
        font-size: 1rem;
    }

    /* Header détail sur mobile - image centrée au-dessus */
    .ifsthe-header-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .ifsthe-avatar {
        width: 120px;
        height: 120px;
    }

    .ifsthe-header-info {
        text-align: center;
    }

    .ifsthe-header-info .ifsthe-categories {
        justify-content: center;
    }

    /* Events cards sur mobile */
    .ifsthe-event-card {
        flex-direction: column;
    }

    .ifsthe-event-date {
        flex-direction: row;
        gap: 0.5rem;
        min-width: auto;
        padding: 0.75rem 1rem;
    }

    .ifsthe-event-day {
        font-size: 1.5rem;
    }

    .ifsthe-event-month {
        font-size: 0.85rem;
    }

    .ifsthe-event-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media (max-width: 575.98px) {
    .ifsthe-filters {
        padding: 1rem;
    }

    .ifsthe-header h1 {
        font-size: 1.5rem;
    }

    .ifsthe-event-content {
        padding: 1rem;
    }

    .ifsthe-event-title {
        font-size: 1rem;
    }

    .ifsthe-avatar {
        width: 100px;
        height: 100px;
        border-width: 3px;
    }
}
