/**
 * Marquee/Ticker Layout Styles for GlowReviews
 * Auto-scrolling horizontal testimonial display
 */

/* Marquee Container with modern mask-image fade edges */
.glowrev-marquee-container {
    width: 100%;
    overflow: hidden;
    position: relative;
    padding: 20px 0;
    mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
}

/* Marquee Track with gap */
.glowrev-marquee-track {
    display: flex;
    gap: 2rem;
    width: max-content;
    will-change: transform;
    animation: marqueeScroll 28s linear infinite;
    --glowrev-marquee-distance: -50%;
}

/* Pause on hover */
.glowrev-marquee-container:hover .glowrev-marquee-track {
    animation-play-state: paused;
}

/* Keyframes use a measured loop distance so the reset happens off-screen. */
@keyframes marqueeScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(var(--glowrev-marquee-distance, -50%)); }
}

/* Marquee Item - Modern card design */
.glowrev-marquee-item {
    flex: 0 0 auto;
    width: 360px;
    background: #ffffff;
    border-radius: 2rem;
    padding: 1.8rem 1.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0,0,0,0.02);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.glowrev-marquee-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18), 0 8px 24px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(44,156,212,0.15);
}

/* Quote icon styling */
.glowrev-marquee-item .glowrev-preset-quote-mark,
.glowrev-marquee-item .glowrev_testimonial-quote::before {
    color: #2c9cd4;
    font-size: 2rem;
    line-height: 1;
    opacity: 0.5;
    font-family: Georgia, serif;
}

/* Author section */
.glowrev-marquee-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: auto;
}

.glowrev-marquee-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.2rem;
    color: #1f5a77;
    background: linear-gradient(125deg, #e0edf5, #cbdbe6);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.6), 0 2px 6px rgba(0,0,0,0.05);
    flex-shrink: 0;
}

.glowrev-marquee-avatar img,
.glowrev-marquee-avatar .glowrev-svg-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.glowrev-marquee-author-info {
    flex: 1;
    min-width: 0;
}

.glowrev-marquee-author-info .glowrev-marquee-name {
    font-size: 1rem;
    font-weight: 700;
    color: #0c2e3f;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.glowrev-marquee-author-info .glowrev-marquee-company {
    font-size: 0.75rem;
    color: #617e8f;
    font-weight: 500;
    margin: 2px 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Rating stars */
.glowrev-marquee-rating {
    display: flex;
    gap: 0.2rem;
    margin-top: 0.1rem;
}

.glowrev-marquee-rating .rating-star {
    color: #f5b85b;
    font-size: 0.9rem;
}

/* Content text */
.glowrev-marquee-content {
    font-size: 1rem;
    line-height: 1.5;
    color: #1f2e3a;
    font-weight: 500;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    box-orient: vertical;
    overflow: hidden;
}

/* Compact mode */
.glowrev-marquee-compact .glowrev-marquee-item {
    width: 290px;
    padding: 1.4rem;
}

/* Header */
.glowrev-marquee-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

/* Avatar */
.glowrev-marquee-avatar img,
.glowrev-marquee-avatar .glowrev-svg-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50% !important;
    object-fit: cover;
    border: 2px solid #f1f5f9;
}

/* Custom layout items in marquee - match default size */
.glowrev-marquee-container .glowrev-testimonial-card {
    width: 360px !important;
    max-width: 360px !important;
    min-width: 360px !important;
    flex: 0 0 auto !important;
    background: #ffffff !important;
    border-radius: 2rem !important;
    padding: 1.8rem 1.5rem !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0,0,0,0.02) !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
}

.glowrev-marquee-container .glowrev-testimonial-card:hover {
    transform: translateY(-8px) scale(1.02) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18), 0 8px 24px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(44,156,212,0.15) !important;
}

/* Force circular shape for all marquee avatar images */
.glowrev-marquee-item .glowrev-marquee-avatar img,
.glowrev-marquee-track .glowrev-marquee-avatar img,
.glowrev-marquee-container .glowrev-marquee-avatar img {
    border-radius: 50% !important;
    width: 50px !important;
    height: 50px !important;
    object-fit: cover !important;
}

/* Meta */
.glowrev-marquee-meta {
    flex: 1;
    min-width: 0;
}

.glowrev-marquee-name {
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.glowrev-marquee-company {
    font-size: 0.85rem;
    color: #64748b;
    margin: 2px 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Content */
.glowrev-marquee-content {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #475569;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    box-orient: vertical;
    overflow: hidden;
    margin-bottom: 12px;
}

/* Rating */
.glowrev-marquee-rating {
    display: flex;
    gap: 2px;
}

.glowrev-marquee-rating .rating-star {
    font-size: 1rem;
}

.glowrev-marquee-rating .rating-star.filled {
    color: #fbbf24;
}

/* Speed variations */
.glowrev-marquee-slow .glowrev-marquee-track {
    animation-duration: 60s;
}

.glowrev-marquee-fast .glowrev-marquee-track {
    animation-duration: 25s;
}

/* Reverse direction */
.glowrev-marquee-reverse .glowrev-marquee-track {
    animation-direction: reverse;
}

/* Pause button */
.glowrev-marquee-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
}

.glowrev-marquee-pause-btn {
    background: #f1f5f9;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #475569;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.glowrev-marquee-pause-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* Quote icon in card */
.glowrev-marquee-item .quote-icon {
    color: #2c9cd4;
    font-size: 2rem;
    line-height: 1;
    opacity: 0.5;
    font-family: Georgia, serif;
    font-weight: 400;
}

/* Footer text */
.glowrev-marquee-footer {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.75rem;
    color: #7196a8;
    font-weight: 500;
    letter-spacing: 0.2px;
}

/* With Logos variant */
.glowrev-marquee-logos .glowrev-marquee-item {
    width: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    filter: grayscale(100%);
    opacity: 0.6;
    transition: all 0.3s ease;
}

.glowrev-marquee-logos .glowrev-marquee-item:hover {
    filter: grayscale(0%);
    opacity: 1;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .glowrev-marquee-track {
        animation: none;
        flex-wrap: wrap;
        justify-content: center;
        gap: 16px;
    }
    
    .glowrev-marquee-item {
        width: calc(33.333% - 16px);
        margin: 0;
    }
    
    .glowrev-marquee-container::before,
    .glowrev-marquee-container::after {
        display: none;
    }
}

/* Tablet responsive */
@media (max-width: 1024px) {
    .glowrev-marquee-item {
        width: 320px;
        padding: 1.5rem;
    }
    
    .glowrev-marquee-compact .glowrev-marquee-item {
        width: 280px;
    }
    
    .glowrev-marquee-track {
        gap: 1.5rem;
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .glowrev-marquee-item {
        width: 290px;
        padding: 1.4rem;
    }
    
    .glowrev-marquee-content {
        font-size: 0.95rem;
    }
    
    .glowrev-marquee-compact .glowrev-marquee-item {
        width: 260px;
    }
    
    .glowrev-marquee-track {
        gap: 1.2rem;
        animation-duration: 22s; /* faster on mobile */
    }
    
    /* Smaller mask fade on mobile */
    .glowrev-marquee-container {
        mask-image: linear-gradient(to right, transparent 0%, black 3%, black 97%, transparent 100%);
        -webkit-mask-image: linear-gradient(to right, transparent 0%, black 3%, black 97%, transparent 100%);
    }
    
    .glowrev-marquee-footer {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .glowrev-marquee-item {
        width: 260px;
        padding: 1.2rem;
    }
    
    .glowrev-marquee-content {
        font-size: 0.9rem;
    }
}
