/* CSS pour la page Témoignages - Livre d'Or */

/* Import de polices premium */
@import url("https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700;900&family=Inter:wght@300;400;500;600;700&family=Cormorant+Garamond:wght@400;500;600;700&display=swap");

/* Variables et reset */
:root {
    --gold: #FFD700;
    --gold-dark: #B8860B;
    --blue-deep: #0A1628;
    --blue-royal: #1E3A8A;
    --blue-light: #3B82F6;
    --purple: #7C3AED;
    --green: #10B981;
    --white: #FFFFFF;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-600: #4B5563;
    --gray-800: #1F2937;
}

/* Forcer l'affichage correct de l'en-tête unifié */
.page-hero-unified {
    height: 32vh !important;
    min-height: 245px !important;
}

.hero-decoration-unified {
    opacity: 0.8 !important;
    z-index: 15 !important;
}

/* Hero Section */
.hero-title-3d {
    font-family: "Playfair Display", serif;
    font-size: clamp(2.8rem, 6vw, 4.5rem);
    font-weight: 900;
    color: transparent;
    background: linear-gradient(
        45deg, 
        var(--gold) 20%, 
        var(--white) 40%, 
        var(--gold) 60%, 
        var(--white) 80%, 
        var(--gold) 100%
    );
    background-size: 300% auto;
    background-clip: text;
    -webkit-background-clip: text;
    animation: shimmerEnhanced 4s linear infinite;
    margin-bottom: 1rem;
    letter-spacing: -1px;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
}

@keyframes shimmerEnhanced {
    0% { background-position: 300% center; }
    100% { background-position: -300% center; }
}

.hero-subtitle-animated {
    font-family: "Inter", sans-serif;
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    font-weight: 300;
    color: var(--gray-200);
    letter-spacing: 3px;
    text-transform: uppercase;
    opacity: 0;
    animation: fadeInUpDelayed 1.2s ease-out 0.8s forwards;
    position: relative;
}

/* Ligne décorative sous le sous-titre */
.hero-subtitle-animated::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    animation: expandLine 1s ease-out 1.5s forwards;
    transform-origin: center;
    scale: 0;
}

@keyframes fadeInUpDelayed {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 0.9;
        transform: translateY(0);
    }
}

@keyframes expandLine {
    from { scale: 0; }
    to { scale: 1; }
}

/* Main Content */
.testimonials-main {
    background: linear-gradient(180deg, var(--gray-50) 0%, var(--white) 50%, var(--gray-50) 100%);
    position: relative;
    overflow: hidden;
    padding: 40px 0 60px;
}

/* Section Title Compact */
.section-header {
    text-align: center;
    padding: 40px 20px 30px;
    position: relative;
}

.section-title-animated {
    font-family: "Cormorant Garamond", serif;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    color: var(--blue-deep);
    position: relative;
    display: inline-block;
    margin-bottom: 1rem;
}

.section-title-animated::before,
.section-title-animated::after {
    content: '';
    position: absolute;
    width: 50px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    top: 50%;
    transform: translateY(-50%);
}

.section-title-animated::before {
    left: -70px;
}

.section-title-animated::after {
    right: -70px;
}

.section-subtitle {
    font-family: "Inter", sans-serif;
    font-size: 1rem;
    color: var(--gray-600);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Grid compact avec hauteur uniforme */
.testimonials-modern-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    max-width: 1200px;
    margin: 0 auto 40px;
    padding: 0 20px;
    grid-auto-rows: 1fr;
}

/* Carte avec effets premium */
.testimonial-modern-card {
    position: relative;
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 
        0 2px 10px rgba(0,0,0,0.06),
        0 0 0 1px rgba(0,0,0,0.02);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0,0,0,0.05);
}

.testimonial-modern-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gold), var(--gold-dark));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.testimonial-modern-card:hover::before {
    transform: scaleX(1);
}

.testimonial-modern-card:hover {
    transform: translateY(-3px) rotateX(2deg);
    box-shadow: 
        0 12px 30px rgba(0,0,0,0.12),
        0 0 0 1px var(--gold);
}

/* Header avec gradient animé */
.modern-card-header {
    position: relative;
    padding: 20px;
    background: linear-gradient(135deg, var(--blue-deep) 0%, var(--blue-royal) 100%);
    overflow: hidden;
    min-height: 85px;
}

/* Particules animées dans le header */
.header-particles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
}

.header-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    animation: float-particle 10s infinite linear;
}

@keyframes float-particle {
    0% {
        transform: translateY(100%) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100%) translateX(100px);
        opacity: 0;
    }
}

.header-particle:nth-child(1) { left: 10%; animation-delay: 0s; }
.header-particle:nth-child(2) { left: 30%; animation-delay: 2s; }
.header-particle:nth-child(3) { left: 50%; animation-delay: 4s; }
.header-particle:nth-child(4) { left: 70%; animation-delay: 6s; }
.header-particle:nth-child(5) { left: 90%; animation-delay: 8s; }

.modern-card-header.type-rabbin {
    background: linear-gradient(135deg, #2563EB 0%, #1E40AF 100%);
}

.modern-card-header.type-communaute {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
}

/* Pattern overlay simplifié */
.header-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.05;
    background-image: radial-gradient(circle at 20% 50%, transparent 20%, var(--white) 20.5%, var(--white) 21%, transparent 21.5%);
    background-size: 20px 20px;
}

/* Profile compact */
.profile-modern {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    position: relative;
    z-index: 2;
}

.avatar-modern {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--white);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}

.testimonial-modern-card:hover .avatar-modern {
    transform: scale(1.05);
}

.avatar-modern img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: var(--white);
    font-size: 1.5rem;
    font-weight: 700;
    font-family: "Playfair Display", serif;
}

.profile-info {
    flex: 1;
}

.profile-name {
    font-family: "Playfair Display", serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 0.1rem;
    line-height: 1.2;
}

.profile-title {
    font-family: "Inter", sans-serif;
    font-size: 0.75rem;
    font-weight: 400;
    color: rgba(255,255,255,0.85);
    letter-spacing: 0.3px;
    line-height: 1.2;
}

/* Content compact avec flex grow */
.modern-card-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Quote box avec effet de profondeur */
.quote-modern {
    position: relative;
    padding: 15px;
    background: 
        linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%),
        var(--gray-50);
    border-radius: 10px;
    margin-bottom: 10px;
    border: 1px solid var(--gray-200);
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 60px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.04);
    transition: all 0.3s ease;
}

.testimonial-modern-card:hover .quote-modern {
    box-shadow: 
        inset 0 2px 4px rgba(0,0,0,0.06),
        0 1px 3px rgba(0,0,0,0.05);
    transform: translateY(-1px);
}

.quote-text {
    font-family: "Inter", sans-serif;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--gray-700);
    position: relative;
    z-index: 2;
    font-style: italic;
}

.quote-text.hebrew {
    font-family: "Frank Ruhl Libre", serif;
    font-size: 0.95rem;
    line-height: 1.6;
    direction: rtl;
    text-align: right;
    font-style: normal;
}

/* Letter preview avec animation */
.letter-preview-modern {
    padding: 8px 12px;
    background: linear-gradient(180deg, #f9fafb 0%, #f3f4f6 100%);
    border-top: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Effet de wave au hover */
.letter-preview-modern::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,215,0,0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.letter-preview-modern:hover::before {
    width: 200%;
    height: 200%;
}

.letter-preview-modern:hover {
    background: linear-gradient(180deg, #f3f4f6 0%, #e5e7eb 100%);
}

/* Icône animée */
.view-letter-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}

.letter-preview-modern:hover .view-letter-icon {
    transform: translateX(3px);
}

.view-letter-text {
    font-family: "Inter", sans-serif;
    font-size: 0.65rem;
    color: var(--blue-royal);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
    transition: all 0.3s ease;
    margin: 0;
}

.letter-preview-modern:hover .view-letter-text {
    opacity: 1;
    color: var(--gold-dark);
}

.letter-img {
    width: 50px;
    height: auto;
    border-radius: 4px;
    transition: all 0.3s ease;
}

/* CTA compact */
.cta-section {
    text-align: center;
    padding: 40px 20px 60px;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 30px;
    background: linear-gradient(135deg, var(--blue-royal) 0%, var(--blue-light) 100%);
    color: var(--white);
    text-decoration: none;
    font-family: "Inter", sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-radius: 50px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.2);
}

/* Modal compact avec témoignage complet - centré */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 22, 40, 0.9);
    backdrop-filter: blur(10px);
    z-index: 99996;
    overflow-y: auto;
    padding: 20px;
    /* Centrage avec flexbox */
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex !important;
}

.modal-container {
    max-width: 900px;
    margin: auto;
    background: var(--white);
    border-radius: 16px;
    box-shadow: 
        0 20px 40px rgba(0,0,0,0.3),
        0 0 0 1px rgba(255,255,255,0.1);
    overflow: hidden;
    transform: scale(0.95) translateY(10px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
}

/* Effet de brillance sur le container */
.modal-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255,255,255,0.1) 50%,
        transparent 70%
    );
    transform: rotate(45deg) translateX(-100%);
    transition: transform 0.6s;
    pointer-events: none;
}

.modal-overlay.active .modal-container::before {
    transform: rotate(45deg) translateX(100%);
}

.modal-overlay.active .modal-container {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.modal-content {
    display: flex;
    flex-wrap: wrap;
}

.modal-testimonial {
    flex: 1;
    min-width: 280px;
    padding: 30px;
    display: flex;
    flex-direction: column;
}

.modal-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--gray-200);
}

.modal-profile {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.modal-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--gold);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
}

.modal-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: var(--white);
    font-size: 2.5rem;
    font-weight: 700;
    font-family: "Playfair Display", serif;
}

.modal-info h3 {
    font-family: "Playfair Display", serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--blue-deep);
    margin-bottom: 0.3rem;
}

.modal-info p {
    font-family: "Inter", sans-serif;
    font-size: 0.9rem;
    color: var(--gray-600);
}

.modal-text-full {
    flex: 1;
    font-family: "Inter", sans-serif;
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--gray-700);
    margin-bottom: 0;
    white-space: pre-line;
}

.modal-text-full.hebrew {
    font-family: "Frank Ruhl Libre", serif;
    font-size: 1.05rem;
    line-height: 1.8;
    direction: rtl;
    text-align: right;
}

.modal-signature {
    display: block;
    text-align: right;
    font-family: "Cormorant Garamond", serif;
    font-size: 1.1rem;
    font-style: italic;
    color: var(--blue-deep);
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--gray-200);
    opacity: 0.8;
}

.modal-letter {
    flex: 0 0 45%;
    min-width: 250px;
    background: var(--gray-50);
    padding: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.modal-letter-img {
    max-width: 100%;
    height: auto;
    cursor: zoom-in;
    transition: transform 0.3s ease-out;
    transform-origin: center center;
    will-change: transform;
}

.modal-letter-img.zoomed {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    max-width: 90vw;
    max-height: 90vh;
    cursor: grab;
    z-index: 1001;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    pointer-events: auto;
}

.modal-letter-img.zoomed:active {
    cursor: grabbing;
}

.zoom-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-out, visibility 0.3s ease-out;
    z-index: 1000;
    cursor: zoom-out;
}

.zoom-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-close-modern {
    position: fixed;
    top: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 100002;
}

.modal-close-modern:hover {
    background: rgba(255,255,255,0.25);
    transform: rotate(90deg) scale(1.1);
    border-color: var(--gold);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

.modal-close-modern::before,
.modal-close-modern::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 2px;
    background: var(--white);
    transition: background 0.3s ease;
}

.modal-close-modern:hover::before,
.modal-close-modern:hover::after {
    background: var(--gold);
}

.modal-close-modern::before {
    transform: rotate(45deg);
}

.modal-close-modern::after {
    transform: rotate(-45deg);
}

/* Responsive */
@media (max-width: 768px) {
    .modal-content {
        flex-direction: column;
    }
    
    .modal-letter {
        flex: 1;
    }
    
    .modal-testimonial,
    .modal-letter {
        padding: 30px 20px;
    }
    
    .testimonials-hero {
        height: 25vh;
        min-height: 200px;
    }
    
    .hero-title-3d {
        font-size: 2.2rem;
        margin-bottom: 0.8rem;
    }
    
    .hero-subtitle-animated {
        font-size: 0.9rem;
        letter-spacing: 2px;
    }
    
    .hero-decoration {
        bottom: 15px;
        height: 25px;
    }
    
    .testimonials-modern-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .modern-card-header {
        padding: 20px;
    }
    
    .profile-modern {
        gap: 1rem;
    }
    
    .avatar-modern {
        width: 50px;
        height: 50px;
    }
    
    .section-title-animated {
        font-size: 1.8rem;
    }
    
    .section-title-animated::before,
    .section-title-animated::after {
        display: none;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animations d'entrée */
.testimonial-modern-card {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

.testimonial-modern-card:nth-child(1) { animation-delay: 0.05s; }
.testimonial-modern-card:nth-child(2) { animation-delay: 0.1s; }
.testimonial-modern-card:nth-child(3) { animation-delay: 0.15s; }
.testimonial-modern-card:nth-child(4) { animation-delay: 0.2s; }
.testimonial-modern-card:nth-child(5) { animation-delay: 0.25s; }
.testimonial-modern-card:nth-child(6) { animation-delay: 0.3s; }
.testimonial-modern-card:nth-child(7) { animation-delay: 0.35s; }
.testimonial-modern-card:nth-child(8) { animation-delay: 0.4s; }
.testimonial-modern-card:nth-child(9) { animation-delay: 0.45s; }
.testimonial-modern-card:nth-child(10) { animation-delay: 0.5s; }
.testimonial-modern-card:nth-child(11) { animation-delay: 0.55s; }
.testimonial-modern-card:nth-child(12) { animation-delay: 0.6s; }
