/**
 * GMB Club Connect - Frontend Styles
 * 
 * @package GMB_Club_Connect
 */

/* ==========================================================================
   Variables & Reset
   ========================================================================== */

.gmbcc-widget {
    --gmb-green: #34A853;
    --gmb-yellow: #FBBC04;
    --gmb-blue: #4285F4;
    --gmb-red: #EA4335;
    --gmb-text: #202124;
    --gmb-text-secondary: #5F6368;
    --gmb-bg: #FFFFFF;
    --gmb-bg-light: #F8F9FA;
    --gmb-border: #E8E8E8;
    --gmb-shadow: 0 2px 8px rgba(0,0,0,0.08);
    --gmb-shadow-lg: 0 4px 20px rgba(0,0,0,0.12);
    --gmb-radius: 8px;
    --gmb-radius-lg: 16px;
    --gmb-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    
    font-family: var(--gmb-font);
    font-size: 14px;
    line-height: 1.5;
    color: var(--gmb-text);
    box-sizing: border-box;
}

.gmbcc-widget *,
.gmbcc-widget *::before,
.gmbcc-widget *::after {
    box-sizing: inherit;
}

/* ==========================================================================
   Review Card - Centered Design (Slider)
   ========================================================================== */

.gmbcc-review-card {
    background: var(--gmb-bg);
    border-radius: var(--gmb-radius-lg);
    padding: 20px 16px;
    height: 100%;
    box-shadow: var(--gmb-shadow);
    position: relative;
}

.gmbcc-card-centered {
    text-align: center;
}

/* Google icon in corner */
.gmbcc-card-google-icon {
    position: absolute;
    top: 12px;
    right: 12px;
}

/* Avatar centered */
.gmbcc-card-avatar {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.gmbcc-card-avatar img,
.gmbcc-card-avatar .gmbcc-review-avatar-default {
    width: 56px !important;
    height: 56px !important;
    border-radius: 50%;
    object-fit: cover;
}

/* Author info centered */
.gmbcc-card-author {
    margin-bottom: 8px;
}

.gmbcc-card-author .gmbcc-review-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--gmb-text);
    margin-bottom: 2px;
}

.gmbcc-card-author .gmbcc-review-date {
    font-size: 12px;
    color: var(--gmb-text-secondary);
}

/* Rating centered */
.gmbcc-card-rating {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin-bottom: 10px;
}

.gmbcc-verified-icon {
    margin-left: 2px;
}

/* Review text */
.gmbcc-review-text {
    font-size: 13px;
    line-height: 1.5;
    color: var(--gmb-text);
}

.gmbcc-card-centered .gmbcc-review-text {
    text-align: center;
}

/* ==========================================================================
   Header styles - Communs
   ========================================================================== */

.gmbcc-slider-header,
.gmbcc-list-header,
.gmbcc-grid-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.gmbcc-slider-header {
    margin-left: 52px;
    margin-right: 52px;
}

.gmbcc-header-content {
    flex: 1;
}

.gmbcc-header-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gmb-text);
}

.gmbcc-header-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.gmbcc-rating-num {
    font-weight: 700;
    font-size: 15px;
}

.gmbcc-rating-count {
    color: var(--gmb-text-secondary);
    font-size: 13px;
}

/* Header Badge Style */
.gmbcc-header-badge {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
    background: var(--gmb-bg);
    border-radius: var(--gmb-radius-lg);
    box-shadow: var(--gmb-shadow);
}

.gmbcc-header-badge-content {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.gmbcc-badge-rating {
    font-size: 32px;
    font-weight: 700;
    color: var(--gmb-text);
}

.gmbcc-header-badge-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gmbcc-badge-label {
    font-weight: 600;
    color: var(--gmb-green);
}

/* Header Logo Style */
.gmbcc-header-logo {
    padding: 16px;
    background: var(--gmb-bg);
    border-radius: var(--gmb-radius-lg);
    box-shadow: var(--gmb-shadow);
}

/* Google link button */
.gmbcc-google-link {
    display: inline-block;
    padding: 10px 24px;
    background: var(--gmb-blue);
    color: white !important;
    text-decoration: none;
    border-radius: var(--gmb-radius);
    font-weight: 500;
    font-size: 13px;
    transition: background 0.2s;
}

.gmbcc-google-link:hover {
    background: #3367d6;
    color: white !important;
}

/* ==========================================================================
   Slider Layout
   ========================================================================== */

[class*="gmbcc-layout-slider-"] {
    padding: 10px 0;
}

.gmbcc-slider-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.gmbcc-slider-wrapper {
    flex: 1;
    overflow: hidden;
}

.gmbcc-slider-track {
    display: flex;
    transition: transform 0.5s ease;
}

.gmbcc-slide {
    flex: 0 0 100%;
    min-width: 0;
    padding: 8px;
}

@media (min-width: 768px) {
    .gmbcc-slide {
        flex: 0 0 50%;
    }
}

@media (min-width: 1024px) {
    .gmbcc-slide {
        flex: 0 0 33.333%;
    }
}

/* Nav buttons */
.gmbcc-slider-nav {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gmb-bg);
    border: 1px solid var(--gmb-border);
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    color: var(--gmb-text-secondary);
    transition: all 0.2s;
    box-shadow: var(--gmb-shadow);
    font-size: 28px;
    font-weight: 300;
    line-height: 1;
    padding: 0;
    padding-bottom: 4px;
}

.gmbcc-slider-nav:hover {
    border-color: var(--gmb-text-secondary);
    color: var(--gmb-text);
    box-shadow: var(--gmb-shadow-lg);
}

/* Spacer */
.gmbcc-slider-spacer {
    height: 20px;
}

/* Footer */
.gmbcc-slider-footer {
    text-align: center;
    margin-top: 10px;
}

/* ==========================================================================
   Layout: List - En-tête et réponses intégrés
   ========================================================================== */

.gmbcc-layout-list {
    max-width: 700px;
    margin: 0 auto;
}

.gmbcc-list-card {
    background: var(--gmb-bg);
    border-radius: var(--gmb-radius-lg);
    box-shadow: var(--gmb-shadow);
    padding: 24px;
}

.gmbcc-list-header {
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gmb-border);
    margin-bottom: 0;
}

.gmbcc-list-container {
    margin-top: 0;
}

.gmbcc-list-item {
    border-bottom: 1px solid var(--gmb-border);
    padding: 20px 0;
}

.gmbcc-list-item:last-child {
    border-bottom: none;
}

.gmbcc-list-item.gmbcc-hidden {
    display: none;
}

/* Review header dans liste */
.gmbcc-review-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

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

.gmbcc-review-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--gmb-text);
}

.gmbcc-review-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.gmbcc-review-date {
    font-size: 12px;
    color: var(--gmb-text-secondary);
}

/* Review Reply - Intégré dans la card */
.gmbcc-review-reply {
    margin-top: 16px;
    padding: 16px;
    background: var(--gmb-bg-light);
    border-radius: var(--gmb-radius);
    border-left: 3px solid var(--gmb-blue);
}

.gmbcc-reply-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--gmb-text-secondary);
    margin-bottom: 6px;
}

.gmbcc-reply-text {
    font-size: 13px;
    color: var(--gmb-text);
    line-height: 1.6;
}

/* Boutons voir plus/moins */
.gmbcc-list-toggle {
    text-align: center;
    padding-top: 16px;
}

.gmbcc-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: var(--gmb-bg);
    border: 1px solid var(--gmb-border);
    border-radius: var(--gmb-radius);
    cursor: pointer;
    font-size: 13px;
    color: var(--gmb-text);
    transition: all 0.2s;
}

.gmbcc-toggle-btn:hover {
    border-color: var(--gmb-text-secondary);
    background: var(--gmb-bg-light);
}

.gmbcc-toggle-btn svg {
    width: 16px;
    height: 16px;
}

.gmbcc-list-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--gmb-border);
    margin-top: 16px;
}

/* ==========================================================================
   Layout: Grid
   ========================================================================== */

.gmbcc-layout-grid {
    padding: 20px 0;
}

.gmbcc-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

/* ==========================================================================
   Layout: Badge - Position configurable
   ========================================================================== */

.gmbcc-layout-badge {
    display: block;
}

.gmbcc-layout-badge.gmbcc-badge-left {
    text-align: left;
}

.gmbcc-layout-badge.gmbcc-badge-center {
    text-align: center;
}

.gmbcc-layout-badge.gmbcc-badge-right {
    text-align: right;
}

.gmbcc-badge-card {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 24px 32px;
    background: var(--gmb-bg);
    border: 1px solid var(--gmb-border);
    border-radius: var(--gmb-radius-lg);
    box-shadow: var(--gmb-shadow);
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s;
}

.gmbcc-badge-card:hover {
    box-shadow: var(--gmb-shadow-lg);
}

.gmbcc-badge-rating-large {
    font-size: 42px;
    font-weight: 700;
    line-height: 1;
}

.gmbcc-badge-count {
    font-size: 13px;
}

/* ==========================================================================
   Layout: Badge Horizontal - Position configurable
   ========================================================================== */

.gmbcc-layout-badge-horizontal {
    display: block;
}

.gmbcc-layout-badge-horizontal.gmbcc-badge-left {
    text-align: left;
}

.gmbcc-layout-badge-horizontal.gmbcc-badge-center {
    text-align: center;
}

.gmbcc-layout-badge-horizontal.gmbcc-badge-right {
    text-align: right;
}

.gmbcc-badge-horizontal {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    background: var(--gmb-bg);
    border: 1px solid var(--gmb-border);
    border-radius: var(--gmb-radius-lg);
    box-shadow: var(--gmb-shadow);
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s;
}

.gmbcc-badge-horizontal:hover {
    box-shadow: var(--gmb-shadow-lg);
}

.gmbcc-badge-h-rating {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gmbcc-badge-h-num {
    font-size: 24px;
    font-weight: 700;
}

.gmbcc-badge-h-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.gmbcc-badge-h-count {
    font-size: 12px;
}

.gmbcc-badge-h-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gmb-green);
}

/* ==========================================================================
   Layout: Floating
   ========================================================================== */

.gmbcc-layout-floating {
    position: fixed;
    bottom: 20px;
    z-index: 9999;
}

.gmbcc-layout-floating.gmbcc-floating-right {
    right: 20px !important;
    left: auto !important;
}

.gmbcc-layout-floating.gmbcc-floating-left {
    left: 20px !important;
    right: auto !important;
}

.gmbcc-floating-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--gmb-bg);
    border: 1px solid var(--gmb-border);
    border-radius: 50px;
    box-shadow: var(--gmb-shadow-lg);
    cursor: pointer;
    transition: all 0.2s;
}

.gmbcc-floating-toggle:hover {
    transform: scale(1.05);
}

.gmbcc-floating-badge {
    font-weight: 700;
    font-size: 15px;
    color: var(--gmb-text);
}

.gmbcc-floating-panel {
    display: none;
    position: absolute;
    bottom: 60px;
    width: 340px;
    border-radius: var(--gmb-radius-lg);
    box-shadow: var(--gmb-shadow-lg);
    overflow: hidden;
}

.gmbcc-floating-right .gmbcc-floating-panel {
    right: 0;
    left: auto;
}

.gmbcc-floating-left .gmbcc-floating-panel {
    left: 0;
    right: auto;
}

.gmbcc-layout-floating.gmbcc-open .gmbcc-floating-panel {
    display: block;
    animation: gmb-slide-up 0.3s ease;
}

@keyframes gmb-slide-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gmbcc-floating-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
}

.gmbcc-floating-header .gmbcc-header-content {
    flex: 1;
}

.gmbcc-floating-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    transition: opacity 0.2s;
}

.gmbcc-header-minimal {
    justify-content: flex-end;
    padding: 8px;
}

.gmbcc-floating-reviews {
    max-height: 320px;
    overflow-y: auto;
    padding: 0 12px;
}

.gmbcc-floating-reviews .gmbcc-review-card {
    margin: 10px 0;
    padding: 14px;
    box-shadow: none;
    border-radius: var(--gmb-radius);
}

.gmbcc-floating-footer {
    padding: 14px 16px;
    text-align: center;
}

.gmbcc-floating-footer .gmbcc-google-link {
    display: block;
    width: 100%;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .gmbcc-slider-header {
        margin-left: 44px;
        margin-right: 44px;
    }
    
    .gmbcc-slider-nav {
        width: 32px;
        height: 32px;
        font-size: 24px;
    }
    
    .gmbcc-list-card {
        padding: 16px;
    }
    
    .gmbcc-layout-floating .gmbcc-floating-panel {
        width: calc(100vw - 40px);
    }
    
    .gmbcc-floating-right .gmbcc-floating-panel {
        right: 0;
    }
    
    .gmbcc-floating-left .gmbcc-floating-panel {
        left: 0;
    }
}

/* ==========================================================================
   Animations
   ========================================================================== */

.gmbcc-widget {
    animation: gmb-fade-in 0.3s ease;
}

@keyframes gmb-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ==========================================================================
   Print
   ========================================================================== */

@media print {
    .gmbcc-layout-floating,
    .gmbcc-slider-nav {
        display: none;
    }
}
