/* Hostbreak Trustpilot Reviews - Frontend Styles */

:root {
    --hbr-card-bg: #f8fafc;
    --hbr-star-color: #00b67a;
    --hbr-text-color: #1e293b;
    --hbr-border-color: #e2e8f0;
    --hbr-light-text: #64748b;
    --hbr-trustpilot-green: #00b67a;
}

/* Wrapper */
.hbr-reviews-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Header */
.hbr-header {
    text-align: center;
    margin-bottom: 48px;
}

.hbr-title {
    font-size: 36px;
    font-weight: 700;
    color: var(--hbr-text-color);
    margin: 0;
    line-height: 1.2;
}

/* Grid Layout */
.hbr-grid {
    display: grid;
    gap: 24px;
}

.hbr-grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.hbr-grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.hbr-grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Ensure uniform height in grid */
.hbr-grid .hbr-review-card {
    height: 280px;
}

@media (max-width: 1024px) {
    .hbr-grid-cols-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .hbr-grid-cols-3,
    .hbr-grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
    
    .hbr-grid .hbr-review-card,
    .hbr-carousel-slide .hbr-review-card {
        height: 300px; /* Slightly taller on mobile for readability */
    }
}

@media (max-width: 540px) {
    .hbr-grid-cols-2,
    .hbr-grid-cols-3,
    .hbr-grid-cols-4 { grid-template-columns: 1fr; }
    
    .hbr-grid .hbr-review-card,
    .hbr-carousel-slide .hbr-review-card {
        height: auto;
        min-height: 240px;
    }
}

/* Review Card */
.hbr-review-card {
    display: flex;
    flex-direction: column;
    background: var(--hbr-card-bg);
    border: 1px solid var(--hbr-border-color);
    border-radius: 12px;
    padding: 24px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    height: 280px; /* Fixed height for uniform cards */
    box-sizing: border-box;
    cursor: pointer;
}

.hbr-review-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
    border-color: var(--hbr-trustpilot-green);
}

/* Card Header */
.hbr-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.hbr-tp-icon {
    flex-shrink: 0;
}

.hbr-tp-text {
    font-size: 16px;
    font-weight: 700;
    color: var(--hbr-text-color);
}

/* Author */
.hbr-author {
    font-size: 15px;
    font-weight: 600;
    color: var(--hbr-text-color);
    margin-bottom: 12px;
}

/* Review Text */
.hbr-review-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--hbr-text-color);
    flex-grow: 1;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 88px; /* Ensures consistent space for text */
}

/* Stars Row */
.hbr-stars-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.hbr-stars {
    display: flex;
    gap: 2px;
}

.hbr-star {
    color: var(--hbr-star-color);
}

.hbr-arrow {
    color: var(--hbr-light-text);
    display: flex;
    align-items: center;
    transition: transform 0.2s ease;
}

.hbr-review-card:hover .hbr-arrow {
    transform: translateX(4px);
}

/* Review Date */
.hbr-review-date {
    font-size: 12px;
    color: var(--hbr-light-text);
    margin-top: auto;
}

/* Footer */
.hbr-footer {
    margin-top: 48px;
    text-align: center;
}

.hbr-stats {
    font-size: 16px;
    color: var(--hbr-text-color);
    margin-bottom: 20px;
}

.hbr-stats strong {
    font-weight: 700;
}

.hbr-stats-note {
    color: var(--hbr-light-text);
    font-style: italic;
}

/* Trustpilot Logo Link */
.hbr-trustpilot-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.hbr-trustpilot-link:hover {
    opacity: 0.8;
}

.hbr-trustpilot-logo {
    height: 28px;
    width: auto;
}

/* ============================================
   CAROUSEL STYLES
   ============================================ */

.hbr-carousel {
    position: relative;
    overflow: hidden;
    padding: 0 50px;
}

.hbr-carousel-track {
    display: flex;
    transition: transform 0.5s ease;
}

.hbr-carousel-slide {
    flex: 0 0 calc(33.333% - 16px);
    margin: 0 8px;
    box-sizing: border-box;
}

/* Ensure uniform height in carousel */
.hbr-carousel-slide .hbr-review-card {
    height: 280px;
}

@media (max-width: 1024px) {
    .hbr-carousel-slide {
        flex: 0 0 calc(50% - 16px);
    }
}

@media (max-width: 640px) {
    .hbr-carousel-slide {
        flex: 0 0 calc(100% - 16px);
    }
    
    .hbr-carousel {
        padding: 0 40px;
    }
}

/* Carousel Navigation */
.hbr-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: white;
    border: 1px solid var(--hbr-border-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--hbr-text-color);
    transition: all 0.2s ease;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.hbr-carousel-btn:hover {
    background: var(--hbr-trustpilot-green);
    color: white;
    border-color: var(--hbr-trustpilot-green);
}

.hbr-carousel-prev {
    left: 0;
}

.hbr-carousel-next {
    right: 0;
}

/* Carousel Dots */
.hbr-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.hbr-carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--hbr-border-color);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.hbr-carousel-dot.active,
.hbr-carousel-dot:hover {
    background: var(--hbr-trustpilot-green);
    transform: scale(1.2);
}

/* No Reviews Message */
.hbr-no-reviews {
    text-align: center;
    padding: 40px;
    color: var(--hbr-light-text);
    font-size: 16px;
}

/* Animation */
@keyframes hbr-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hbr-review-card {
    animation: hbr-fade-in 0.5s ease forwards;
}

.hbr-grid .hbr-review-card:nth-child(1) { animation-delay: 0.1s; }
.hbr-grid .hbr-review-card:nth-child(2) { animation-delay: 0.2s; }
.hbr-grid .hbr-review-card:nth-child(3) { animation-delay: 0.3s; }
.hbr-grid .hbr-review-card:nth-child(4) { animation-delay: 0.4s; }
.hbr-grid .hbr-review-card:nth-child(5) { animation-delay: 0.5s; }
.hbr-grid .hbr-review-card:nth-child(6) { animation-delay: 0.6s; }