/* --- 1. CORE VARIABLES (Force Apply) --- */
:root {
    --sr-text-dark: #1e293b;
    --sr-text-gray: #64748b;
    --sr-border: #e2e8f0;
    --sr-bg: #fff;
}

.sr-widget-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 1100px;
    margin: 40px auto;
    color: var(--sr-text-dark);
}
.sr-widget-container * { box-sizing: border-box; }

/* --- 2. HEADER SECTION --- */
.sr-header-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 20px;
}

/* Stats Card (White Box) */
.sr-stats-card {
    flex: 1;
    min-width: 300px;
    border: 1px solid var(--sr-border);
    border-radius: 12px;
    padding: 25px;
    display: flex;
    gap: 40px;
    align-items: center;
    background: #fff;
}

/* Left Score Column */
.sr-score-col { text-align: center; min-width: 120px; }
.sr-big-score { font-size: 64px; font-weight: 800; line-height: 1; display: block; margin-bottom: 5px; }
.sr-badge {
    background: #dcfce7; color: #166534; font-size: 11px; font-weight: 700;
    display: inline-block; padding: 4px 8px; border-radius: 4px; margin-bottom: 8px;
    text-transform: uppercase;
}
.sr-sub-text { display: block; font-size: 12px; color: var(--sr-text-gray); margin-top: 5px; }

/* Right Bars Column */
.sr-bars-col { flex: 1; }
.sr-bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; font-size: 13px; color: var(--sr-text-gray); }
.sr-star-lbl { width: 35px; }
.sr-track { flex: 1; height: 6px; background: #f1f5f9; border-radius: 10px; overflow: hidden; }
.sr-fill { height: 100%; background: var(--sr-widget-accent); border-radius: 10px; } /* Uses Widget Accent */
.sr-count-lbl { width: 20px; text-align: right; }

/* Button Area */
.sr-header-actions { padding-top: 10px; }
.sr-btn-primary {
    background: var(--sr-widget-accent);
    color: #fff;
    border: none;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.2s;
}
.sr-btn-primary:hover { opacity: 0.9; }

/* --- 3. REVIEWS GRID (The Cards) --- */
.sr-reviews-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); /* Responsive Grid */
    gap: 20px;
}

.sr-card {
    border: 1px solid var(--sr-border);
    border-radius: 12px;
    padding: 24px;
    background: #fff;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Card Header */
.sr-card-top { display: flex; gap: 12px; margin-bottom: 15px; }
.sr-avatar {
    width: 44px; height: 44px;
    background: color-mix(in srgb, var(--sr-widget-accent) 20%, white); /* Light Blue */
    color: var(--sr-widget-accent);       /* Dark Blue */
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 18px;
}
.sr-user-info { display: flex; flex-direction: column; justify-content: center; }
.sr-author-name { font-weight: 600; font-size: 15px; color: var(--sr-text-dark); }

/* Card Body */
.sr-card-body { flex: 1; margin-bottom: 20px; }
.sr-card-title { 
    margin: 0 0 8px 0; 
    font-size: 16px; 
    font-weight: 700; 
    color: var(--sr-text-dark, #1e293b);
    
    /* Truncation Magic */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    max-width: 100%;
}
.sr-card-text { font-size: 14px; line-height: 1.6; color: #475569; margin-bottom: 10px; }
.sr-mini-gallery img { width: 40px; height: 40px; border-radius: 4px; object-fit: cover; margin-right: 5px; border: 1px solid var(--sr-border); }

/* Card Footer */
.sr-card-foot {
    border-top: 1px solid #f1f5f9;
    padding-top: 15px;
}
.sr-link-btn {
    background: none; border: none; padding: 0;
    color: var(--sr-widget-accent);
    font-weight: 600; font-size: 13px;
    cursor: pointer;
}
.sr-link-btn:hover { text-decoration: underline; }

/* --- 4. STARS COMPONENT --- */
.sr-stars-static {
    display: inline-block; position: relative; font-size: 20px; color: #e2e8f0; line-height: 1;
    font-family: "Times New Roman", serif; /* Or FontAwesome if loaded */
}
.sr-stars-static::before { content: "★★★★★"; }
.sr-stars-static::after {
    content: "★★★★★"; position: absolute; left: 0; top: 0;
    color: var(--sr-star-color); overflow: hidden; width: calc(var(--v) * 20%);
}
.sr-small { font-size: 14px; }

/* --- 5. MODALS --- */
.sr-modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 99999;
    display: none; align-items: center; justify-content: center; backdrop-filter: blur(2px);
}
.sr-modal-box {
    background: #fff; width: 90%; max-width: 500px; border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1); overflow: hidden; max-height: 90vh; display: flex; flex-direction: column;
}
.sr-modal-header { padding: 15px 25px; border-bottom: 1px solid var(--sr-border); display: flex; justify-content: space-between; align-items: center; }
.sr-modal-header h3 { margin: 0; font-size: 18px; }
.sr-close-btn { font-size: 24px; cursor: pointer; color: #94a3b8; }
.sr-modal-content { padding: 25px; overflow-y: auto; }

/* Form inputs */
.sr-field-group { margin-bottom: 15px; }
.sr-field-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.sr-field-group input, .sr-field-group textarea { width: 100%; padding: 10px; border: 1px solid var(--sr-border); border-radius: 6px; }
.sr-full-width { width: 100%; margin-top: 10px; }

/* Star Select */
.sr-star-select { display: flex; flex-direction: row-reverse; justify-content: flex-end; }
.sr-star-select input { display: none; }
.sr-star-select label { font-size: 30px; color: #e2e8f0; cursor: pointer; margin-bottom: 0 !important; }
.sr-star-select label::before { content: "★"; }
.sr-star-select label:hover, .sr-star-select label:hover ~ label, .sr-star-select input:checked ~ label { color: var(--sr-star-color); }

/* Lightbox */
.sr-lightbox-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.9); z-index: 100000; align-items: center; justify-content: center; }
.sr-lightbox-overlay img { max-width: 90%; max-height: 90%; border-radius: 4px; }
.sr-lightbox-close { position: absolute; top: 20px; right: 20px; color: #fff; font-size: 40px; cursor: pointer; }

/* --- LOAD MORE WRAPPER & BUTTON --- */
.sr-load-more-wrap {
    text-align: center;
    margin-top: 40px;
    margin-bottom: 20px;
}

.sr-btn-secondary {
    background: #fff;
    border: 1px solid var(--sr-border);
    color: var(--sr-text-dark, #1e293b);
    padding: 12px 32px;
    border-radius: 50px; /* Pill shape */
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.sr-btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    color: var(--sr-widget-accent, #2563eb); /* Highlights text in your accent color on hover */
}

.sr-btn-secondary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Responsive */
@media(max-width: 768px) {
    .sr-header-section { flex-direction: column; }
    .sr-stats-card { width: 100%; padding: 15px; }
    .sr-header-actions { width: 100%; }
    .sr-btn-primary { width: 100%; }
}