/* Comments Area */
.comments-area {
    margin-top: 30px;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.comments-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

/* Comment List */
.comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comment-list > li:not(:first-child) {
    border-top: 1px dashed #ddd;
    padding-top: 1em;
}

/* Comment Reply */
.comment-list .children {
    list-style: none;
    padding: 0;
    margin: 0 0 0 40px;
}

.comment-list .children .comment {
    padding-left: 20px;
    margin-top: 20px;
}

.comment-list .children .comment:last-child {
    margin-bottom: 0;
}

/* Comment Body */
.comment-body {
    display: flex;
    gap: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 15px;
}

.comment-left {
    width: 25%;
    padding-right: 15px;
    border-right: 1px solid #dee2e6;
}

.comment-content {
    width: 75%;
    padding-left: 15px;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

/* Comment Author */
.comment-header {
    display: flex !important;
    align-items: flex-start !important;
    gap: 15px !important;
    margin-bottom: 15px !important;
}

.comment-author-info {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
}

.comment-author-name {
    font-weight: 600 !important;
    color: #333 !important;
}

.comment-meta-time {
    font-size: 0.9em !important;
    color: #666 !important;
}

/* Rating Display */
.overall-rating {
    text-align: center;
    margin-bottom: 20px;
}

.overall-rating .score-container {
    display: inline-flex;
    align-items: baseline;
    gap: 2px;
}

.overall-rating .score {
    font-size: 2.5em;
    font-weight: bold;
    color: #007bff;
    line-height: 1;
}

.overall-rating .max-score {
    font-size: 0.4em;
    color: #666;
}

.overall-rating .rating-label {
    margin-top: 5px;
    color: #666;
    font-size: 14px;
}

.rating-container {
    flex-direction: row;
    gap: 15px;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 0;
}

.comment-ratings {
    margin-top: 10px;
    padding: 10px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.comment-ratings .rating-score {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.comment-ratings .score-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border-radius: 4px;
}

.comment-ratings .score {
    font-size: 24px;
    font-weight: bold;
    color: #007bff;
}

.comment-ratings .max-score {
    font-size: 16px;
    color: #666;
    margin-left: 2px;
}

.comment-ratings .rating-label {
    display: none;
}

.comment-ratings .rating-details {
    margin-top: 10px;
}

.comment-ratings .rating-item {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
}

.comment-ratings .rating-item label {
    width: 80px;
    font-size: 14px;
    color: #666;
}

.comment-ratings .progress-bar-container {
    flex: 1;
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    margin: 0 10px;
    overflow: hidden;
}

.comment-ratings .progress-bar {
    height: 100%;
    background: #28a745;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.comment-ratings .rating-value {
    font-size: 14px;
    color: #666;
    min-width: 40px;
}

/* Rating Form */
.rating-criteria {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.rating-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.rating-item:last-child {
    margin-bottom: 0;
}

.rating-item label {
    min-width: 80px;
    font-weight: 500;
    color: #333;
}

.progress-bar-container {
    position: relative;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: visible;
    flex: 1;
}

.progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #28a745;
    border-radius: 4px;
    transition: width 0.3s ease;
    z-index: 1;
}

.rating-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: transparent;
    outline: none;
    opacity: 1;
    cursor: pointer;
    margin: 0;
    padding: 0;
    position: relative;
    z-index: 2;
}

.rating-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
    margin-top: -6px;
}

.rating-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
}

.rating-slider::-webkit-slider-thumb:hover {
    background: #0056b3;
    transform: scale(1.1);
}

.rating-slider::-moz-range-thumb:hover {
    background: #0056b3;
    transform: scale(1.1);
}

.rating-value {
    min-width: 45px;
    text-align: right;
    color: #666;
    font-size: 0.9em;
}

/* Comment Form */
.comment-respond {
    background-color: rgba(0,0,0,.05);
    margin-top: 15px;
    padding: 20px;
    border-radius: 8px;
}

.comment-reply-title {
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.comment-reply-title small {
    font-size: .6em;
    margin-left: 10px;
    text-transform: uppercase;
}

.comment-form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.comment-form > div,
.comment-form > p {
    width: 100%;
    margin: 0;
}

.comment-form-row {
    display: flex;
    gap: 30px;
    width: 100%;
}

.comment-form p.comment-form-author,
.comment-form p.comment-form-email {
    flex: 1;
    min-width: 0;
    max-width: calc(50% - 15px);
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 0.4rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.comment-form textarea {
    min-height: 80px;
    resize: vertical;
}

.comment-form label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 500;
}

.comment-form .required {
    color: #e74c3c;
}

.comment-form .submit {
    background: #0073aa;
    color: #fff;
    padding: 5px;
    border-radius: 8px;
}

.comment-form .submit input[type="submit"] {
    background: #0073aa;
    color: white;
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.comment-form .submit input[type="submit"]:hover {
    background: #fff;
}

/* Overall Rating Summary */
.overall-rating-summary {
    background: #fff;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    padding: 20px;
}

.overall-rating-summary .rating-overview {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-right: 20px;
}

.overall-rating-summary .rating-score {
    text-align: center;
    font-size: 3em;
    font-weight: bold;
    color: #007bff;
    line-height: 1;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.overall-rating-summary .rating-score .score-container {
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.overall-rating-summary .rating-score .score {
    font-size: 1.2em;
}

.overall-rating-summary .rating-score .max-score {
    font-size: 0.4em;
    color: #666;
}

.overall-rating-summary .rating-label {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin-top: 5px;
}

.overall-rating-summary .rating-details {
    flex: 1.5;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-left: 0;
}

.overall-rating-summary .rating-item {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 620px;
}

.overall-rating-summary .rating-item label {
    min-width: 70px;
    font-weight: 500;
    color: #333;
}

.overall-rating-summary .progress-bar-container {
    flex: 1;
    min-width: 80px;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.overall-rating-summary .progress-bar {
    height: 100%;
    background: #28a745;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.overall-rating-summary .rating-value {
    min-width: 40px;
    text-align: right;
    color: #666;
    font-size: 0.9em;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .comment-body {
        flex-direction: column;
    }

    .comment-left {
        width: 100%;
        padding-right: 0;
        padding-bottom: 15px;
        border-right: none;
        border-bottom: 1px solid #dee2e6;
    }

    .comment-content {
        width: 100%;
        padding-left: 0;
        padding-top: 0;
    }

    .rating-container {
        flex-direction: row;
        align-items: flex-start;
        gap: 15px;
        background: #fff;
        border-radius: 8px;
        margin-bottom: 0;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    .overall-rating {
        margin-bottom: 0;
        padding: 10px;
        flex: 1.2;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding-right: 20px;
        border-right: 1px solid #dee2e6;
        border-bottom: none;
    }

    .comment-ratings {
        margin-top: 0;
        padding: 10px;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .rating-score {
        flex: 0 0 auto !important;
        min-width: 80px !important;
        text-align: center !important;
        border-right: 1px solid #dee2e6 !important;
        padding-right: 15px !important;
    }

    .rating-details {
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 4px !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .rating-item {
        display: flex !important;
        align-items: center !important;
        gap: 4px !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .rating-item label {
        min-width: 40px !important;
        font-size: 0.8em !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .progress-bar-container {
        flex: 1 !important;
        min-width: 50px !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .rating-value {
        min-width: 25px !important;
        font-size: 0.8em !important;
        text-align: right !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .comment-form-row {
        flex-direction: column;
        gap: 15px;
    }

    .comment-form p.comment-form-author,
    .comment-form p.comment-form-email {
        max-width: 100%;
    }

    .overall-rating-summary {
        flex-direction: row;
        padding: 20px;
    }

    .overall-rating-summary .rating-overview {
        padding-right: 20px;
        padding-bottom: 0;
        border-bottom: none;
        flex: 0.8;
    }

    .overall-rating-summary .rating-details {
        flex: 1.2;
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding-left: 0;
    }

    .overall-rating-summary .rating-item {
        margin-bottom: 0;
        max-width: 180px;
    }

    .overall-rating-summary .rating-item label {
        min-width: 50px;
        font-size: 0.9em;
    }
    
    .overall-rating-summary .progress-bar-container {
        min-width: 60px;
    }
    
    .overall-rating-summary .rating-value {
        min-width: 35px;
        font-size: 0.85em;
    }

    .comment-body .rating-score {
        font-size: 2em;
        font-weight: bold;
        color: #007bff;
        line-height: 1;
        padding: 0;
        justify-items: center;
        border-right: 1px solid #dee2e6;
        margin: 0;
    }
}

/* Pagination for Comments */
.comment-navigation {
    margin: 15px 0;
    text-align: center;
}

.comment-navigation .nav-links {
    display: flex;
    justify-content: center;
    gap: 5px;
}

.comment-navigation .page-numbers {
    display: inline-block;
    padding: 5px 8px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 3px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 13px;
}

.comment-navigation .page-numbers:hover {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.comment-navigation .page-numbers.current {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.comment-navigation .prev,
.comment-navigation .next {
    padding: 5px 10px;
    font-size: 13px;
}

@media (max-width: 768px) {
    .comment-navigation .nav-links {
        flex-wrap: wrap;
    }
    
    .comment-navigation .page-numbers {
        padding: 4px 8px;
        font-size: 12px;
    }
}

/* Style cho thông báo yêu cầu đăng nhập */
.must-log-in {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
    color: #495057;
    font-size: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.must-log-in a {
    color: #0073aa;
    text-decoration: none;
    font-weight: 500;
}

.must-log-in a:hover {
    color: #005177;
    text-decoration: underline;
}