/**
 * Rating System - Core Styles
 * Styles chung cho tất cả components
 */

/* ===== Layout ===== */
.card-body > .d-flex:first-of-type {
    display: flex;
    flex-direction: row;
    gap: 30px;
}

.rating-overview-left {
    flex: 0 0 50%;
}

.customer-images {
    flex: 0 0 50%;
}

/* ===== CSS Variables ===== */
:root {
    --rating-primary: #1a73e8;
    --rating-primary-dark: #1557b0;
    --rating-success: #34a853;
    --rating-warning: #ffc107;
    --rating-error: #ea4335;
    --rating-text-primary: #202124;
    --rating-text-secondary: #5f6368;
    --rating-text-tertiary: #9aa0a6;
    --rating-bg-primary: #ffffff;
    --rating-bg-secondary: #f8f9fa;
    --rating-bg-tertiary: #f1f3f4;
    --rating-border: #e8eaed;
    --rating-shadow-sm: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
    --rating-shadow-md: 0 1px 3px 0 rgba(60,64,67,0.3), 0 4px 8px 3px rgba(60,64,67,0.15);
    --rating-shadow-lg: 0 2px 6px 2px rgba(60,64,67,0.3), 0 8px 16px 4px rgba(60,64,67,0.15);
    --rating-radius-sm: 8px;
    --rating-radius-md: 12px;
    --rating-radius-lg: 16px;
}

/* ===== Star Ratings ===== */
.rating-stars {
    display: flex;
    align-items: center;
    gap: 2px;
}

.rating-stars i {
    color: var(--rating-warning);
    font-size: 16px;
}

.rating-star {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    font-size: 28px;
    color: #ced4da;
    cursor: pointer;
    transition: transform 0.08s ease, color 0.08s ease;
}

.rating-star.is-on {
    color: var(--rating-warning);
}

.rating-star:hover {
    transform: scale(1.08);
}

#ratingStars {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: nowrap;
    user-select: none;
}

#chosenStars i {
    font-size: 18px;
    color: var(--rating-warning);
}

#ratingLabel {
    min-height: 1.25rem;
    font-size: 14px;
    color: var(--rating-text-secondary);
}

/* ===== Rating Overview ===== */
.rating-overview-listdetail-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    padding: 4px 0;
}

.rating-overview-listdetail-item-rating {
    flex: 0 0 100px;
    display: flex;
    gap: 2px;
}

.rating-overview-listdetail-item-rating i {
    font-size: 14px;
}

.rating-overview-listdetail-item-progress {
    flex: 1;
    height: 8px;
    margin: 0 12px;
}

.rating-overview-listdetail-item-progress .progress-bar {
    background-color: #60A5FA;
}

.rating-overview-listdetail-item-text {
    flex: 0 0 80px;
    color: #333;
    font-weight: 500;
    white-space: nowrap;
    font-size: 14px;
}

/* ===== Rating Items ===== */
.rating-list {
    overflow-y: hidden;
    max-height: none;
}

.rating-item {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: background-color 0.2s;
}

.rating-item:hover {
    background: #f8f9fa;
}

.rating-item .rounded-circle {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px;
    object-fit: cover;
}

.rating-item .fw-bold {
    font-size: 14px;
}

.rating-item .text-muted.small {
    font-size: 12px;
}

.rating-content {
    line-height: 1.5;
    color: #333;
    font-size: 14px;
}

/* ===== Rating Images ===== */
.rating-images {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 8px 0;
}

.rating-image-item {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.rating-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.rating-image-item:hover img {
    transform: scale(1.05);
}

/* ===== Helpful Button ===== */
.btn-like-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-like-icon i {
    font-size: 14px;
    color: #666;
    transition: color 0.2s ease;
}

.btn-like-icon:hover {
    border-color: #0d6efd;
    background: #f8f9fa;
}

.btn-like-icon:hover i {
    color: #0d6efd;
}

.btn-like-icon.active {
    background: #0d6efd;
    border-color: #0d6efd;
}

.btn-like-icon.active i {
    color: #fff;
}

.btn-like-icon[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

.like-text,
.like-count {
    font-size: 13px;
    font-weight: 400;
    color: #555;
}

.like-count {
    color: #888;
}

/* ===== Used Days Text ===== */
.used-days-text {
    font-size: 12px;
    font-weight: 400;
    color: #666;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.used-days-text i {
    font-size: 11px;
    color: #888;
}

/* ===== Customer Images Strip ===== */
.customer-images {
    margin-bottom: 16px;
}

.customer-images h6 {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

#customerImagesStrip {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 8px;
}

#customerImagesStrip::-webkit-scrollbar {
    display: none;
}

.strip-item {
    position: relative;
    width: 150px;
    height: 150px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid #e0e0e0;
    flex-shrink: 0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.strip-item:hover {
    border-color: #4CAF50;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76,175,80,0.2);
}

.strip-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.strip-item:hover img {
    transform: scale(1.05);
}

.strip-item .overlay-more {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    text-align: center;
    padding: 8px;
    line-height: 1.4;
    pointer-events: none;
}

/* ===== Filter & Sort ===== */
#filterStars .btn {
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    background: #fff;
    border: 2px solid #e0e0e0;
    color: #666;
    transition: all 0.2s;
}

#filterStars .btn.active {
    background: #0d6efd;
    color: #fff;
    border-color: #0d6efd;
    box-shadow: 0 2px 6px rgba(13, 110, 253, 0.25);
}

.btn-sort {
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #ffffff;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.8rem;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    transition: all 0.2s ease;
}

.btn-sort:hover {
    background: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0,0,0,.12);
}

.btn-sort .label {
    color: #6b7280;
    font-weight: 500;
}

.btn-sort .value {
    color: #111827;
    font-weight: 600;
}

/* ===== Pagination ===== */
#ratingPager.pagination {
    gap: 6px;
}

#ratingPager .page-item .page-link {
    border: none;
    border-radius: 999px;
    padding: 8px 14px;
    min-width: 38px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    transition: transform 0.08s ease, box-shadow 0.12s ease;
}

#ratingPager .page-item .page-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0,0,0,.12);
    background-color: #f8fafc;
}

#ratingPager .page-item.active .page-link {
    background: #0d6efd;
    color: #fff;
    box-shadow: 0 8px 18px rgba(13,110,253,.3);
}

#ratingPager .page-item.disabled .page-link {
    opacity: 0.45;
    box-shadow: none;
    cursor: default;
}

/* ===== Image Uploader ===== */
.uploader {
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    padding: 16px;
    background: #fafafa;
    transition: background 0.2s;
}

.uploader.is-dragover {
    background: #f1f3f5;
    border-color: #0d6efd;
}

.thumb-grid {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.thumb {
    position: relative;
    width: 84px;
    height: 84px;
    border-radius: 12px;
    overflow: hidden;
    background: #e9ecef;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.thumb .remove {
    position: absolute;
    top: 6px;
    right: 6px;
    border: none;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.7);
    color: #fff;
    cursor: pointer;
    transition: background 0.2s;
}

.thumb .remove:hover {
    background: rgba(0,0,0,0.9);
}

/* ===== Modal Styles ===== */
.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: var(--rating-shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--rating-border);
}

.modal-title {
    font-weight: 700;
    color: var(--rating-text-primary);
}

/* ===== Gallery Grid ===== */
.gallery-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fill, 180px);
    justify-content: center;
    grid-auto-rows: 230px;
    min-height: 260px;
}

.gallery-card {
    width: 180px;
    height: 230px;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 14px rgba(16,24,40,.06);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.gallery-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(16,24,40,.12);
}

.gallery-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.gallery-meta {
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
}

.gallery-stars {
    font-size: 16px;
    color: var(--rating-warning);
    letter-spacing: 1px;
    line-height: 1;
    font-weight: 600;
}

/* ===== Chips/Filters ===== */
.chip {
    border-radius: 999px;
    padding: 6px 12px;
    font-weight: 600;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #111827;
    transition: all 0.15s ease;
    cursor: pointer;
}

.chip:hover {
    transform: translateY(-1px);
}

.chip.active {
    background: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
    box-shadow: 0 6px 16px rgba(13,110,253,.25);
}

.chip .fa-star {
    color: var(--rating-warning) !important;
    margin-left: 4px;
}

/* ===== Empty State ===== */
.gallery-grid .empty {
    grid-column: 1 / -1;
    align-self: center;
    justify-self: center;
    text-align: center;
    color: #6b7280;
    font-weight: 600;
    padding: 18px 22px;
    border: 1px dashed #e5e7eb;
    border-radius: 12px;
}

