/**
 * Rating System Styles
 * Version: 1.0.0
 */

/* ===== RATING CONTAINER ===== */
#rating-system-container {
    margin: 20px 0;
}

/* ===== RATING HEADER ===== */
.rating-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.rating-header h4 {
    margin: 0;
    font-weight: 700;
    font-size: 1.3em;
    color: #007bff; /* Light theme default */
    margin-bottom: 10px;
    line-height: 1.35;
}

.rating-header .refresh-btn {
    background: none;
    border: 1px solid #ddd;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.rating-header .refresh-btn:hover {
    background: #f5f5f5;
    border-color: #bbb;
}

.rating-header .refresh-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Dark theme header */
.rating-header.dark {
    border-bottom-color: #444;
}

.rating-header.dark h4 {
    color: #ff6b6b; /* Dark theme - red/orange color */
}

.rating-header.dark .refresh-btn {
    border-color: #555;
    color: #fff;
}

.rating-header.dark .refresh-btn:hover {
    background: #333;
    border-color: #777;
}

/* ===== RATING USER INFO ===== */
.rating-user-info {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #dee2e6;
}

.rating-user-info .user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    margin-right: 12px;
}

.rating-user-info .user-info-left {
    display: flex;
    align-items: center;
}

.rating-user-info .user-name {
    color: #333;
    font-weight: 600;
    display: block;
}

.rating-user-info .user-email {
    color: #6c757d;
    font-size: 0.9em;
}

.rating-user-info .btn-edit-name,
.rating-user-info .btn-logout {
    background: #fff;
    color: #333;
    border: 1px solid #dee2e6;
    padding: 5px 12px;
    margin-left: 8px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.85em;
    transition: all 0.3s;
}

.rating-user-info .btn-edit-name:hover {
    background: #e9ecef;
}

.rating-user-info .btn-logout:hover {
    background: #dc3545;
    color: #fff;
    border-color: #dc3545;
}

/* Dark theme user info */
.rating-form.dark + .rating-user-info,
.rating-section.dark .rating-user-info {
    background: #252525;
    border-color: #444;
}

.rating-form.dark + .rating-user-info .user-name,
.rating-section.dark .rating-user-info .user-name {
    color: #fff;
}

.rating-form.dark + .rating-user-info .user-email,
.rating-section.dark .rating-user-info .user-email {
    color: #999;
}

.rating-form.dark + .rating-user-info .btn-edit-name,
.rating-form.dark + .rating-user-info .btn-logout,
.rating-section.dark .rating-user-info .btn-edit-name,
.rating-section.dark .rating-user-info .btn-logout {
    background: #333;
    color: #fff;
    border-color: #444;
}

.rating-form.dark + .rating-user-info .btn-edit-name:hover,
.rating-section.dark .rating-user-info .btn-edit-name:hover {
    background: #444;
}

.rating-form.dark + .rating-user-info .btn-logout:hover,
.rating-section.dark .rating-user-info .btn-logout:hover {
    background: #d32f2f;
}

/* ===== TABBED INTERFACE ===== */
.comment-rating-tabs {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 20px;
}

.comment-rating-tabs.dark {
    border-bottom-color: #444;
}

.tab-button {
    flex: 1;
    padding: 12px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
    color: #666;
    border-bottom: 3px solid transparent;
}

.tab-button:hover {
    color: #333;
    background: #f5f5f5;
}

.tab-button.active {
    color: #007bff;
    border-bottom-color: #007bff;
    background: #f8f9fa;
}

/* Dark theme tabs */
.comment-rating-tabs.dark .tab-button {
    color: #ccc;
}

.comment-rating-tabs.dark .tab-button:hover {
    color: #fff;
    background: #333;
}

.comment-rating-tabs.dark .tab-button.active {
    color: #ff6b6b;
    border-bottom-color: #ff6b6b;
    background: #2a2a2a;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ===== PROFILE HEADER RATING ===== */
#profile-rating-summary {
    margin: 10px 0;
    text-align: center;
}

.rating-summary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f8f9fa;
    border-radius: 20px;
    border: 1px solid #dee2e6;
}

.rating-summary .rating-stars {
    color: #ffc107;
    font-size: 16px;
}

.rating-summary .rating-text {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

/* ===== STAR RATING INPUT ===== */
.star-rating {
    display: flex;
    gap: 8px;
    margin: 20px 0;
    justify-content: center;
    align-items: center;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
    border: 2px solid #dee2e6;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.star-rating:hover {
    border-color: #ffc107;
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.15);
}

.star-rating input[type="radio"] {
    display: none;
}

.star-rating label {
    font-size: 32px;
    color: #e0e0e0;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 8px;
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    min-height: 48px;
}

.star-rating label i {
    font-size: inherit;
    transition: all 0.3s ease;
    display: block;
}

/* Hover effects - Chỉ thay đổi màu sắc và scale nhẹ */
.star-rating label:hover {
    color: #ffc107;
    transform: scale(1.1);
}

.star-rating label.hover {
    color: #ffc107;
    transform: scale(1.05);
}

.star-rating label:hover i,
.star-rating label.hover i {
    color: #ffc107;
    text-shadow: 0 0 6px rgba(255, 193, 7, 0.4);
}

/* Selected state - Chỉ thay đổi màu sắc icon, không có background/border */
.star-rating label.selected,
.star-rating input[type="radio"]:checked + label {
    color: #ff9800;
    /* Loại bỏ background, border, box-shadow, transform */
}

.star-rating label.selected i,
.star-rating input[type="radio"]:checked + label i {
    color: #ff9800;
    text-shadow: 0 0 8px rgba(255, 152, 0, 0.3);
}

/* Active animation */
.star-rating label:active {
    transform: scale(0.95);
}

/* Pulse animation for star selection */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); box-shadow: 0 0 20px rgba(255, 152, 0, 0.6); }
    100% { transform: scale(1); }
}

/* Smooth transitions for all star states */
.star-rating label {
    will-change: transform, color, background, box-shadow;
}

/* Rating feedback text */
.rating-feedback {
    text-align: center;
    margin: 15px 0;
    min-height: 24px;
    transition: all 0.3s ease;
}

.rating-feedback-text {
    font-size: 16px;
    font-weight: 600;
    color: #666;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.rating-feedback-text.show {
    opacity: 1;
    transform: translateY(0);
}

.rating-feedback-text.rating-1 { color: #f44336; }
.rating-feedback-text.rating-2 { color: #ff9800; }
.rating-feedback-text.rating-3 { color: #ffc107; }
.rating-feedback-text.rating-4 { color: #4caf50; }
.rating-feedback-text.rating-5 { color: #2196f3; }

/* Rating counter */
.rating-counter {
    text-align: center;
    margin: 10px 0;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.rating-counter .current-rating {
    color: #ff9800;
    font-weight: 700;
    font-size: 16px;
}

/* ===== RATING FORM & STATS CONTAINER ===== */
.rating-form-stats-container {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 30px;
    border: 2px solid #e9ecef;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.rating-form-stats-container.dark {
    background: linear-gradient(135deg, #2a2a2a 0%, #1e1e1e 100%);
    border-color: #495057;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.rating-form-section {
    display: flex;
    flex-direction: column;
}

.rating-breakdown-section {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.rating-breakdown-header {
    margin-bottom: 20px;
    text-align: center;
}

.rating-breakdown-header h4 {
    color: #2c3e50;
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 5px 0;
    line-height: 1.3;
}

.rating-breakdown-header small {
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
}

.rating-form-stats-container.dark .rating-breakdown-header h4 {
    color: #ecf0f1;
}

.rating-form-stats-container.dark .rating-breakdown-header small {
    color: #adb5bd;
}

/* No ratings yet message */
.no-ratings-yet {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
    border: 2px dashed #dee2e6;
}

.no-ratings-yet.dark {
    color: #adb5bd;
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
    border-color: #495057;
}

.no-ratings-yet i {
    font-size: 2.5em;
    margin-bottom: 15px;
    color: #ffc107;
    opacity: 0.7;
}

.no-ratings-yet p {
    font-size: 18px;
    font-weight: 600;
    margin: 10px 0 5px 0;
}

.no-ratings-yet small {
    font-size: 14px;
    opacity: 0.8;
}

/* ===== RATING FORM ===== */
.rating-form {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 30px;
    border: 2px solid #e9ecef;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Rating form inside container - remove duplicate styling */
.rating-form-stats-container .rating-form {
    background: transparent;
    padding: 0;
    border-radius: 0;
    margin-bottom: 0;
    border: none;
    box-shadow: none;
    overflow: visible;
}

.rating-form-stats-container .rating-form::before {
    display: none;
}

.rating-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ff9800, #ffc107, #4caf50, #2196f3);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.rating-form:hover::before {
    opacity: 1;
}

.rating-form.dark {
    background: linear-gradient(135deg, #2a2a2a 0%, #1e1e1e 100%);
    border-color: #444;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.rating-form .form-group {
    margin-bottom: 25px;
}

.rating-form .form-group:last-child {
    margin-bottom: 0;
}

.rating-form label {
    display: block;
    margin-bottom: 12px;
    font-weight: 700;
    color: #2c3e50;
    font-size: 16px;
    letter-spacing: 0.5px;
}

.rating-form.dark label {
    color: #ecf0f1;
}

.rating-form textarea {
    width: 100%;
    min-height: 120px;
    padding: 16px 20px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    resize: vertical;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    background: #ffffff;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.rating-form textarea::placeholder {
    color: #adb5bd;
    font-style: italic;
}

.rating-form.dark textarea {
    background: #1a1a1a;
    border-color: #495057;
    color: #f8f9fa;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.rating-form.dark textarea::placeholder {
    color: #6c757d;
}

.rating-form textarea:focus {
    outline: none;
    border-color: #ff9800;
    box-shadow: 0 0 0 4px rgba(255, 152, 0, 0.15), 0 4px 16px rgba(255, 152, 0, 0.1);
    transform: translateY(-2px);
}

.rating-form.dark textarea:focus {
    border-color: #ffc107;
    box-shadow: 0 0 0 4px rgba(255, 193, 7, 0.15), 0 4px 16px rgba(255, 193, 7, 0.1);
}

.rating-form .form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.rating-form.dark .form-footer {
    border-top-color: #495057;
}

.rating-form .char-count {
    color: #6c757d;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

.rating-form .char-count::before {
    content: '✏️';
    font-size: 14px;
}

.rating-form.dark .char-count {
    color: #adb5bd;
}

.rating-form button[type="submit"] {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: #ffffff;
    border: none;
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(255, 152, 0, 0.3);
    position: relative;
    overflow: hidden;
    min-width: 140px;
}

.rating-form button[type="submit"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.rating-form button[type="submit"]:hover {
    background: linear-gradient(135deg, #f57c00 0%, #e65100 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(255, 152, 0, 0.4);
}

.rating-form button[type="submit"]:hover::before {
    left: 100%;
}

.rating-form button[type="submit"]:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.3);
}

.rating-form button[type="submit"]:disabled {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.6;
}

.rating-form.dark button[type="submit"] {
    background: linear-gradient(135deg, #ffc107 0%, #ff8f00 100%);
    box-shadow: 0 4px 16px rgba(255, 193, 7, 0.3);
}

.rating-form.dark button[type="submit"]:hover {
    background: linear-gradient(135deg, #ff8f00 0%, #ff6f00 100%);
    box-shadow: 0 6px 24px rgba(255, 193, 7, 0.4);
}

/* Loading states */
.rating-form.loading {
    pointer-events: none;
    opacity: 0.8;
    position: relative;
}

.rating-form.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(2px);
    border-radius: inherit;
    z-index: 10;
}

.rating-form button[type="submit"].loading {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%) !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

.rating-form button[type="submit"].loading:hover {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%) !important;
    transform: none !important;
}

/* Success animation */
@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); box-shadow: 0 0 20px rgba(76, 175, 80, 0.6); }
    100% { transform: scale(1); }
}

.rating-form.success {
    animation: successPulse 0.6s ease-in-out;
    border-color: #4caf50;
}

/* ===== RATING ITEMS ===== */
.rating-item {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 20px;
    display: flex;
    border: 2px solid #e9ecef;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.rating-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ff9800, #ffc107, #4caf50);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.rating-item:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
    border-color: #ff9800;
}

.rating-item:hover::before {
    opacity: 1;
}

.rating-item.dark {
    background: linear-gradient(135deg, #2a2a2a 0%, #1e1e1e 100%);
    border-color: #495057;
}

.rating-item.dark:hover {
    border-color: #ffc107;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.rating-item.dark:hover {
    box-shadow: 0 2px 8px rgba(255,255,255,0.1);
}

.rating-avatar {
    margin-right: 16px;
    flex-shrink: 0;
}

.rating-avatar img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.rating-item:hover .rating-avatar img {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.rating-item.dark .rating-avatar img {
    border-color: #495057;
}

.rating-content {
    flex: 1;
    min-width: 0; /* Prevent flex item overflow */
}

.rating-header {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start;
    gap: 12px;
    margin-bottom: 12px;
}

.rating-header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rating-header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.rating-author {
    color: #2c3e50;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
}

.rating-item.dark .rating-author {
    color: #ecf0f1;
}

.rating-stars {
    color: #ff9800;
    font-size: 16px;
    text-shadow: 0 1px 2px rgba(255, 152, 0, 0.3);
}

.rating-item.dark .rating-stars {
    color: #ffc107;
    text-shadow: 0 1px 2px rgba(255, 193, 7, 0.3);
}

.rating-time {
    color: #6c757d;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.rating-item.dark .rating-time {
    color: #adb5bd;
}

.rating-updated {
    color: #28a745;
    font-size: 12px;
    font-style: italic;
    font-weight: 600;
}

.rating-item.dark .rating-updated {
    color: #4caf50;
}

.rating-comment {
    color: #495057;
    line-height: 1.7;
    margin-top: 12px;
    font-size: 15px;
    word-wrap: break-word;
    hyphens: auto;
}

.rating-item.dark .rating-comment {
    color: #dee2e6;
}

/* ===== RATING STATS ===== */
.rating-stats {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 30px;
    border-radius: 16px;
    margin-bottom: 30px;
    border: 2px solid #e9ecef;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

/* Rating stats inside container - remove duplicate styling */
.rating-form-stats-container .rating-stats {
    background: transparent;
    padding: 0;
    border-radius: 0;
    margin-bottom: 0;
    border: none;
    box-shadow: none;
}

.rating-stats.dark {
    background: linear-gradient(135deg, #2a2a2a 0%, #1e1e1e 100%);
    border-color: #444;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.rating-overview {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 40px;
    align-items: start;
}

.rating-average {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border-radius: 16px;
    border: 2px solid #ff9800;
    box-shadow: 0 4px 16px rgba(255, 152, 0, 0.15);
}

.rating-stats.dark .rating-average {
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
    border-color: #ffc107;
    box-shadow: 0 4px 16px rgba(255, 193, 7, 0.15);
}

.rating-average .average-number {
    font-size: 3.5em;
    font-weight: 800;
    color: #ff9800;
    line-height: 1;
    text-shadow: 0 2px 4px rgba(255, 152, 0, 0.3);
}

.rating-stats.dark .average-number {
    color: #ffc107;
    text-shadow: 0 2px 4px rgba(255, 193, 7, 0.3);
}

.rating-average .average-stars {
    color: #ff9800;
    font-size: 20px;
    margin: 10px 0;
    text-shadow: 0 1px 2px rgba(255, 152, 0, 0.3);
}

.rating-stats.dark .average-stars {
    color: #ffc107;
    text-shadow: 0 1px 2px rgba(255, 193, 7, 0.3);
}

.rating-average .total-count {
    color: #666;
    font-size: 15px;
    font-weight: 600;
    margin-top: 8px;
}

.rating-stats.dark .total-count {
    color: #adb5bd;
}

.rating-breakdown {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 25px;
    border-radius: 16px;
    border: 2px solid #dee2e6;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.rating-breakdown.dark {
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
    border-color: #495057;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* Remove duplicate styling when inside container */
.rating-form-stats-container .rating-breakdown {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 25px;
    border-radius: 16px;
    border: 2px solid #dee2e6;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.rating-form-stats-container.dark .rating-breakdown {
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
    border-color: #495057;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.rating-bar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding: 8px 0;
}

.rating-bar:last-child {
    margin-bottom: 0;
}

.rating-bar-label {
    font-size: 14px;
    color: #495057;
    min-width: 40px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.rating-stats.dark .rating-bar-label {
    color: #f8f9fa;
}

.rating-bar-container {
    height: 12px;
    background: #e9ecef;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.rating-stats.dark .rating-bar-container {
    background: #495057;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.rating-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff9800 0%, #ffc107 100%);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 6px;
    position: relative;
}

.rating-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.rating-count {
    font-size: 13px;
    color: #6c757d;
    min-width: 35px;
    text-align: right;
    font-weight: 600;
    background: #ffffff;
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.rating-stats.dark .rating-count {
    color: #adb5bd;
    background: #343a40;
    border-color: #495057;
}

/* ===== LOADING & EMPTY STATES ===== */
.rating-loading,
.rating-empty,
.rating-error {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.rating-loading.dark,
.rating-empty.dark,
.rating-error.dark {
    color: #999;
}

.rating-loading i,
.rating-empty i,
.rating-error i {
    font-size: 2em;
    margin-bottom: 15px;
    display: block;
}

.rating-error {
    color: #dc3545;
}

.rating-error.dark {
    color: #ff6b6b;
}

/* ===== TOAST NOTIFICATIONS ===== */
.rating-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateX(100%);
    transition: transform 0.3s;
    max-width: 300px;
}

.rating-toast.show {
    transform: translateX(0);
}

.rating-toast-success {
    border-left: 4px solid #28a745;
    color: #155724;
}

.rating-toast-error {
    border-left: 4px solid #dc3545;
    color: #721c24;
}

.rating-toast-info {
    border-left: 4px solid #17a2b8;
    color: #0c5460;
}

/* ===== RATE LIMIT INFO ===== */
#rating-rate-limit-info {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 10px 15px;
    border-radius: 5px;
    margin: 10px 0;
    display: none;
    text-align: center;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    #rating-system-container {
        margin: 15px 0;
    }

    .rating-form {
        padding: 20px;
        border-radius: 16px;
        margin-bottom: 20px;
    }

    .star-rating {
        gap: 6px;
        padding: 12px;
        margin: 15px 0;
    }

    .star-rating label {
        font-size: 28px;
        min-width: 40px;
        min-height: 40px;
        padding: 6px;
    }

    .rating-feedback-text {
        font-size: 14px;
    }

    .rating-form button[type="submit"] {
        padding: 12px 24px;
        font-size: 14px;
        min-width: 120px;
    }

    .rating-form .form-footer {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .rating-form .char-count {
        text-align: center;
        order: 2;
    }

    .rating-form button[type="submit"] {
        order: 1;
        width: 100%;
    }

    .rating-form-stats-container {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 20px;
    }

    .rating-breakdown-section {
        order: 1;
    }

    .rating-form-section {
        order: 2;
    }

    .rating-overview {
        grid-template-columns: 1fr;
        gap: 25px;
        text-align: center;
    }

    .rating-breakdown {
        order: 2;
    }

    .rating-average {
        order: 1;
    }

    .rating-header {
        grid-template-columns: 1fr;
        gap: 8px;
        text-align: left;
    }

    .rating-header-right {
        align-items: flex-start;
    }

    .rating-avatar img {
        width: 44px;
        height: 44px;
    }

    .rating-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .rating-time {
        margin-left: 0;
    }

    .rating-item {
        padding: 20px;
        margin-bottom: 16px;
        border-radius: 12px;
    }

    .rating-toast {
        right: 10px;
        left: 10px;
        max-width: none;
        border-radius: 12px;
    }

    .tab-button {
        font-size: 14px;
        padding: 10px 15px;
    }

    .comment-rating-tabs {
        margin-bottom: 15px;
    }

    .rating-header h4 {
        font-size: 1.25rem;
    }

    .rating-user-info {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .rating-user-info .user-info-right {
        margin-top: 10px;
        width: 100%;
    }

    .rating-user-info .user-info-right .btn {
        display: block;
        width: 100%;
        margin: 5px 0 !important;
    }
}

@media (max-width: 480px) {
    .star-rating {
        gap: 4px;
        padding: 10px;
    }

    .star-rating label {
        font-size: 24px;
        min-width: 36px;
        min-height: 36px;
        padding: 4px;
    }

    .rating-form-stats-container {
        padding: 16px;
        gap: 20px;
    }

    .rating-form {
        padding: 16px;
    }

    .rating-form textarea {
        min-height: 100px;
        padding: 12px 16px;
        font-size: 14px;
    }

    .rating-item {
        padding: 16px;
    }

    .rating-avatar img {
        width: 40px;
        height: 40px;
    }

    .rating-author {
        font-size: 15px;
    }

    .rating-comment {
        font-size: 14px;
    }

    .rating-breakdown {
        padding: 16px;
    }

    .rating-average {
        padding: 16px;
    }

    .rating-average .average-number {
        font-size: 3em;
    }

    .tab-button {
        font-size: 13px;
        padding: 8px 12px;
    }
}
