/* Google Reviews Styling - dopasowane do projektu - ZAKTUALIZOWANE */
.google-reviews-section {
    padding: 60px 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
}

/* Styl kontenera opinii - ZAKTUALIZOWANY */
.testimonials-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

/* Karta pojedynczej opinii - ZAKTUALIZOWANA */
.testimonial-card {
    background-color: #fff;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    padding: 25px;
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
    height: auto !important; /* Nadpisanie sztywnej wysokości */
    width: auto !important; /* Nadpisanie sztywnej szerokości */
    min-height: 200px; /* Minimalna wysokość */
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
}

.testimonial-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #4285f4 0%, #34a853 50%, #fbbc05 75%, #ea4335 100%) !important;
    border-radius: 15px 15px 0 0;
}

.testimonial-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

/* Elementy karty opinii - ZAKTUALIZOWANE */
.testimonial-card .rating {
    color: #ffc107; /* Kolor żółtych gwiazdek */
    margin-bottom: 15px;
    font-size: 1.3rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.testimonial-card h4 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #2c3e50;
    font-weight: 700;
    line-height: 1.3;
}

.testimonial-card p {
    color: #495057;
    line-height: 1.7;
    margin-bottom: 20px;
    font-size: 1rem;
    flex-grow: 1;
    font-style: italic;
}

.testimonial-card .testimonial-author {
    margin-top: auto;
    border-top: 1px solid #f1f3f4;
    padding-top: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.testimonial-card .author-info {
    flex: 1;
}

.testimonial-card .author-info h4 {
    font-size: 1rem;
    margin: 0 0 5px;
    color: #2c3e50;
    font-weight: 600;
}

.testimonial-card .author-info p.date {
    font-size: 0.85rem;
    color: #adb5bd;
    margin: 0;
    font-weight: 500;
}

/* Zdjęcie autora */
.author-photo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #f1f3f4;
    flex-shrink: 0;
}

.author-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* CTA Google */
.google-cta {
    text-align: center;
    margin: 30px 0;
    padding: 20px;
}

.google-cta .btn {
    display: inline-flex;
    align-items: center;
    padding: 12px 24px;
    font-weight: 600;
    border-radius: 25px;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #4285f4 0%, #34a853 100%);
    color: white;
    text-decoration: none;
    border: none;
    cursor: pointer;
}

.google-cta .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(66, 133, 244, 0.4);
    color: white;
    text-decoration: none;
}

/* Info box */
.info-box {
    background-color: #fff;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    margin: 1.5rem 0;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Loader for reviews */
.reviews-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
}

.spinner {
    border: 4px solid rgba(102, 126, 234, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border-left-color: #667eea;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Error message styling - ZAKTUALIZOWANE */
.error-message {
    padding: 25px;
    background-color: #fff;
    border-left: 4px solid #ffc107;
    margin-bottom: 20px;
    color: #6c757d;
    text-align: center;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 53px;
    text-align: center;
}

.section-subtitle {
    font-size: 1.2rem;
    color: #6c757d;
    margin-bottom: 40px;
    text-align: center;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Komunikat gdy nie ma opinii */
.no-testimonials-message {
    text-align: center;
    padding: 40px 20px;
    background-color: #fff;
    border-radius: 15px;
    max-width: 600px;
    margin: 0 auto;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.no-testimonials-message p {
    color: #6c757d;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

/* Responsywność gridu z opiniami */
@media (max-width: 992px) {
    .testimonials-container {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 25px;
    }
}

@media (max-width: 576px) {
    .testimonials-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .testimonial-card {
        max-width: 100%;
        padding: 20px;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .section-subtitle {
        font-size: 1.1rem;
    }
}

/* Funkcjonalność rozwijania tekstu - ULEPSZONA */
.testimonial-text {
    position: relative;
    color: #495057;
    line-height: 1.6;
    font-size: 1rem;
    transition: all 0.3s ease;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.testimonial-text.collapsed {
    display: -webkit-box;
    -webkit-line-clamp: 7;
    -webkit-box-orient: vertical;
    line-clamp: 7;
    overflow: hidden;
    max-height: 11.2em; /* 7 linijek × 1.6 line-height */
    position: relative;
}

.testimonial-text.collapsed::after {
    content: "";
    position: absolute;
    bottom: 0;
    right: 0;
    width: 40%;
    height: 1.6em;
    background: linear-gradient(to right, transparent, #fff 50%);
    pointer-events: none;
}

.expand-toggle {
    color: #4285f4;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    background: none;
    padding: 8px 16px;
    margin-top: 10px;
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 20px;
    display: inline-block;
    background-color: rgba(66, 133, 244, 0.1);
    border: 1px solid rgba(66, 133, 244, 0.2);
    min-width: 100px;
    text-align: center;
}

.expand-toggle:hover {
    color: #1976d2;
    background-color: rgba(66, 133, 244, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.expand-toggle:focus {
    outline: 2px solid #4285f4;
    outline-offset: 2px;
    border-radius: 20px;
}

.expand-toggle:active {
    transform: translateY(0);
}

/* NOWY WIDGET OPINII GOOGLE - ZAKTUALIZOWANY */
.google-reviews-widget {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.review-card {
    background: #fff;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.review-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, #4285f4 0%, #34a853 50%, #fbbc05 75%, #ea4335 100%);
}

.review-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.review-author {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1rem;
}

.review-rating {
    font-size: 1.2rem;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.review-text {
    margin: 15px 0;
    line-height: 1.6;
    color: #495057;
    font-size: 1rem;
    font-style: italic;
}

.review-date {
    text-align: right;
    color: #adb5bd;
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #f1f3f4;
}

/* KOMUNIKAT O BŁĘDZIE ŁADOWANIA OPINII - ZAKTUALIZOWANY */
.review-error {
    background: #fff;
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #ffc107;
    grid-column: 1 / -1;
    margin: 20px 0;
}

.review-error h3 {
    margin-bottom: 15px;
    color: #856404;
    font-size: 1.4rem;
}

.review-error p {
    margin-bottom: 10px;
    color: #6c757d;
    font-size: 1rem;
}

.review-error small {
    display: block;
    margin-top: 20px;
    font-style: italic;
    color: #adb5bd;
    font-size: 0.85rem;
}

/* Dodatkowe style dla poprawnego wyświetlania struktury opinii */
.testimonial-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    gap: 12px;
}

.author-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #f1f3f4;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

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

.author-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 5px 0;
    line-height: 1.2;
}

.review-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 5px;
}

.testimonial-rating i {
    color: #ffc107;
    font-size: 0.9rem;
    margin-right: 2px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.testimonial-rating .far {
    color: #e9ecef;
}

.review-date {
    font-size: 0.85rem;
    color: #adb5bd;
    font-weight: 500;
}

/* Responsywność dla nagłówka opinii */
@media (max-width: 480px) {
    .testimonial-header {
        gap: 10px;
        margin-bottom: 12px;
    }
    
    .author-avatar {
        width: 40px;
        height: 40px;
    }
    
    .author-name {
        font-size: 1rem;
    }
    
    .avatar-placeholder {
        font-size: 1rem;
    }
    
    .review-meta {
        gap: 8px;
    }
    
    .testimonial-rating i {
        font-size: 0.8rem;
    }
}

/* Responsywność */
@media (max-width: 768px) {
    .google-reviews-widget {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .review-card {
        padding: 20px;
    }
    
    .review-author {
        font-size: 1rem;
    }
    
    .review-text {
        font-size: 0.95rem;
    }
}

/* Responsywność dla funkcji rozwijania tekstu */
@media (max-width: 768px) {
    .testimonial-text {
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    .testimonial-text.collapsed {
        max-height: 10.5em; /* 7 linijek × 1.5 line-height na mobile */
        -webkit-line-clamp: 7;
        line-clamp: 7;
    }
    
    .expand-toggle {
        font-size: 0.85rem;
        padding: 6px 10px;
        margin-top: 6px;
    }
    
    .testimonial-text.collapsed::after {
        width: 50%;
        height: 1.5em;
    }
}

@media (max-width: 480px) {
    .testimonial-text {
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    .testimonial-text.collapsed {
        max-height: 9.8em; /* 7 linijek × 1.4 line-height na małych ekranach */
        -webkit-line-clamp: 7;
        line-clamp: 7;
    }
    
    .expand-toggle {
        font-size: 0.8rem;
        padding: 5px 8px;
        width: 100%;
        text-align: center;
        margin-top: 10px;
    }
    
    .testimonial-text.collapsed::after {
        width: 60%;
        height: 1.4em;
    }
}

/* Animacja dla płynnego rozwijania/zwijania */
.testimonial-text {
    transition: max-height 0.3s ease-out, opacity 0.2s ease;
}

.testimonial-text.expanding {
    max-height: none !important;
    -webkit-line-clamp: none !important;
    line-clamp: none !important;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0.7;
    }
    to {
        opacity: 1;
    }
}

/* NOWY WIDGET OPINII GOOGLE - DARMOWY */
.google-reviews-widget {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.review-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

.review-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.review-author {
    font-weight: 600;
    color: #2c3e50;
}

.review-rating {
    font-size: 1.1rem;
}

.review-text {
    margin: 1rem 0;
    line-height: 1.6;
    color: #555;
}

.review-date {
    text-align: right;
    opacity: 0.7;
    font-size: 0.9rem;
    color: #adb5bd; /* Dodany brakujący kolor */
}

/* KOMUNIKAT O BŁĘDZIE ŁADOWANIA OPINII */
.review-error {
    margin: 2rem 0;
}

.review-error h3 {
    margin-bottom: 1rem;
    color: #dc3545;
}

.review-error p {
    margin-bottom: 0.5rem;
}

.review-error small {
    display: block;
    margin-top: 1rem;
    font-style: italic;
}

/* Kontener zawartości opinii */
.testimonial-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: 100%;
}

.testimonial-content p {
    font-style: normal;
    margin: 0;
    flex: 1;
}

/* Specjalne style dla sekcji opinii Google - nadpisanie domyślnych */
#opinie .testimonial-card,
.google-reviews-section .testimonial-card {
    height: auto !important;
    width: 21rem !important;
    min-height: 250px;
    padding: 20px !important;
}

#opinie .testimonial-card::before,
.google-reviews-section .testimonial-card::before {
    background: linear-gradient(135deg, #4285f4 0%, #34a853 50%, #fbbc05 75%, #ea4335 100%) !important;
}

#opinie .testimonials-container,
.google-reviews-section .testimonials-container {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
    gap: 25px !important;
}

/* Zapewnienie że przycisk jest widoczny */
.expand-toggle {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}
