/* Styles modernes pour la popup de prévisualisation de profil */
/* Utilise les variables CSS du thème documentées dans /dev/doc/css.txt */

/* Container principal */
.profile-preview-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* z-index géré dynamiquement par setModalZIndex() */
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.6) 100%);
    backdrop-filter: blur(10px);
    display: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

.profile-preview-popup.show {
    opacity: 1;
}

/* Contenu de la popup - Bottom sheet moderne */
.profile-preview-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 400px; /* Taille fixe en pixels pour les petits écrans */
    max-height: 55vh; /* Limite pour les grands écrans */
    background: var(--bg-white);
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

/* État expanded - 95% de hauteur */
.profile-preview-popup.expanded .profile-preview-content {
    height: 95vh;
    max-height: 95vh;
    border-radius: 20px 20px 0 0;
}

.profile-preview-popup.show .profile-preview-content {
    transform: translateY(0);
}

/* Header avec image de fond */
.preview-header {
    background: var(--gradient-bg); /* Fallback si pas d'image */
    padding: 20px 0; /* Enlever padding left/right */
    border-radius: 24px 24px 0 0;
    position: relative;
    flex-shrink: 0;
    min-height: 200px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Overlay léger pour lisibilité du texte */
.preview-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, 
        rgba(0, 0, 0, var(--overlay-opacity, 0.1)) 0%, 
        rgba(0, 0, 0, var(--overlay-opacity, 0.3)) 100%
    );
    border-radius: 24px 24px 0 0;
    z-index: 1;
}

/* Gestion spéciale pour les images avec flou (portraits) */
.preview-header.portrait-blur {
    filter: blur(15px) brightness(1.2);
    --overlay-opacity: 0.4;
}

.preview-header.portrait-blur::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, 
        rgba(0, 0, 0, 0.2) 0%, 
        rgba(0, 0, 0, 0.4) 100%
    );
    border-radius: 24px 24px 0 0;
    z-index: 1;
}

/* S'assurer que le contenu est au-dessus de tous les overlays */
.preview-header > * {
    position: relative;
    z-index: 3;
}

.profile-preview-popup.expanded .preview-header {
    border-radius: 20px 20px 0 0;
}

.profile-preview-popup.expanded .preview-header::before {
    border-radius: 20px 20px 0 0;
}

.profile-preview-popup.expanded .preview-header.portrait-blur::after {
    border-radius: 20px 20px 0 0;
}

/* Barre de glissement moderne */
.preview-drag-bar {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 2px;
    cursor: grab;
}

.preview-drag-bar:active {
    cursor: grabbing;
}

/* Indicateur de type de profil en haut à gauche */
.preview-profile-type-indicator {
    position: absolute;
    left: 20px;
    top: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--primary);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 15;
}

/* Styles spécifiques par type de profil */
.preview-profile-type-indicator.type-homme {
    color: #3498db;
}

.preview-profile-type-indicator.type-homme-gay {
    background: linear-gradient(135deg, #ff0000, #ff8c00, #ffff00, #00ff00, #0000ff, #8b00ff);
    color: white;
}

.preview-profile-type-indicator.type-femme {
    color: #e91e63;
}

.preview-profile-type-indicator.type-femme-gay {
    background: linear-gradient(135deg, #ff0000, #ff8c00, #ffff00, #00ff00, #0000ff, #8b00ff);
    color: white;
}

.preview-profile-type-indicator.type-couple {
    color: #ff4081;
}

.preview-profile-type-indicator.type-trans {
    color: #9c27b0;
}

.preview-profile-type-indicator.type-travesti {
    color: #673ab7;
}

.preview-profile-type-indicator.type-nonbinaire {
    color: #795548;
}

/* Boutons de navigation entre profils */
.preview-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    color: var(--primary);
    font-size: 18px;
    padding: 12px;
    cursor: pointer;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    z-index: 16;
}

.preview-nav-prev {
    left: 10px;
}

.preview-nav-next {
    right: 10px;
}

.preview-nav-btn:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.preview-nav-btn:active {
    transform: translateY(-50%) scale(0.95);
}

/* Ajustement pour le mode expanded */
.profile-preview-popup.expanded .preview-nav-btn {
    top: 80px; /* Plus bas en mode expanded pour éviter le chevauchement */
}

/* Bouton expand en haut à droite de la popup */
.preview-expand-btn {
    position: absolute;
    right: 20px;
    top: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 16px;
    padding: 12px;
    cursor: pointer;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
    z-index: 15;
    pointer-events: auto;
}

.preview-expand-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* Profile info header - simplifié */
.preview-profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    margin-top: 60px; /* Plus d'espace maintenant qu'il n'y a plus de stats */
}

.preview-user-details {
    color: white;
}

/* Body scrollable moderne */
.preview-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--bg-white);
}

/* Loading moderne */
.preview-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    gap: 16px;
}

.preview-loading .spinner-border {
    width: 40px;
    height: 40px;
    border-width: 3px;
}

/* Content sections */
.preview-content {
    display: none;
    padding: 24px;
}

/* Bio section */
.preview-bio-section {
    margin-bottom: 24px;
}

.preview-bio-section h6 {
    color: var(--title);
    font-weight: 600;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.preview-bio-text {
    color: var(--body-color);
    font-size: 0.9rem;
    line-height: 1.5;
    background: var(--gradient-bg-2);
    padding: 16px;
    border-radius: var(--border-radius-base);
    border-left: 4px solid var(--primary);
}

/* Barre d'actions intégrée dans l'image */
.preview-actions-bar {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
    z-index: 5;
}

/* Le username n'est plus affiché dans la barre d'actions */
.preview-username-display {
    display: none;
}

.preview-actions-icons {
    display: flex;
    gap: 8px;
}

.preview-icon-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 16px;
    backdrop-filter: blur(10px);
}

.preview-icon-btn:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

.preview-heart-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    backdrop-filter: blur(10px);
}

.preview-heart-btn.active {
    background: var(--bs-danger);
    color: white;
}

.preview-heart-btn.active:hover {
    background: var(--bs-danger);
    color: white;
}

/* Photos section moderne */
.preview-photos-section {
    margin-bottom: 24px;
}

.preview-section-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 16px;
}

.preview-section-title {
    color: var(--title);
    font-weight: 600;
    margin: 0;
    font-size: 0.95rem;
}

.preview-photo-count {
    background: var(--primary-light);
    color: var(--primary);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.preview-photos-grid {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding: 0 24px 16px 24px;
    margin: 0 -24px 16px -24px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.preview-photos-grid::-webkit-scrollbar {
    display: none;
}

.gallery-box {
    position: relative;
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    border-radius: var(--border-radius-base);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--border-color-2);
}

.gallery-box:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.preview-photo-item {
    width: 100%;
    height: 100%;
}

.preview-photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.2s ease;
}

.gallery-box:hover .preview-photo-item img {
    transform: scale(1.1);
}

/* Photos privées avec overlay moderne */
.photo-lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    border-radius: var(--border-radius-base);
}

.photo-lock-overlay i {
    background: rgba(255, 255, 255, 0.2);
    padding: 12px;
    border-radius: 50%;
    backdrop-filter: blur(10px);
}

/* État expanded - sections supplémentaires */
.preview-expanded-content {
    display: none;
}

.profile-preview-popup.expanded .preview-expanded-content {
    display: block;
}

/* Sections de caractéristiques et préférences */
.preview-characteristics-section,
.preview-partner-section,
.preview-preferences-section {
    margin-bottom: 24px;
}

.preview-section-title {
    color: var(--title);
    font-weight: 600;
    margin-bottom: 16px;
    font-size: 1rem;
    display: flex;
    align-items: center;
}

/* Grille de caractéristiques */
.characteristics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.characteristic-item {
    background: var(--gradient-bg-2);
    padding: 12px;
    border-radius: var(--border-radius-base);
    border-left: 3px solid var(--primary);
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.characteristic-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.characteristic-item.active {
    background: var(--primary-light);
    border-left-color: var(--primary);
}

/* Tooltip au clic pour les caractéristiques */
.characteristic-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bs-dark);
    color: white;
    padding: 10px 15px;
    border-radius: var(--border-radius-base);
    font-size: 0.85rem;
    white-space: normal;
    width: 200px;
    text-align: center;
    z-index: 1000;
    margin-bottom: 10px;
    display: none;
    animation: fadeIn 0.2s ease;
}

.characteristic-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: var(--bs-dark);
}

.characteristic-item.show-tooltip .characteristic-tooltip {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.characteristic-label {
    font-size: 0.8rem;
    color: var(--body-color);
    opacity: 0.8;
    margin-bottom: 4px;
}

.characteristic-value {
    font-weight: 600;
    color: var(--title);
    font-size: 0.9rem;
}

/* Conteneur compact de préférences */
.preferences-compact-container {
    background: var(--gradient-bg-2);
    padding: 20px;
    border-radius: var(--border-radius-base);
    border-left: 4px solid var(--primary);
}

.preference-all-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Tags compacts avec emoji */
.preference-compact-tag {
    background: var(--border-color-2);
    color: var(--body-color);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
    cursor: pointer;
    display: inline-block;
}

.preference-compact-tag:hover {
    background: var(--primary-light);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Couleurs par type de tag */
.preference-tag-experience {
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.preference-tag-place {
    border: 1px solid rgba(52, 152, 219, 0.3);
}

.preference-tag-group {
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.preference-tag-practice {
    border: 1px solid rgba(155, 89, 182, 0.3);
}

.preference-tag-seeking {
    border: 1px solid rgba(231, 76, 60, 0.3);
}

/* Tooltip pour les tags compacts */
.preference-tag-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bs-dark);
    color: white;
    padding: 10px 15px;
    border-radius: var(--border-radius-base);
    font-size: 0.8rem;
    white-space: normal;
    max-width: 250px;
    text-align: center;
    z-index: 1000;
    margin-bottom: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.2s ease;
}

.preference-tag-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: var(--bs-dark);
}


/* Info supplémentaire pour expanded */
.preview-additional-info {
    display: grid;
    gap: 16px;
}

.preview-info-item {
    padding: 16px;
    background: var(--gradient-bg-2);
    border-radius: var(--border-radius-base);
    border-left: 4px solid var(--primary);
}

.preview-info-item h6 {
    margin: 0 0 8px 0;
    color: var(--title);
    font-size: 0.9rem;
    font-weight: 600;
}

.preview-info-item p {
    margin: 0;
    color: var(--body-color);
    font-size: 0.85rem;
}

/* Empty state moderne */
.preview-empty-photos {
    text-align: center;
    padding: 40px 20px;
    color: var(--body-color);
}

.preview-empty-photos i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.3;
}

/* Responsive moderne */
@media (max-width: 576px) {
    .profile-preview-content {
        height: 350px; /* Plus petit sur mobile */
        max-height: 60vh;
    }
    
    .profile-preview-popup.expanded .profile-preview-content {
        height: 95vh; /* Presque plein écran en expanded */
        max-height: 95vh;
        border-radius: 12px 12px 0 0; /* Bordures plus petites sur mobile */
    }
    
    .preview-profile-header {
        gap: 12px;
        margin-top: 40px; /* Moins d'espace sur mobile */
    }
    
    .preview-actions-bar {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .preview-actions-icons {
        justify-content: center;
    }
}

/* Pour les très petits écrans (iPhone SE, etc.) */
@media (max-width: 375px) {
    .profile-preview-content {
        height: 320px; /* Encore plus petit */
    }
    
    .preview-header {
        min-height: 150px; /* Header plus compact */
    }
    
    .preview-profile-type-indicator,
    .preview-expand-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
}

/* Mode sombre moderne */
[data-bs-theme="dark"] .profile-preview-content {
    background: var(--bs-body-bg);
}

[data-bs-theme="dark"] .preview-body {
    background: var(--bs-body-bg);
}

[data-bs-theme="dark"] .preview-bio-text {
    background: var(--bs-secondary-bg);
    border-left-color: var(--primary);
}

[data-bs-theme="dark"] .preview-info-item {
    background: var(--bs-secondary-bg);
}

[data-bs-theme="dark"] .btn-secondary {
    background: var(--bs-secondary-bg);
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .btn-secondary:hover {
    background: var(--bs-border-color);
}

[data-bs-theme="dark"] .preview-profile-type-indicator {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

[data-bs-theme="dark"] .preview-profile-type-indicator.type-homme-gay,
[data-bs-theme="dark"] .preview-profile-type-indicator.type-femme-gay {
    background: linear-gradient(135deg, #ff0000, #ff8c00, #ffff00, #00ff00, #0000ff, #8b00ff);
}

[data-bs-theme="dark"] .preview-nav-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--bs-body-color);
    backdrop-filter: blur(10px);
}

[data-bs-theme="dark"] .preview-nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}