/* Google Reviews Widget - Premium Edition
   Modern, attractive design matching Google's Material Design
*/

:root {
  --grw-bg: #ffffff;
  --grw-card-bg: #ffffff;
  --grw-text: #202124;
  --grw-text-secondary: #5f6368;
  --grw-border: #dadce0;
  --grw-shadow-sm: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
  --grw-shadow-md: 0 2px 6px 2px rgba(60, 64, 67, 0.15), 0 1px 2px 0 rgba(60, 64, 67, 0.3);
  --grw-shadow-lg: 0 4px 8px 3px rgba(60, 64, 67, 0.15), 0 1px 3px 0 rgba(60, 64, 67, 0.3);
  --grw-star-filled: #fbbc04;
  --grw-star-empty: #dadce0;
  --grw-primary: #1a73e8;
  --grw-primary-hover: #1557b0;
  --grw-success: #34a853;
  --grw-border-radius: 16px;
  --grw-border-radius-sm: 8px;
}

body.dark,
body.dark-mode,
[data-theme="dark"],
.dark-mode {
  --grw-bg: #202124;
  --grw-card-bg: #303134;
  --grw-text: #e8eaed;
  --grw-text-secondary: #bdc1c6;
  --grw-border: #5f6368;
  --grw-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3), 0 1px 3px 1px rgba(0, 0, 0, 0.15);
  --grw-shadow-md: 0 2px 6px 2px rgba(0, 0, 0, 0.15), 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --grw-shadow-lg: 0 4px 8px 3px rgba(0, 0, 0, 0.15), 0 1px 3px 0 rgba(0, 0, 0, 0.3);
  --grw-star-empty: #5f6368;
}

.grw {
  margin: 24px 0;
  font-family: "Google Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.grw-shell {
  background: var(--grw-bg);
  border-radius: var(--grw-border-radius);
  box-shadow: var(--grw-shadow-lg);
  overflow: hidden;
  border: 1px solid var(--grw-border);
  transition: box-shadow 0.2s ease;
}

.grw-shell:hover {
  box-shadow: var(--grw-shadow-md);
}

/* Header */
.grw-header {
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  padding: 16px 20px;
  border-bottom: 1px solid var(--grw-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

body.dark .grw-header,
body.dark-mode .grw-header,
[data-theme="dark"] .grw-header {
  background: linear-gradient(135deg, #303134 0%, #202124 100%);
}

.grw-header-content {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
  min-width: 0;
}

.grw-google-logo {
  flex-shrink: 0;
  opacity: 0.9;
  display: flex;
  align-items: center;
}

.grw-google-logo img {
  height: 28px;
  width: auto;
  max-width: 100px;
}

.grw-logo-mobile {
  display: none;
}

.grw-mobile-rating {
  display: none;
}

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

.grw-title {
  margin: 0 0 6px 0;
  font-size: 20px;
  font-weight: 500;
  color: var(--grw-text);
  letter-spacing: -0.3px;
  display: none;
}

.grw-rating-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.grw-rating-value {
  font-size: 28px;
  font-weight: 500;
  color: var(--grw-text);
  line-height: 1;
}

.grw-stars {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.grw-stars svg {
  width: 20px;
  height: 20px;
  display: block;
}

.grw-star-half {
  position: relative;
  display: inline-block;
}

.grw-star-half svg:first-child {
  clip-path: inset(0 50% 0 0);
}

.grw-review-count {
  font-size: 14px;
  color: var(--grw-text-secondary);
  font-weight: 400;
}

.grw-header-actions {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.grw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--grw-border-radius-sm);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.grw-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.grw-btn-primary {
  background: var(--grw-primary);
  color: #ffffff;
  border-color: var(--grw-primary);
}

.grw-btn-primary:hover {
  background: var(--grw-primary-hover);
  border-color: var(--grw-primary-hover);
  box-shadow: var(--grw-shadow-sm);
  transform: translateY(-1px);
}

.grw-btn-secondary {
  background: var(--grw-bg);
  color: var(--grw-primary);
  border-color: var(--grw-border);
}

.grw-btn-secondary:hover {
  background: rgba(26, 115, 232, 0.08);
  border-color: var(--grw-primary);
  box-shadow: var(--grw-shadow-sm);
}

/* Body */
.grw-body {
  padding: 20px;
}

.grw-reviews-container {
  position: relative;
}

.grw-swiper {
  padding: 8px 0 40px 0;
  overflow: visible;
  height: auto;
}

.grw-swiper .swiper-wrapper {
  height: auto;
  align-items: stretch;
}

.grw-swiper .swiper-slide {
  height: auto;
  display: flex;
}

.grw-review-card {
  background: var(--grw-card-bg);
  border: 1px solid var(--grw-border);
  border-radius: var(--grw-border-radius);
  padding: 16px;
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.2s ease;
  box-shadow: var(--grw-shadow-sm);
  flex: 1;
}

.grw-review-card:hover {
  box-shadow: var(--grw-shadow-md);
  transform: translateY(-2px);
}

.grw-review-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.grw-review-author {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.grw-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.grw-avatar-img {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.grw-avatar-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
  opacity: 1 !important;
}

/* Override any lazy loading opacity rules */
img[loading="lazy"].grw-avatar-img,
.grw-avatar-img[loading="lazy"] {
  opacity: 1 !important;
}

.grw-avatar-initials {
  font-size: 16px;
  font-weight: 500;
  color: #ffffff;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

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

.grw-author-name {
  margin: 0 0 3px 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--grw-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.grw-review-time {
  font-size: 13px;
  color: var(--grw-text-secondary);
  font-weight: 400;
}

.grw-review-rating {
  flex-shrink: 0;
}

.grw-review-rating .grw-stars svg {
  width: 18px;
  height: 18px;
}

.grw-review-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.grw-review-content {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--grw-text);
  font-weight: 400;
}

.grw-read-more {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--grw-primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  align-self: flex-start;
  transition: color 0.2s ease;
}

.grw-read-more:hover {
  color: var(--grw-primary-hover);
  text-decoration: underline;
}

/* Controls */
.grw-controls {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
  position: relative;
  z-index: 10;
  pointer-events: auto;
  width: 100%;
}

.grw-nav-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--grw-border);
  background: var(--grw-bg);
  color: var(--grw-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer !important;
  pointer-events: auto !important;
  z-index: 10 !important;
  position: relative;
  transition: all 0.2s ease;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.grw-nav-btn:hover:not(:disabled) {
  background: var(--grw-primary);
  color: #ffffff;
  border-color: var(--grw-primary);
  box-shadow: var(--grw-shadow-sm);
  transform: scale(1.05);
}

.grw-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.grw-nav-btn svg {
  width: 24px;
  height: 24px;
  pointer-events: none;
}

.grw-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  margin: 0;
  grid-column: 2;
  width: 100% !important;
  min-width: 0;
  text-align: center;
  overflow: visible;
}

.grw-pagination.swiper-pagination {
  width: 100% !important;
  position: relative !important;
  left: auto !important;
  transform: none !important;
  max-width: 100% !important;
}

.swiper-pagination-bullet {
  width: 8px;
  height: 8px;
  background: var(--grw-border);
  opacity: 1;
  transition: all 0.2s ease;
}

.swiper-pagination-bullet-active {
  background: var(--grw-primary);
  width: 24px;
  border-radius: 4px;
}

/* Status */
.grw-status {
  padding: 24px;
  text-align: center;
}

.grw-status-content {
  color: var(--grw-text-secondary);
  font-size: 14px;
}

/* Hide static testimonials */
.grw-hide {
  display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
  .grw-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
  }

  .grw-header-content {
    width: 100%;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  /* Logo styling voor mobiel */
  .grw-google-logo {
    width: 100%;
    justify-content: center;
    margin-bottom: 0;
  }

  .grw-google-logo img {
    max-width: 100px !important;
    height: auto !important;
  }

  .grw-logo-desktop {
    display: none !important;
  }

  .grw-logo-mobile {
    display: block !important;
    max-width: 100px !important;
    width: 100px !important;
    height: auto !important;
    margin: 0 auto;
  }

  .grw-google-logo .grw-logo-mobile {
    max-width: 100px !important;
    width: 100px !important;
    height: auto !important;
  }

  /* Mobiele rating sectie */
  .grw-mobile-rating {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin-top: 0;
    margin-bottom: 0;
  }

  .grw-mobile-stars {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }

  .grw-mobile-stars .grw-stars {
    display: flex;
    gap: 2px;
    align-items: center;
  }

  .grw-mobile-stars svg {
    width: 20px;
    height: 20px;
  }

  .grw-mobile-rating-value {
    font-size: 18px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.9);
    line-height: 1;
    margin-right: 4px;
  }

  .grw-mobile-count {
    font-size: 13px;
    color: rgba(0, 0, 0, 0.7);
    font-weight: 500;
    margin-top: 2px;
  }

  /* Verberg header-info op mobiel */
  .grw-header-info {
    display: none !important;
  }

  .grw-header-actions {
    width: 100%;
    flex-direction: column;
  }

  .grw-btn {
    width: 100%;
    justify-content: center;
  }

  .grw-body {
    padding: 16px 12px;
  }

  .grw-title {
    font-size: 18px;
  }

  .grw-rating-value {
    font-size: 24px;
  }

  .grw-review-card {
    padding: 14px;
  }
}

@media (max-width: 640px) {
  .grw-header {
    padding: 14px;
  }

  .grw-body {
    padding: 14px 10px;
  }

  .grw-swiper {
    padding-bottom: 36px;
  }

  .grw-controls {
    gap: 12px;
  }

  .grw-nav-btn {
    width: 36px;
    height: 36px;
  }

  .grw-swiper {
    padding: 4px 0 36px 0;
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.grw-review-card {
  animation: fadeIn 0.3s ease;
}

/* Accessibility */
.grw-btn:focus-visible,
.grw-nav-btn:focus-visible,
.grw-read-more:focus-visible {
  outline: 2px solid var(--grw-primary);
  outline-offset: 2px;
}

/* Print styles */
@media print {
  .grw-controls,
  .grw-header-actions {
    display: none;
  }

  .grw-review-card {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}
