/* 11 Review Photo Frontend Styles */

.cf-review-form-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.cf-product-review {
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.cf-product-info {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.cf-product-info img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 15px;
}

.cf-product-info h4 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.cf-rating-section {
    margin-bottom: 20px;
}

.cf-rating-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.cf-star-rating {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
}

.cf-star {
    font-size: 24px;
    color: #ddd;
    cursor: pointer;
    transition: color 0.2s ease;
    user-select: none;
}

.cf-star:hover,
.cf-star.active {
    color: #ffc107;
}

.cf-star.filled {
    color: #ffc107;
}

.cf-review-text {
    margin-bottom: 20px;
}

.cf-review-text label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.cf-review-text textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    min-height: 100px;
}

.cf-review-text textarea:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

.cf-media-upload {
    margin-bottom: 20px;
}

.cf-media-upload label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.cf-upload-area {
    border: 2px dashed #ddd;
    border-radius: 6px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.3s ease;
    position: relative;
}

.cf-upload-area:hover {
    border-color: #007cba;
}

.cf-upload-area.dragover {
    border-color: #007cba;
    background-color: rgba(0, 124, 186, 0.05);
}

.cf-file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.cf-upload-text p {
    margin: 0 0 5px 0;
    font-size: 16px;
    color: #666;
}

.cf-upload-text small {
    color: #999;
    font-size: 12px;
}

.cf-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.cf-preview-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #ddd;
}

.cf-preview-item img,
.cf-preview-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cf-preview-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cf-submit-btn {
    background: #007cba;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.cf-submit-btn:hover {
    background: #005a87;
}

.cf-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Reviews Display */
.cf-reviews-container {
    margin: 20px 0;
}

.cf-review-item {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
    background: #fff;
}

.cf-review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.cf-reviewer-info {
    display: flex;
    align-items: center;
}

.cf-reviewer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
}

.cf-reviewer-name {
    font-weight: 600;
    color: #333;
}

.cf-review-date {
    color: #999;
    font-size: 12px;
}

.cf-review-rating {
    display: flex;
    gap: 2px;
}

.cf-review-rating .cf-star {
    font-size: 16px;
}

.cf-review-content {
    margin-bottom: 15px;
    line-height: 1.6;
    color: #555;
}

.cf-review-media {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.cf-review-media img,
.cf-review-media video {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.cf-review-media img:hover,
.cf-review-media video:hover {
    transform: scale(1.05);
}

/* Loading States */
.cf-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    /* 第298行 */
    animation: cf-spin 1s linear infinite;
    
    /* 第301行 */
    @keyframes cf-spin {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(360deg); }
    }
}

@keyframes erp-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success/Error Messages */
.cf-message {
    padding: 12px 16px;
    border-radius: 4px;
    margin: 15px 0;
}

.cf-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.cf-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cf-review-form-container {
        padding: 15px;
    }
    
    .cf-product-info {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .cf-product-info img {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .cf-star-rating {
        justify-content: center;
    }
    
    .cf-preview-container {
        justify-content: center;
    }
    
    .cf-review-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* Half-star rating system - single row display */
.cf-star-rating-inline {
    display: flex;
    flex-direction: row;
    gap: 8px;
    margin-bottom: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.cf-star-rating-inline input[type="radio"] {
    display: none;
}

.cf-star-rating-inline .cf-star-label {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.cf-star-rating-inline .cf-star-label:hover {
    border-color: #ffc107;
    background: #fff8e1;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(255, 193, 7, 0.2);
}

.cf-star-rating-inline .cf-star {
    font-size: 16px;
    color: #ddd;
    transition: color 0.3s ease;
}

.cf-star-rating-inline .cf-rating-text {
    color: #666;
    transition: color 0.3s ease;
    font-size: 11px;
}

.cf-star-rating-inline input[type="radio"]:checked + .cf-star-label {
    border-color: #ffc107;
    background: linear-gradient(135deg, #ffc107, #ffb300);
    color: #fff;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
}

.cf-star-rating-inline input[type="radio"]:checked + .cf-star-label .cf-star {
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.cf-star-rating-inline input[type="radio"]:checked + .cf-star-label .cf-rating-text {
    color: #fff;
    font-weight: 600;
}

/* Responsive design for half-star ratings */
@media (max-width: 768px) {
    .cf-star-rating-inline {
        gap: 6px;
    }
    
    .cf-star-rating-inline .cf-star-label {
        padding: 5px 8px;
        font-size: 11px;
    }
    
    .cf-star-rating-inline .cf-star {
        font-size: 14px;
    }
    
    .cf-star-rating-inline .cf-rating-text {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .cf-star-rating-inline {
        gap: 4px;
    }
    
    .cf-star-rating-inline .cf-star-label {
        padding: 4px 6px;
    }
    
    .cf-star-rating-inline .cf-rating-text {
        display: none; /* Hide text on very small screens */
    }
}

/* SVG星级评分样式（前端） */
.cf-star-rating-svg {
    margin: 10px 0;
    user-select: none;
}

.cf-stars-container {
    display: flex;
    gap: 4px;
    align-items: center;
}

.cf-star-item {
    position: relative;
    width: 32px;
    height: 32px;
    cursor: pointer;
}

.cf-star-bg,
.cf-star-fg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.cf-star-fg {
    z-index: 2;
    clip-path: inset(0 100% 0 0); /* 初始状态完全隐藏 */
    transition: clip-path 0.3s ease;
}

.cf-star-bg {
    z-index: 1;
}

.cf-star-click-area {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    z-index: 3;
}

.cf-star-half,
.cf-star-full {
    height: 100%;
    cursor: pointer;
}

.cf-star-half {
    width: 50%;
}

.cf-star-full {
    width: 50%;
}

/* 选中状态 */
.cf-star-item.selected .cf-star-fg {
    clip-path: inset(0 0 0 0); /* 完全显示 */
}

.cf-star-item.half-selected .cf-star-fg {
    clip-path: inset(0 50% 0 0); /* 显示一半 */
}

/* 悬停效果 */
.cf-star-item:hover .cf-star-fg {
    filter: brightness(1.2);
}

.cf-star-item.hover-preview .cf-star-fg {
    filter: brightness(1.1);
}

.cf-rating-display {
    margin-top: 8px;
    font-size: 13px;
    color: #666;
    min-height: 18px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .cf-star-item {
        width: 28px;
        height: 28px;
    }
    
    .cf-stars-container {
        gap: 2px;
    }
}