/* Enhanced Testimonials Masonry Grid CSS */

/* Testimonials Hero Section */
.testimonials-hero {
    padding: 120px 0 80px;
    text-align: center;
    background: linear-gradient(135deg, #fefefe 0%, #f8f6f3 100%);
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    position: relative;
    min-height: 80vh;
    display: flex;
    align-items: center;
}

.testimonials-hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(44, 44, 44, 0.4) 0%,
        rgba(139, 115, 85, 0.3) 25%,
        rgba(254, 254, 254, 0.2) 50%,
        rgba(44, 44, 44, 0.3) 75%,
        rgba(139, 115, 85, 0.4) 100%
    );
    z-index: 1;
}

.testimonials-hero .container {
    position: relative;
    z-index: 2;
}

.testimonials-hero .hero-content {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    background: transparent;
    padding: 60px 40px;
}

.testimonials-hero .hero-title {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: white;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8), 1px 1px 2px rgba(0, 0, 0, 0.9);
    letter-spacing: 1px;
}

.testimonials-hero .hero-description {
    font-size: 1.2rem;
    margin-bottom: 3rem;
    color: white;
    line-height: 1.8;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 400;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8), 1px 1px 2px rgba(0, 0, 0, 0.9);
}

.testimonials-page {
    min-height: 100vh;
}

.testimonials-grid-section {
    padding: 80px 0;
    background: #fff;
    position: relative;
}

.testimonials-grid-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e9ecef, transparent);
}

.testimonials-header {
    text-align: center;
    margin-bottom: 60px;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.8s forwards;
}

.section-title {
    font-size: 2.8rem;
    color: #2c2c2c;
    margin-bottom: 15px;
    font-weight: 600;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #ff6b6b, #4ecdc4);
    border-radius: 2px;
}

.section-subtitle {
    font-size: 1.2rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

/* Advanced Masonry Grid */
.testimonials-masonry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 1s forwards;
}

/* Masonry-like behavior with CSS Grid */
.testimonial-card-masonry {
    background: #fff;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.testimonial-card-masonry::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.testimonial-card-masonry::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.testimonial-card-masonry:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.testimonial-card-masonry:hover::before {
    opacity: 1;
}

.testimonial-card-masonry:hover::after {
    opacity: 1;
}

.testimonial-content {
    position: relative;
    z-index: 1;
}

.testimonial-stars {
    margin-bottom: 25px;
    display: flex;
    gap: 4px;
    justify-content: center;
}

.testimonial-stars i {
    color: #ffc107;
    font-size: 1.2rem;
    opacity: 0;
    animation: fadeInScale 0.6s ease-out forwards;
    filter: drop-shadow(0 2px 4px rgba(255, 193, 7, 0.3));
}

.testimonial-stars i:nth-child(1) { animation-delay: 0.1s; }
.testimonial-stars i:nth-child(2) { animation-delay: 0.2s; }
.testimonial-stars i:nth-child(3) { animation-delay: 0.3s; }
.testimonial-stars i:nth-child(4) { animation-delay: 0.4s; }
.testimonial-stars i:nth-child(5) { animation-delay: 0.5s; }

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.3) rotate(-10deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.testimonial-text {
    font-size: 1.25rem;
    line-height: 1.7;
    color: #444;
    font-style: italic;
    margin-bottom: 35px;
    position: relative;
    padding: 20px 0 20px 30px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 12px;
    border-left: 4px solid #4ecdc4;
}

.testimonial-text::before {
    content: '"';
    position: absolute;
    left: 10px;
    top: 5px;
    font-size: 3.5rem;
    color: #e9ecef;
    font-family: serif;
    line-height: 1;
    font-weight: bold;
}

.testimonial-text::after {
    content: '"';
    position: absolute;
    right: 15px;
    bottom: 5px;
    font-size: 3.5rem;
    color: #e9ecef;
    font-family: serif;
    line-height: 1;
    font-weight: bold;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: rgba(248, 249, 250, 0.8);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.author-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.author-avatar:hover {
    transform: scale(1.1);
}

.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.author-avatar:hover img {
    transform: scale(1.1);
}

.author-info {
    flex: 1;
}

.author-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2c2c2c;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.author-role {
    font-size: 1rem;
    color: #666;
    margin: 0;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .testimonials-masonry-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
        gap: 25px;
    }
    
    .testimonial-card-masonry {
        padding: 35px;
    }
}

@media (max-width: 768px) {
    .testimonials-hero {
        padding: 100px 0 50px;
        min-height: 60vh;
    }
    
    .testimonials-hero .hero-content {
        padding: 40px 20px;
    }
    
    .testimonials-hero .hero-title {
        font-size: 3rem;
    }
    
    .testimonials-hero .hero-description {
        font-size: 1.1rem;
    }
    
    .testimonials-grid-section {
        padding: 60px 0;
    }
    
    .testimonials-masonry-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 15px;
    }
    
    .testimonial-card-masonry {
        padding: 30px 25px;
    }
    
    .testimonial-text {
        font-size: 1.1rem;
        padding: 15px 0 15px 25px;
    }
    
    .testimonial-text::before,
    .testimonial-text::after {
        font-size: 2.5rem;
    }
    
    .testimonial-author {
        flex-direction: column;
        text-align: center;
        gap: 15px;
        padding: 15px;
    }
    
    .author-info {
        text-align: center;
    }
    
    .author-avatar {
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 480px) {
    .testimonials-hero {
        padding: 80px 0 40px;
        min-height: 50vh;
    }
    
    .testimonials-hero .hero-content {
        padding: 30px 15px;
    }
    
    .testimonials-hero .hero-title {
        font-size: 2.5rem;
    }
    
    .testimonials-hero .hero-description {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 2.2rem;
    }
    
    .testimonial-card-masonry {
        padding: 25px 20px;
    }
    
    .testimonial-text {
        font-size: 1rem;
        padding: 12px 0 12px 20px;
    }
    
    .testimonial-text::before,
    .testimonial-text::after {
        font-size: 2rem;
    }
}

/* Animation for grid items */
.testimonial-card-masonry {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
    animation: fadeInUpScale 0.8s ease-out forwards;
}

.testimonial-card-masonry:nth-child(1) { animation-delay: 0.1s; }
.testimonial-card-masonry:nth-child(2) { animation-delay: 0.2s; }
.testimonial-card-masonry:nth-child(3) { animation-delay: 0.3s; }
.testimonial-card-masonry:nth-child(4) { animation-delay: 0.4s; }
.testimonial-card-masonry:nth-child(5) { animation-delay: 0.5s; }
.testimonial-card-masonry:nth-child(6) { animation-delay: 0.6s; }
.testimonial-card-masonry:nth-child(7) { animation-delay: 0.7s; }
.testimonial-card-masonry:nth-child(8) { animation-delay: 0.8s; }

@keyframes fadeInUpScale {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

/* Loading state */
.testimonials-masonry-grid.loading {
    opacity: 0.5;
}

.testimonials-masonry-grid.loading .testimonial-card-masonry {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 0.8;
    }
}