/**
 * greviews – Google Reviews Slider (WordPress)
 * Light + Dark Mode Support
 */

/* ========== CSS VARIABLES ========== */
.greviews-widget {
    --gr-bg: #ffffff;
    --gr-card-bg: #ffffff;
    --gr-text: #333333;
    --gr-text-secondary: #666666;
    --gr-text-muted: #888888;
    --gr-border: rgba(0, 0, 0, 0.08);
    --gr-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --gr-star: #FFC107;
    --gr-star-empty: #dddddd;
    --gr-accent: #FF002D;
    --gr-accent-hover: #cc0024;
    --gr-google-opacity: 0.5;
    --gr-toggle-bg: #f0f0f0;
    --gr-toggle-hover: #e0e0e0;

    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
}

/* Dark Mode */
.greviews-widget.gr-theme-dark {
    --gr-bg: #1a1a2e;
    --gr-card-bg: #16213e;
    --gr-text: #e0e0e0;
    --gr-text-secondary: #b0b0b0;
    --gr-text-muted: #888888;
    --gr-border: rgba(255, 255, 255, 0.08);
    --gr-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    --gr-star-empty: #444444;
    --gr-toggle-bg: #2a2a4a;
    --gr-toggle-hover: #3a3a5a;
}

/* Toggle Mode – startet im Light Mode, wird per JS umgeschaltet */
.greviews-widget.gr-theme-toggle {
    /* Light als Default */
}
.greviews-widget.gr-theme-toggle.gr-active-dark {
    --gr-bg: #1a1a2e;
    --gr-card-bg: #16213e;
    --gr-text: #e0e0e0;
    --gr-text-secondary: #b0b0b0;
    --gr-text-muted: #888888;
    --gr-border: rgba(255, 255, 255, 0.08);
    --gr-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    --gr-star-empty: #444444;
    --gr-toggle-bg: #2a2a4a;
    --gr-toggle-hover: #3a3a5a;
}

/* ========== TOGGLE BUTTON ========== */
.gr-toggle {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--gr-toggle-bg);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    transition: background 0.2s, transform 0.2s;
    z-index: 10;
}
.gr-toggle:hover {
    background: var(--gr-toggle-hover);
    transform: scale(1.1);
}

/* ========== SUMMARY ========== */
.gr-summary {
    text-align: center;
    margin-bottom: 24px;
    color: var(--gr-text);
}
.gr-summary-stars {
    font-size: 1.6em;
    margin-bottom: 4px;
}
.gr-summary-text {
    font-size: 0.95em;
    color: var(--gr-text-secondary);
}

/* ========== WRAP ========== */
.gr-wrap {
    position: relative;
    overflow: hidden;
    width: 100%;
}
.gr-track {
    display: flex;
    gap: 16px;
    transition: transform 0.5s ease;
    will-change: transform;
}

/* ========== CARD ========== */
.gr-card {
    flex: 0 0 calc(20% - 13px);
    min-width: 180px;
    background: var(--gr-card-bg);
    border: 1px solid var(--gr-border);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--gr-shadow);
    display: flex;
    flex-direction: column;
    position: relative;
    transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.gr-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.gr-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}
.gr-info {
    flex: 1;
}
.gr-name {
    font-size: 0.85em;
    font-weight: 600;
    color: var(--gr-text);
}
.gr-date {
    font-size: 0.7em;
    color: var(--gr-text-muted);
    margin-top: 2px;
}
.gr-google-icon {
    opacity: var(--gr-google-opacity);
}

/* ========== STARS ========== */
.gr-stars, .gr-summary-stars {
    color: var(--gr-star);
    font-size: 1em;
    letter-spacing: 1px;
    margin-bottom: 10px;
}
.gr-star {
    color: var(--gr-star);
}
.gr-star-empty {
    color: var(--gr-star-empty);
}

/* ========== TEXT ========== */
.gr-text {
    font-size: 0.82em;
    line-height: 1.5;
    color: var(--gr-text-secondary);
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========== NAVIGATION ========== */
.gr-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
}
.gr-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--gr-accent);
    background: transparent;
    color: var(--gr-accent);
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gr-btn:hover {
    background: var(--gr-accent);
    color: #fff;
}
.gr-dots {
    display: flex;
    gap: 6px;
}
.gr-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gr-star-empty);
    cursor: pointer;
    transition: all 0.2s;
}
.gr-dot.active {
    background: var(--gr-accent);
}

/* ========== GOOGLE LINK ========== */
.gr-google-link {
    text-align: center;
    margin-top: 16px;
    font-size: 0.8em;
}
.gr-google-link a {
    color: var(--gr-text-muted);
    text-decoration: none;
    transition: color 0.2s;
}
.gr-google-link a:hover {
    color: var(--gr-accent);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .gr-card { flex: 0 0 calc(33.33% - 11px); }
}
@media (max-width: 768px) {
    .gr-card { flex: 0 0 calc(50% - 8px); }
}
@media (max-width: 480px) {
    .gr-card { flex: 0 0 100%; }
}
