/*
 * Live Google Reviews for Elementor — Frontend Styles
 * Version: 1.0.0
 */

/* =========================================================
   CSS Custom Properties
   ========================================================= */
:root {
  --lgr-star-fill:    #F5A623;
  --lgr-star-empty:   #D1D5DB;
  --lgr-card-bg:      #ffffff;
  --lgr-card-border:  #E5E7EB;
  --lgr-card-shadow:  0 2px 8px rgba(0,0,0,.08);
  --lgr-text:         #374151;
  --lgr-text-light:   #6B7280;
  --lgr-author:       #111827;
  --lgr-radius:       12px;
  --lgr-gap:          24px;
  --lgr-avatar-size:  48px;
  --lgr-avatar-bg:    #4285F4;
  --lgr-transition:   all .25s ease;
  --lgr-nav-size:     40px;
}

/* =========================================================
   Wrapper
   ========================================================= */
.lgr-reviews-wrapper {
  position: relative;
  font-family: inherit;
  box-sizing: border-box;
}

/* =========================================================
   Grid Layouts
   ========================================================= */
.lgr-reviews-grid {
  display: grid;
  gap: var(--lgr-gap);
  grid-template-columns: repeat(var(--lgr-cols, 3), 1fr);
}

.lgr-grid-cols-1 { --lgr-cols: 1; }
.lgr-grid-cols-2 { --lgr-cols: 2; }
.lgr-grid-cols-3 { --lgr-cols: 3; }
.lgr-grid-cols-4 { --lgr-cols: 4; }

@media (max-width: 1024px) {
  .lgr-grid-cols-4 { --lgr-cols: 3; }
}
@media (max-width: 768px) {
  .lgr-grid-cols-3, .lgr-grid-cols-4 { --lgr-cols: 2; }
}
@media (max-width: 480px) {
  .lgr-grid-cols-2, .lgr-grid-cols-3, .lgr-grid-cols-4 { --lgr-cols: 1; }
}

/* =========================================================
   Base Card
   ========================================================= */
.lgr-review-card {
  background: var(--lgr-card-bg);
  border: 1px solid var(--lgr-card-border);
  border-radius: var(--lgr-radius);
  padding: 24px;
  box-shadow: var(--lgr-card-shadow);
  transition: var(--lgr-transition);
  box-sizing: border-box;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.lgr-review-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}

/* =========================================================
   Stars
   ========================================================= */
.lgr-stars-rating {
  display: flex;
  gap: 2px;
  margin-bottom: 10px;
  line-height: 1;
}

.lgr-star {
  font-style: normal;
  font-size: 16px;
  line-height: 1;
}

.lgr-star.filled { color: var(--lgr-star-fill); }
.lgr-star.empty  { color: var(--lgr-star-empty); }

/* =========================================================
   Author
   ========================================================= */
.lgr-author-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding-top: 16px;
}

.lgr-author-photo {
  width: var(--lgr-avatar-size);
  height: var(--lgr-avatar-size);
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.lgr-author-avatar {
  width: var(--lgr-avatar-size);
  height: var(--lgr-avatar-size);
  border-radius: 50%;
  background: var(--lgr-avatar-bg);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
}

.lgr-author-details {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
}

.lgr-author-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--lgr-author);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lgr-author-name a {
  color: inherit;
  text-decoration: none;
}

.lgr-author-name a:hover { text-decoration: underline; }

.lgr-review-date {
  font-size: 12px;
  color: var(--lgr-text-light);
}

/* =========================================================
   Review Text
   ========================================================= */
.lgr-review-text {
  font-size: 14px;
  line-height: 1.65;
  color: var(--lgr-text);
  margin: 0 0 16px;
  flex-grow: 1;
}

.lgr-read-more {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: #4285F4;
  font-size: 13px;
  font-weight: 500;
  text-decoration: underline;
  display: inline;
}

.lgr-read-more:hover { color: #1a6eda; }

/* =========================================================
   Google Badge
   ========================================================= */
.lgr-google-badge,
.lgr-google-icon-wrap {
  display: flex;
  align-items: center;
}

.lgr-google-badge { margin-bottom: 12px; }

.lgr-google-icon-wrap svg,
.lgr-google-badge svg {
  width: 20px;
  height: 20px;
}

/* =========================================================
   Header / Summary
   ========================================================= */
.lgr-header {
  margin-bottom: 28px;
}

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

.lgr-avg-number {
  font-size: 48px;
  font-weight: 700;
  color: var(--lgr-author);
  line-height: 1;
}

.lgr-business-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lgr-business-name {
  font-size: 18px;
  font-weight: 700;
  display: block;
}

.lgr-powered-by {
  font-size: 12px;
  color: var(--lgr-text-light);
}

.lgr-total-reviews {
  font-size: 13px;
  color: var(--lgr-text-light);
}

.lgr-no-reviews {
  padding: 32px;
  text-align: center;
  color: var(--lgr-text-light);
  font-size: 15px;
}

/* =========================================================
   No-reviews state
   ========================================================= */
.lgr-no-reviews p {
  margin: 0;
}

/* =========================================================
   Layout: Modern
   ========================================================= */
.lgr-layout-modern .lgr-card-modern {
  border-top: 3px solid #4285F4;
}

/* =========================================================
   Layout: Classic
   ========================================================= */
.lgr-layout-classic .lgr-card-classic .lgr-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.lgr-layout-classic .lgr-stars-right {
  margin-left: auto;
  margin-bottom: 0;
}

.lgr-header-classic .lgr-header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #f9fafb;
  border-radius: var(--lgr-radius);
  padding: 16px 24px;
}

/* =========================================================
   Layout: Minimal
   ========================================================= */
.lgr-layout-minimal .lgr-card-minimal {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  border-bottom: 1px solid var(--lgr-card-border);
  border-radius: 0;
  padding: 24px 0;
}

.lgr-layout-minimal .lgr-card-minimal:hover {
  transform: none;
  box-shadow: none;
}

.lgr-layout-minimal blockquote {
  margin: 0 0 16px;
  padding: 0;
  border: 0;
}

.lgr-author-minimal {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lgr-author-minimal cite { font-style: normal; font-weight: 600; }
.lgr-author-minimal time { font-size: 12px; color: var(--lgr-text-light); display: block; }

/* =========================================================
   Layout: Dark
   ========================================================= */
.lgr-layout-dark {
  background: #0f172a;
  border-radius: var(--lgr-radius);
  padding: 32px;
}

.lgr-layout-dark .lgr-card-dark {
  background: #1e293b;
  border-color: #334155;
  --lgr-text: #cbd5e1;
  --lgr-author: #f1f5f9;
  --lgr-text-light: #94a3b8;
}

.lgr-layout-dark .lgr-header-dark {
  border-bottom: 1px solid #334155;
  padding-bottom: 20px;
  margin-bottom: 28px;
}

.lgr-layout-dark .lgr-rating-summary {
  color: #f1f5f9;
}

.lgr-layout-dark .lgr-avg-number { color: #f1f5f9; }
.lgr-layout-dark .lgr-total-reviews { color: #94a3b8; }

.lgr-card-dark .lgr-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.lgr-card-dark .lgr-google-icon-wrap { margin-left: auto; }

/* =========================================================
   Layout: Glassmorphism
   ========================================================= */
.lgr-layout-glass {
  padding: 32px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 20px;
  position: relative;
  overflow: hidden;
}

.lgr-card-glass {
  background: rgba(255,255,255,.15) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-color: rgba(255,255,255,.25) !important;
  border-radius: 16px !important;
  --lgr-text: #fff;
  --lgr-author: #fff;
  --lgr-text-light: rgba(255,255,255,.75);
  position: relative;
  overflow: hidden;
}

.lgr-glass-glow {
  position: absolute;
  top: -60px;
  right: -60px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  pointer-events: none;
}

/* =========================================================
   Layout: Masonry
   ========================================================= */
.lgr-masonry-grid {
  column-count: 3;
  column-gap: var(--lgr-gap);
}

.lgr-masonry-grid[data-columns="1"] { column-count: 1; }
.lgr-masonry-grid[data-columns="2"] { column-count: 2; }
.lgr-masonry-grid[data-columns="3"] { column-count: 3; }
.lgr-masonry-grid[data-columns="4"] { column-count: 4; }

@media (max-width: 768px) {
  .lgr-masonry-grid { column-count: 2 !important; }
}
@media (max-width: 480px) {
  .lgr-masonry-grid { column-count: 1 !important; }
}

.lgr-masonry-item {
  break-inside: avoid;
  margin-bottom: var(--lgr-gap);
}

.lgr-card-masonry .lgr-card-top-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.lgr-card-masonry .lgr-google-icon-wrap { margin-left: auto; }

/* =========================================================
   Layout: List
   ========================================================= */
.lgr-reviews-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.lgr-card-list {
  border-radius: 0 !important;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  display: flex !important;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 0;
  flex-direction: row;
}

.lgr-list-left { flex-shrink: 0; }
.lgr-list-content { flex-grow: 1; }
.lgr-list-right { flex-shrink: 0; }

.lgr-list-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.lgr-list-header {
  background: #f9fafb;
  border-radius: var(--lgr-radius);
  padding: 24px;
  margin-bottom: 24px;
  display: flex;
  gap: 32px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.lgr-list-summary {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lgr-rating-bars { flex-grow: 1; min-width: 200px; }

.lgr-rating-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 13px;
}

.lgr-bar-label { width: 40px; color: var(--lgr-text-light); }
.lgr-bar-count { width: 24px; text-align: right; color: var(--lgr-text-light); }

.lgr-bar-track {
  flex-grow: 1;
  height: 8px;
  background: var(--lgr-card-border);
  border-radius: 4px;
  overflow: hidden;
}

.lgr-bar-fill {
  height: 100%;
  background: var(--lgr-star-fill);
  border-radius: 4px;
  transition: width .4s ease;
}

/* =========================================================
   Layout: Luxury
   ========================================================= */
.lgr-layout-luxury {
  --lgr-card-border: #d4af37;
  --lgr-star-fill: #d4af37;
}

.lgr-card-luxury {
  border-color: rgba(212,175,55,.4) !important;
  background: #fdf9f0 !important;
  position: relative;
}

.lgr-luxury-quote {
  font-size: 72px;
  line-height: .8;
  color: rgba(212,175,55,.25);
  font-family: Georgia, serif;
  margin-bottom: 8px;
  font-weight: 700;
}

.lgr-luxury-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, #d4af37, transparent);
  margin: 16px 0;
}

/* =========================================================
   Layout: Corporate
   ========================================================= */
.lgr-corporate-header {
  display: flex;
  align-items: center;
  gap: 20px;
  background: #1e3a5f;
  color: #fff;
  border-radius: var(--lgr-radius) var(--lgr-radius) 0 0;
  padding: 20px 24px;
  margin-bottom: 0;
}

.lgr-corp-logo svg { width: 28px; height: 28px; }
.lgr-corp-stats .lgr-avg-number { font-size: 32px; color: #fff; }
.lgr-corp-meta strong { font-size: 16px; display: block; }
.lgr-corp-meta span { font-size: 13px; opacity: .8; }

.lgr-card-corporate .lgr-corp-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.lgr-card-corporate .lgr-corp-card-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--lgr-card-border);
}

/* =========================================================
   Carousel
   ========================================================= */
.lgr-carousel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

/* =========================================================
   Swiper Overrides
   ========================================================= */
.lgr-slider {
  padding-bottom: 44px !important;
}

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

.lgr-slider .lgr-review-card {
  width: 100%;
}

.lgr-nav-next,
.lgr-nav-prev {
  width: var(--lgr-nav-size) !important;
  height: var(--lgr-nav-size) !important;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  color: var(--lgr-author) !important;
}

.lgr-nav-next::after,
.lgr-nav-prev::after {
  font-size: 14px !important;
  font-weight: 700;
}

.swiper-pagination-bullet { background: var(--lgr-author); }
.swiper-pagination-bullet-active { background: #4285F4; }

/* =========================================================
   RTL Support
   ========================================================= */
[dir="rtl"] .lgr-author-info { flex-direction: row-reverse; }
[dir="rtl"] .lgr-stars-rating { flex-direction: row-reverse; }
[dir="rtl"] .lgr-list-left { order: 2; }
[dir="rtl"] .lgr-list-content { order: 1; }
