/* --- REVIEWS SLIDER & MODAL --- */

.relative-container {
    position: relative;
}

.reviews-slider-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 40px;
}

.reviews-slider-container {
    overflow-x: auto;
    width: 100%;
    scrollbar-width: none; /* Hide scrollbar Firefox */
    scroll-behavior: smooth;
    position: relative;
    padding: 60px 0; /* Huge top/bottom padding to prevent shadow clipping */
}

.reviews-slider-container::-webkit-scrollbar {
    display: none; /* Hide scrollbar Chrome/Safari */
}

.reviews-track {
    display: flex;
    gap: 30px;
    padding: 50px 10px 50px 10px; /* Added top padding to simulate centering */
    width: max-content;
    min-height: 450px; /* Allow growing */
    align-items: flex-start; /* Expand downwards only to prevent top clipping */
}

.review-card {
    min-width: 300px;
    max-width: 300px;
    min-height: 280px; /* Fixed initial height */
    max-height: 280px; /* Fixed initial height */
    background: white;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    flex-shrink: 0; /* Prevents cards from squishing */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    transition: max-height 0.6s ease-in-out, transform 0.5s ease-in-out, box-shadow 0.5s ease-in-out;
}

.review-card:not(.add-review-card):hover {
    transform: scale(1.05);
    z-index: 20;
    /* Changed to 0 offset so shadow appears equally on top, bottom, left, right */
    box-shadow: 0 0 40px rgba(0,0,0,0.15);
    max-height: 800px; /* Allows smooth expansion */
}

.review-card .stars {
    margin-bottom: 15px;
}

.review-card .review-text {
    flex-grow: 1;
    margin-bottom: 15px;
    /* Limit to 4 lines by default */
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: all 0.3s ease;
}

.review-card:hover .review-text {
    -webkit-line-clamp: unset; /* Show full text on hover */
}

.review-card .review-author {
    margin: 0;
    font-weight: 600;
}

/* Add Review Card */
.add-review-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: rgba(196, 161, 98, 0.05);
    border: 2px dashed var(--accent-color);
    transition: var(--transition);
}

.add-review-card:hover {
    background: rgba(196, 161, 98, 0.15);
}

.add-icon {
    font-size: 3rem;
    color: var(--accent-color);
    line-height: 1;
    margin-bottom: 10px;
}

.add-text {
    color: var(--primary-color);
    font-weight: 600;
}

/* Transparent Hover Zones */
.slider-hover-zone {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.3s ease;
}

.slider-hover-zone span {
    font-size: 4rem;
    font-weight: 300;
    color: rgba(0, 0, 0, 0.2);
    transition: color 0.3s ease, transform 0.2s ease;
    user-select: none;
}

.slider-hover-zone:hover {
    background-color: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(2px);
}

.slider-hover-zone:hover span {
    color: var(--primary-color);
    transform: scale(1.1);
}

.prev-zone {
    left: 0;
    background: linear-gradient(to right, rgba(248, 249, 250, 0.9), transparent);
}

.next-zone {
    right: 0;
    background: linear-gradient(to left, rgba(248, 249, 250, 0.9), transparent);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.modal.hidden .modal-content {
    transform: translateY(-20px);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.close-btn:hover {
    color: var(--primary-color);
}

.modal-title {
    margin-bottom: 20px;
    color: var(--primary-color);
    font-family: var(--font-heading);
}

.submit-review-btn {
    width: 100%;
    margin-top: 10px;
}

/* --- MODAL FORM STYLING --- */
#submit-review-form .input-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

#submit-review-form label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 8px;
    text-align: left;
}

#submit-review-form input,
#submit-review-form select,
#submit-review-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text-main);
    background-color: #f9f9fa;
    transition: all 0.3s ease;
}

#submit-review-form input:focus,
#submit-review-form select:focus,
#submit-review-form textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(196, 161, 98, 0.1);
    background-color: white;
}

#submit-review-form textarea {
    resize: vertical;
    min-height: 100px;
}

.submit-review-btn {
    background-color: var(--primary-color);
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-review-btn:hover {
    background-color: var(--accent-color);
}


/* --- INTERACTIVE STAR RATING --- */
.star-rating-input {
    display: flex;
    gap: 8px;
    font-size: 2rem;
    color: #e1e4e8; /* Gray for unfilled stars */
    cursor: pointer;
    margin-bottom: 5px;
}

.star-rating-input .star {
    transition: color 0.2s ease, transform 0.1s ease;
    user-select: none;
}

.star-rating-input .star.active {
    color: #ffd700; /* Gold for filled stars */
}

.star-rating-input .star:hover {
    transform: scale(1.1);
}

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 768px) {
    /* Show visible arrows on mobile instead of large transparent hover zones */
    .slider-hover-zone {
        display: flex !important;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 40px;
        height: 40px;
        background: var(--accent-color);
        border-radius: 50%;
        z-index: 30;
        opacity: 0.9;
        color: white;
        box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    }
    
    .slider-hover-zone.prev-zone {
        left: 5px;
    }
    
    .slider-hover-zone.next-zone {
        right: 5px;
    }
    
    .slider-hover-zone span {
        font-size: 1.2rem;
    }

    /* Allow native mobile swiping on the container */
    .reviews-slider-container {
        padding: 20px 0; /* less padding needed on mobile */
        -webkit-overflow-scrolling: touch; 
    }
    
    .reviews-track {
        min-height: 320px; /* smaller track on mobile */
        padding-top: 20px;
        gap: 15px; /* less gap */
    }

    /* Smaller review cards for mobile */
    .review-card {
        min-width: 250px;
        max-width: 250px;
        min-height: 240px;
        padding: 20px;
    }

    .review-card .review-text {
        font-size: 0.9rem;
        -webkit-line-clamp: 3; /* Show slightly less text initially */
    }

    .review-card .review-author {
        font-size: 0.9rem;
    }

    .review-card .stars {
        font-size: 1rem;
        margin-bottom: 10px;
    }

    /* Make review card click-to-expand class for mobile */
    .review-card.expanded {
        transform: scale(1.02);
        z-index: 20;
        box-shadow: 0 0 20px rgba(0,0,0,0.15);
        max-height: 600px;
    }
    
    .review-card.expanded .review-text {
        -webkit-line-clamp: unset;
    }
}
