/**
 * Press Ganey Elementor Widget Styles
 */

/* ========================================
   COMMON STYLES
   ======================================== */

.press-ganey-widget-container {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.press-ganey-widget-container .bf-widget {
    width: 100%;
}

/* Error message styling */
.press-ganey-error,
.pg-api-error {
    color: #cc0000;
    padding: 20px;
    background: #fff0f0;
    border: 1px solid #ffcccc;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
}

/* Ensure proper spacing within the widget */
.press-ganey-widget-container > div {
    margin-bottom: 0;
}

/* Loading state placeholder for JS widget */
.press-ganey-widget-container:empty::before {
    content: 'Loading reviews...';
    display: block;
    padding: 40px;
    text-align: center;
    color: #666;
    background: #f9f9f9;
    border-radius: 4px;
}

/* ========================================
   API WIDGET STYLES
   ======================================== */

.pg-api-widget {
    width: 100%;
}

.pg-api-widget * {
    box-sizing: border-box;
}

/* Summary section */
.pg-api-summary {
    transition: box-shadow 0.2s ease;
}

.pg-api-summary:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Star ratings */
.pg-stars {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.pg-stars svg {
    flex-shrink: 0;
}

/* AI Summary section */
.pg-api-ai-summary {
    transition: background-color 0.2s ease;
}

.pg-api-ai-summary p {
    font-style: italic;
}

/* Comments section */
.pg-api-comments {
    transition: box-shadow 0.2s ease;
}

.pg-api-comments:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.pg-api-comment {
    transition: background-color 0.2s ease;
}

.pg-api-comment:hover {
    background-color: rgba(0, 0, 0, 0.01);
}

.pg-api-comment-text {
    quotes: '"' '"' ''' ''';
}

/* ========================================
   RESPONSIVE STYLES
   ======================================== */

@media screen and (max-width: 768px) {
    .press-ganey-widget-container {
        padding: 0 10px;
    }
    
    .pg-api-summary,
    .pg-api-ai-summary,
    .pg-api-comments {
        padding: 16px;
    }
    
    .pg-api-summary h3,
    .pg-api-comments h3 {
        font-size: 16px;
    }
    
    .pg-api-summary > div > div:first-child {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .pg-api-summary,
    .pg-api-ai-summary,
    .pg-api-comments {
        box-shadow: none !important;
        border: 1px solid #ddd;
    }
    
    .pg-api-widget {
        page-break-inside: avoid;
    }
    
    .pg-api-comment {
        page-break-inside: avoid;
    }
}

/* ========================================
   ELEMENTOR EDITOR PREVIEW
   ======================================== */

.elementor-editor-active .pg-api-widget {
    pointer-events: none;
}

.elementor-editor-active .press-ganey-widget-container[id^="bf-bsr-comments-"]:empty::before {
    content: 'Press Ganey widget will load on the frontend.';
    display: block;
    padding: 40px;
    text-align: center;
    color: #666;
    background: #f0f9ff;
    border: 2px dashed #2196f3;
    border-radius: 8px;
}
