/* Styles spécifiques pour l'interface Tinder (testa.php) */

/* --- STYLES DE BASE --- */
/* Layout principal pour remplir l'écran sans scroll */
body.body-test-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh; 
    height: 100vh; 
    margin: 0;
    overflow: hidden; 
    background-color: #f5f5f5; /* Fond plus léger */
}

body.body-test-page header,
body.body-test-page footer {
    flex-shrink: 0;
}

body.body-test-page main {
    flex-grow: 1; 
    display: flex; 
    flex-direction: column; 
    overflow: hidden; 
    min-height: 0; 
    max-width: none; 
    padding: 0;
    margin: 0;
}

/* --- CONTENEUR TINDER --- */
body.body-test-page .tinder-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    min-height: 0;
    padding: 10px 10px 0;
    box-sizing: border-box;
}

/* La zone des cartes doit remplir l'espace au-dessus des actions */
body.body-test-page .tinder-cards {
    flex-grow: 1;
    position: relative;
    overflow: hidden;
    width: 100%;
    border-radius: 16px; /* Arrondi global pour les cartes */
}

/* --- STYLE DES CARTES --- */
body.body-test-page .tinder-card {
    position: absolute; 
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    overflow: hidden;
    display: flex; 
    flex-direction: column; 
    justify-content: flex-end; 
    border-radius: 16px; /* Légèrement plus arrondi */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1); /* Ombre plus douce */
    border: 1px solid rgba(255, 255, 255, 0.1); 
    /* Animation plus agréable pour le retour après drag */
    transition: transform 0.6s cubic-bezier(0.18, 0.89, 0.32, 1.28), 
                opacity 0.4s ease-out,
                box-shadow 0.3s ease,
                background-image 0.3s ease-in-out;
    cursor: grab;
    user-select: none;
    will-change: transform, opacity;
    -webkit-tap-highlight-color: transparent;
    transform-origin: center center;
}

/* Styles lorsque la carte est activement déplacée */
body.body-test-page .tinder-card.dragging {
    transition: none;
    cursor: grabbing;
    z-index: 100 !important;
}

/* Nouvelles classes spécifiques pour les animations d'action */
body.body-test-page .tinder-card.action-like {
    z-index: 100 !important;
    /* Animation spécifique pour le like */
    box-shadow: 0 15px 35px rgba(76, 175, 80, 0.2);
}

body.body-test-page .tinder-card.action-dislike {
    z-index: 100 !important;
    /* Animation spécifique pour le dislike */
    box-shadow: 0 15px 35px rgba(255, 77, 77, 0.2);
}

body.body-test-page .tinder-card.action-superlike {
    z-index: 100 !important;
    /* Animation spécifique pour le superlike */
    box-shadow: 0 20px 40px rgba(255, 20, 147, 0.3);
}

/* Fond pour carte vide */
body.body-test-page .tinder-card.no-more-cards {
    background-color: white !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ajuster le contenu de la carte */
body.body-test-page .tinder-card-content {
    padding: 15px 18px; 
    background: linear-gradient(to top, 
                rgba(0,0,0,0.95) 0%, 
                rgba(0,0,0,0.8) 20%, 
                rgba(0,0,0,0.6) 40%, 
                rgba(0,0,0,0.4) 60%, 
                rgba(0,0,0,0.1) 80%, 
                transparent 100%); /* Dégradé amélioré pour meilleure lisibilité */
    color: white;
    width: 100%;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    box-sizing: border-box;
    z-index: 2;
}

/* --- NOUVEAUX STYLES PROFIL --- */
body.body-test-page .profile-info {
    margin-bottom: 10px;
}

body.body-test-page .profile-info h3 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 1.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

body.body-test-page .profile-age {
    font-size: 1.4rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

body.body-test-page .profile-services {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

body.body-test-page .service-badge {
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.2s ease;
}

body.body-test-page .service-badge:active {
    background-color: rgba(255, 255, 255, 0.25);
    transform: scale(0.95);
}

body.body-test-page .service-badge.more {
    background-color: rgba(255, 20, 147, 0.3);
    border-color: rgba(255, 20, 147, 0.5);
}

body.body-test-page .profile-bio {
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 10px;
    opacity: 0.9;
    max-height: 4.2em; /* Environ 3 lignes */
    overflow: hidden;
    position: relative;
    color: rgba(255, 255, 255, 0.95);
}

body.body-test-page .profile-bio::after {
    content: "";
    position: absolute;
    bottom: 0;
    right: 0;
    width: 30%;
    height: 1.4em;
    background: linear-gradient(to right, transparent, rgba(0,0,0,0.7));
    pointer-events: none;
}

/* Animation d'entrée pour les éléments de profil */
@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body.body-test-page .profile-info h3 {
    animation: fadeSlideUp 0.5s ease-out forwards;
}

body.body-test-page .profile-services {
    animation: fadeSlideUp 0.5s ease-out 0.1s forwards;
    opacity: 0;
    transform: translateY(10px);
    animation-fill-mode: forwards;
}

body.body-test-page .profile-bio {
    animation: fadeSlideUp 0.5s ease-out 0.2s forwards;
    opacity: 0;
    transform: translateY(10px);
    animation-fill-mode: forwards;
}

/* --- BOUTONS D'ACTION --- */
body.body-test-page .tinder-actions {
    flex-shrink: 0;
    padding: 15px 0; 
    background-color: transparent;
    box-shadow: none;
    z-index: 10;
    display: flex;
    justify-content: space-around;
    align-items: center;
    position: relative;
    margin-top: -70px; /* Remonte davantage les boutons */
    padding-bottom: calc(15px + env(safe-area-inset-bottom)); /* Pour iPhone X+ */
}

/* Style de base pour TOUS les boutons d'action */
body.body-test-page .tinder-action-btn {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28), 
                background-color 0.3s ease,
                box-shadow 0.3s ease;
    color: #555;
    -webkit-tap-highlight-color: transparent; /* Supprimer highlight tactile */
}

/* Nouvelle classe pour animation des boutons lors d'un clic */
body.body-test-page .tinder-action-btn.active-action {
    animation: buttonPulse 0.7s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

/* Animation pour les boutons d'action */
@keyframes buttonPulse {
    0% { transform: scale(1); }
    30% { transform: scale(1.2); }
    50% { transform: scale(1.15); }
    70% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Animation spécifique pour chaque type de bouton */
body.body-test-page .tinder-action-btn.dislike.active-action {
    background-color: rgba(255, 77, 77, 0.15);
    color: #ff4d4d;
    box-shadow: 0 0 15px rgba(255, 77, 77, 0.4);
}

body.body-test-page .tinder-action-btn.like.active-action {
    background-color: rgba(76, 175, 80, 0.15);
    color: #4caf50;
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.4);
}

body.body-test-page .tinder-action-btn.superlike.active-action {
    background-color: rgba(255, 20, 147, 0.9);
    box-shadow: 0 0 15px rgba(255, 20, 147, 0.6);
}

/* Styles spécifiques par bouton */
body.body-test-page .tinder-action-btn.dislike {
    color: #ff4d4d;
}

body.body-test-page .tinder-action-btn.superlike {
    width: 50px;
    height: 50px;
    background-color: var(--primary-color, #ff1493);
    color: var(--light-color, #ffffff);
}

body.body-test-page .tinder-action-btn.superlike:active {
    background-color: var(--secondary-color, #ff69b4);
    transform: scale(0.95);
}

body.body-test-page .tinder-action-btn.like {
    color: #4caf50;
}

/* --- VIGNETTES --- */
body.body-test-page .card-thumbnails {
    display: flex;
    gap: 6px;
    margin-top: 12px; /* Augmenté pour donner plus d'espace après les infos */
    overflow-x: auto;
    padding-bottom: 5px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch; /* Pour scroll fluide iOS */
    animation: fadeSlideUp 0.5s ease-out 0.3s forwards;
    opacity: 0;
    transform: translateY(10px);
    animation-fill-mode: forwards;
}

body.body-test-page .card-thumbnails::-webkit-scrollbar {
    display: none;
}

body.body-test-page .thumbnail-item {
    width: 46px;
    height: 66px;
    background-size: cover;
    background-position: center;
    border-radius: 6px; /* Plus arrondi */
    border: 2px solid rgba(255,255,255,0.4); /* Bordure subtile */
    flex-shrink: 0;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease;
    position: relative;
    overflow: hidden; /* Cacher débordement */
}

body.body-test-page .thumbnail-item:active {
    transform: scale(0.95); /* Feedback tactile */
}

body.body-test-page .thumbnail-item.active {
    border-color: white;
    transform: scale(1.05); /* Légèrement plus grand */
}

/* Indicateur vidéo */
body.body-test-page .thumbnail-item.thumbnail-video::after {
    content: "▶";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    text-shadow: 0 0 3px rgba(0,0,0,0.8);
}

/* --- INFO CARTE --- */
body.body-test-page .card-top-right-info {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    z-index: 5;
}

body.body-test-page .card-top-right-info span {
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 4px 10px;
    border-radius: 50px; /* Complètement rond */
    font-size: 0.8em;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* --- BADGES LIKE/NOPE --- */
body.body-test-page .status-badge {
    position: absolute;
    top: 20%;
    font-size: 2em;
    font-weight: bold;
    color: white;
    border: 4px solid white;
    padding: 5px 15px;
    border-radius: 10px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
    opacity: 0;
    transform: rotate(0deg) scale(0.8);
    transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    z-index: 10;
}

body.body-test-page .status-badge.nope {
    left: 20px;
    border-color: #ff4d4d;
    color: #ff4d4d;
    transform: rotate(-20deg) scale(0.8);
}

body.body-test-page .status-badge.like {
    right: 20px;
    border-color: #4caf50;
    color: #4caf50;
    transform: rotate(20deg) scale(0.8);
}

/* --- BOUTON RELOAD --- */
body.body-test-page .reload-btn {
    margin-top: 15px;
    padding: 10px 20px;
    background-color: var(--primary-color, #ff1493);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
}

body.body-test-page .reload-btn:active {
    background-color: var(--secondary-color, #ff69b4);
}

/* --- MESSAGE DESKTOP --- */
body.body-test-page .desktop-message {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white;
    border-radius: 16px;
    padding: 20px;
    z-index: 100;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

body.body-test-page .desktop-message-content {
    max-width: 500px;
    text-align: center;
    padding: 30px;
    border-radius: 10px;
    background-color: #f9f9f9;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

body.body-test-page .desktop-message-content svg {
    color: var(--primary-color, #ff1493);
    margin-bottom: 15px;
}

body.body-test-page .desktop-message-content h3 {
    margin: 0 0 15px;
    color: #333;
}

body.body-test-page .desktop-message-content p {
    margin: 0 0 20px;
    color: #666;
}

body.body-test-page .desktop-message-content .sub-text {
    font-size: 0.9em;
    color: #888;
}

body.body-test-page #qrcode-container {
    width: 180px;
    height: 180px;
    margin: 15px auto;
    background-color: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
}

body.body-test-page .current-url {
    font-size: 0.8em;
    color: #999;
    word-break: break-all;
}

/* Indicateur de swipe - animation continue pour attirer l'attention */
body.body-test-page .swipe-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 12px 20px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0.9;
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 5;
    animation: fadeInOut 3s ease-in-out forwards;
}

body.body-test-page .swipe-indicator svg {
    animation: swipeHint 2s ease-in-out infinite;
}

@keyframes swipeHint {
    0% { transform: translateX(0); opacity: 0.7; }
    50% { transform: translateX(-8px); opacity: 1; }
    100% { transform: translateX(0); opacity: 0.7; }
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
    15% { opacity: 0.9; transform: translate(-50%, -50%) scale(1); }
    85% { opacity: 0.9; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
}

/* --- EFFETS VISUELS POUR LES ACTIONS --- */
/* Effet pulsation pour les badges service */
@keyframes badgePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

body.body-test-page .service-badge.pulse {
    animation: badgePulse 0.3s ease;
}

/* Effet cœur pour le like */
body.body-test-page .heart-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150px;
    height: 150px;
    color: #4caf50;
    opacity: 0;
    animation: heartBeat 1s ease-out forwards;
    z-index: 50;
    pointer-events: none;
}

@keyframes heartBeat {
    0% { transform: translate(-50%, -50%) scale(0.2); opacity: 0; }
    40% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    80% { transform: translate(-50%, -50%) scale(0.9); opacity: 0.9; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

/* Effet téléphone pour le superlike */
body.body-test-page .phone-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    color: var(--primary-color, #ff1493);
    opacity: 0;
    animation: phonePulse 1s ease-out forwards;
    z-index: 50;
    pointer-events: none;
}

@keyframes phonePulse {
    0% { transform: translate(-50%, -50%) scale(0.2) rotate(-20deg); opacity: 0; }
    40% { transform: translate(-50%, -50%) scale(1.2) rotate(10deg); opacity: 1; }
    70% { transform: translate(-50%, -50%) scale(0.9) rotate(0deg); opacity: 0.9; }
    100% { transform: translate(-50%, -50%) scale(1) rotate(0deg); opacity: 0; }
}

/* --- OPTIMISATIONS POUR TÉLÉPHONES --- */
@media (max-width: 480px) {
    body.body-test-page .tinder-container {
        padding: 5px 5px 0;
    }
    
    body.body-test-page .tinder-card-content h3 {
        font-size: 1.3rem;
    }
    
    body.body-test-page .tinder-actions {
        padding: 10px 0;
        margin-top: -65px;
    }
    
    body.body-test-page .tinder-action-btn {
        width: 55px;
        height: 55px;
    }
    
    body.body-test-page .tinder-action-btn.superlike {
        width: 45px;
        height: 45px;
    }
    
    body.body-test-page .thumbnail-item {
        width: 42px;
        height: 60px;
    }

    body.body-test-page .profile-info h3 {
        font-size: 1.4rem;
    }
    
    body.body-test-page .profile-age {
        font-size: 1.2rem;
    }
    
    body.body-test-page .profile-bio {
        font-size: 0.85rem;
        max-height: 4em;
    }
    
    body.body-test-page .service-badge {
        padding: 3px 8px;
        font-size: 0.75rem;
    }
}