/**
 * Google Reviews Widget - Styly
 * Pro Printia.cz
 * 
 * Můžeš upravit barvy a fonty podle designu webu
 */

/* === Základní kontejner === */
.gr-widget {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    max-width: 600px;
    margin: 0 auto;
    padding: 24px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* === Header s celkovým hodnocením === */
.gr-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.gr-header__logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #333;
}

.gr-header__logo svg {
    flex-shrink: 0;
}

.gr-header__rating {
    text-align: right;
}

.gr-header__score {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    display: block;
    line-height: 1;
}

.gr-header__stars {
    margin: 4px 0;
}

.gr-header__count {
    font-size: 13px;
    color: #666;
}

/* === Hvězdičky === */
.gr-star {
    font-size: 16px;
    color: #FBBC05;
}

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

.gr-star--half {
    position: relative;
}

.gr-star--half::after {
    content: '★';
    position: absolute;
    left: 0;
    width: 50%;
    overflow: hidden;
    color: #FBBC05;
}

/* === Seznam recenzí === */
.gr-reviews {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* === Jednotlivá recenze === */
.gr-review {
    padding: 16px;
    background: #f9f9f9;
    border-radius: 8px;
}

.gr-review__header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.gr-review__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: #eee;
}

.gr-review__meta {
    flex: 1;
}

.gr-review__author {
    font-weight: 600;
    color: #333;
    display: block;
    margin-bottom: 2px;
}

.gr-review__rating {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gr-review__stars .gr-star {
    font-size: 14px;
}

.gr-review__time {
    font-size: 12px;
    color: #888;
}

.gr-review__text {
    margin: 0;
    color: #444;
    font-size: 14px;
    line-height: 1.6;
}

/* === Footer === */
.gr-footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #eee;
    text-align: center;
}

.gr-footer__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: #4285F4;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    font-size: 14px;
    transition: background 0.2s;
}

.gr-footer__link:hover {
    background: #3367D6;
}

/* === Loading stav === */
.gr-widget--loading {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gr-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: #666;
}

.gr-loader__spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #eee;
    border-top-color: #4285F4;
    border-radius: 50%;
    animation: gr-spin 0.8s linear infinite;
}

@keyframes gr-spin {
    to { transform: rotate(360deg); }
}

/* === Error stav === */
.gr-widget--error {
    text-align: center;
    color: #666;
}

.gr-no-reviews {
    text-align: center;
    color: #888;
    padding: 20px;
}

/* === Responzivita === */
@media (max-width: 480px) {
    .gr-widget {
        padding: 16px;
        border-radius: 0;
    }
    
    .gr-header {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    
    .gr-header__rating {
        text-align: center;
    }
    
    .gr-review {
        padding: 12px;
    }
}

/* === Tmavý režim (volitelné) === */
@media (prefers-color-scheme: dark) {
    .gr-widget {
        background: #1a1a1a;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    }
    
    .gr-header {
        border-bottom-color: #333;
    }
    
    .gr-header__logo,
    .gr-header__score,
    .gr-review__author {
        color: #eee;
    }
    
    .gr-header__count,
    .gr-review__time {
        color: #888;
    }
    
    .gr-review {
        background: #252525;
    }
    
    .gr-review__text {
        color: #ccc;
    }
    
    .gr-footer {
        border-top-color: #333;
    }
    
    .gr-star--empty {
        color: #444;
    }
}
