/* Google Reviews Branches - Frontend Styles */
/* גרסה 1.3.0 - עם קרוסלה דינמית */

.grb-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    direction: rtl;
}

.grb-loading {
    text-align: center;
    padding: 40px;
    font-size: 18px;
    color: #666;
}

.grb-loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

.grb-branch {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 30px;
    margin-bottom: 30px;
}

.grb-branch + .grb-branch {
    margin-top: 30px;
}

/* Branch Info Section */
.grb-branch-info {
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 25px;
    margin-bottom: 25px;
}

.grb-branch-name {
    font-size: 28px;
    margin: 0 0 15px 0;
    color: #333;
    font-weight: 700;
}

/* Rating Summary */
.grb-branch-rating-summary {
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.grb-rating-stars {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.grb-rating-number {
    font-size: 24px;
    font-weight: 700;
    color: #333;
}

.grb-rating-count {
    font-size: 14px;
    color: #666;
}

.grb-branch-address,
.grb-branch-phone {
    font-size: 16px;
    margin: 10px 0;
    color: #666;
    display: flex;
    align-items: center;
    gap: 10px;
}

.grb-branch-phone a {
    color: #4285f4;
    text-decoration: none;
}

.grb-branch-phone a:hover {
    text-decoration: underline;
}

.grb-icon {
    font-size: 20px;
}

.grb-branch-hours {
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 14px;
    color: #555;
}

.grb-branch-distance {
    display: inline-block;
    background: #e8f5e9;
    color: #2e7d32;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    margin: 10px 0;
}

/* Navigation Line */
.grb-navigation-line {
    margin: 20px 0;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-right: 4px solid #4285f4;
}

.grb-navigation-text {
    font-size: 15px;
    color: #555;
    margin: 0;
}

.grb-navigation-text strong {
    color: #333;
    font-weight: 600;
}

.grb-nav-link {
    color: #4285f4;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    padding: 2px 0;
    border-bottom: 2px solid transparent;
}

.grb-nav-link:hover {
    color: #357ae8;
    border-bottom-color: #357ae8;
}

.grb-nav-separator {
    color: #999;
    margin: 0 8px;
}

/* Directions */
.grb-branch-directions {
    margin: 20px 0;
    padding: 20px;
    background: #fff3cd;
    border-right: 4px solid #ffc107;
    border-radius: 8px;
}

.grb-branch-directions h4 {
    margin: 0 0 10px 0;
    color: #856404;
    font-size: 16px;
}

.grb-branch-directions p {
    margin: 8px 0;
    color: #856404;
    line-height: 1.6;
}

/* Reviews Section */
.grb-reviews {
    margin-top: 25px;
}

.grb-reviews-title {
    font-size: 22px;
    margin: 0 0 20px 0;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.grb-reviews-showing {
    font-size: 14px;
    color: #666;
    font-weight: 400;
}

.grb-no-reviews {
    text-align: center;
    padding: 40px;
    color: #999;
    font-style: italic;
}

/* Carousel Wrapper - DYNAMIC HEIGHT */
.grb-reviews-carousel-wrapper {
    position: relative;
    padding: 20px 0;
}

.grb-reviews-carousel {
    overflow: hidden;
    position: relative;
    /* הגובה יוגדר דינמית ב-JS */
    transition: height 0.5s ease-in-out;
}

.grb-reviews-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
    gap: 20px;
    align-items: flex-start;
}

/* Individual Review - DYNAMIC HEIGHT */
.grb-review {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-width: 100%;
    flex-shrink: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    /* אל תקבע גובה - תן לו להיות דינמי */
}

.grb-review:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.grb-review-text {
    line-height: 1.7;
    color: #555;
    font-size: 15px;
    white-space: pre-line;
    flex: 1;
    /* חשוב: תן לטקסט להיות דינמי */
    overflow: visible;
    word-wrap: break-word;
}

/* Accordion Mode */
.grb-accordion-mode .grb-branch {
    margin-bottom: 15px;
}

.grb-accordion-header {
    /* הרקע נטען דינמית דרך wp_head */
    padding: 20px 25px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.grb-accordion-header:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.grb-accordion-header-content {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.grb-accordion-branch-name {
    color: white;
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

.grb-accordion-branch-address {
    color: rgba(255,255,255,0.9);
    font-size: 14px;
    margin: 5px 0 0 0;
}

.grb-accordion-distance {
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.grb-accordion-icon {
    color: white;
    font-size: 24px;
    transition: transform 0.3s ease;
}

.grb-accordion-header.active .grb-accordion-icon {
    transform: rotate(180deg);
}

.grb-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
    background: white;
    border-radius: 0 0 12px 12px;
    margin-top: -12px;
    padding-top: 12px;
}

.grb-accordion-content.active {
    max-height: 5000px;
    padding: 25px;
    border: 1px solid #e0e0e0;
    border-top: none;
}

.grb-accordion-mode .grb-branch-info {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 20px;
}

.grb-accordion-mode .grb-branch-name,
.grb-accordion-mode .grb-branch-address {
    display: none;
}

/* Carousel Buttons */
.grb-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #ddd;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    color: #333;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.grb-carousel-btn:hover {
    /* הרקע והבורדר משתנים דינמית דרך wp_head */
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
}

.grb-carousel-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.grb-carousel-prev {
    right: -20px;
}

.grb-carousel-next {
    left: -20px;
}

/* Carousel Dots */
.grb-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.grb-carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    padding: 0;
}

.grb-carousel-dot:hover {
    background: #bbb;
    transform: scale(1.2);
}

.grb-carousel-dot.active {
    /* הרקע משתנה דינמית דרך wp_head */
    width: 30px;
    border-radius: 6px;
}

.grb-reviews-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.grb-review-header {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.grb-review-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.grb-review-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 24px;
    font-weight: 700;
}

.grb-review-meta {
    flex: 1;
}

.grb-review-author {
    display: block;
    font-size: 16px;
    color: #333;
    margin-bottom: 5px;
}

.grb-review-rating {
    margin: 5px 0;
}

.grb-star {
    font-size: 18px;
    margin: 0 1px;
}

.grb-star-filled {
    /* הצבע משתנה דינמית דרך wp_head */
    color: #ffa000;
}

.grb-star-half {
    color: #ffa000;
    opacity: 0.6; /* Make half star slightly transparent to indicate it's not full */
}

.grb-star-empty {
    color: #ddd;
}

.grb-review-date {
    display: block;
    font-size: 13px;
    color: #999;
    margin-top: 5px;
}

/* Error Messages */
.grb-error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px 20px;
    border-radius: 8px;
    border-right: 4px solid #dc3545;
    margin: 20px 0;
}

.grb-info {
    background: #d1ecf1;
    color: #0c5460;
    padding: 15px 20px;
    border-radius: 8px;
    border-right: 4px solid #17a2b8;
    margin: 20px 0;
}

/* Multiple Branches View */
.grb-branches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .grb-container {
        padding: 15px;
    }
    
    .grb-branch {
        padding: 20px;
    }
    
    .grb-branch-name {
        font-size: 22px;
    }
    
    .grb-navigation-line {
        padding: 12px 15px;
    }
    
    .grb-navigation-text {
        font-size: 14px;
    }
    
    .grb-review-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .grb-branches-grid {
        grid-template-columns: 1fr;
    }
    
    .grb-reviews-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* Accessibility */
.grb-nav-button:focus,
.grb-review:focus {
    outline: 3px solid #4285f4;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .grb-navigation-buttons {
        display: none;
    }
    
    .grb-branch {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
