.td-course-comments-widget {
    margin-bottom: 25px;
}

.td-comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 16px;
    direction: rtl;
}

.td-comments-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
}

.td-comments-title i,
.td-comments-title svg,
.td-comments-title .elementor-icon {
    margin-left: 8px;
    display: inline-block;
    flex-shrink: 0;
}

.elementor-widget-td_course_comments .td-comments-title i,
.elementor-widget-td_course_comments .td-comments-title svg,
.elementor-widget-td_course_comments .td-comments-title .elementor-icon {
    vertical-align: middle;
}

.td-average-rating {
    display: flex;
    align-items: center;
    gap: 10px;
}


.td-comment-item {
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 10px;
    border-left: 4px solid;
}

.td-comment-item .td-comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    border: none;
    padding: 0;
}

.td-comment-author {
    font-weight: 600;
}

.td-comment-date {
    font-size: 0.9rem;
}

.td-comment-rating {
    margin-bottom: 10px;
}

.td-comment-rating .fa-star {
    margin-right: 2px;
}

.td-comment-text {
    line-height: 1.6;
}

.td-comment-form-container {
    margin-top: 15px;
    display: none;
}

.td-course-comments-widget--editor-preview .td-comment-form-container {
    display: block;
}

.td-comment-form-title-wrap {
    margin-bottom: 20px;
    padding-bottom: 15px;
   
}

.td-comment-form-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.td-comment-form-badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 16px;
    line-height: 1.2;
}

.td-comment-form-field {
    margin-bottom: 20px;
}

.td-star-rating {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
    font-size: 24px;
    cursor: pointer;
}

.td-star-rating .td-star {
    margin-left: 4px;
    cursor: pointer;
    transition: transform 0.2s ease, color 0.2s ease;
}

.td-star-rating .td-star:hover {
    transform: scale(1.2);
}

.td-comment-form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.td-comment-form .form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
}

.td-comment-form .form-control {
    width: 100%;
    border: 1px solid #e5e8eb;
    border-radius: 8px;
    padding: 12px 16px;
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    color: #333333;
    background-color: #ffffff;
    transition: all 0.3s ease;
}

.td-comment-form .form-control:focus {
    outline: none;
    background-color: #ffffff;
}

.td-comment-form .form-control:-webkit-autofill,
.td-comment-form .form-control:-webkit-autofill:hover,
.td-comment-form .form-control:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset;
    box-shadow: 0 0 0 1000px #ffffff inset;
    -webkit-text-fill-color: #333333;
}

.td-submit-comment-btn,
.td-comment-form .btn-secondary {
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 8px;
}

.td-submit-comment-btn:hover,
.td-comment-form .btn-secondary:hover {
    transform: translateY(-2px);
}

.td-comment-form .mb-3 {
    margin-bottom: 1.5rem;
}

.td-comment-form .d-flex {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.td-comment-form .justify-content-end {
    justify-content: flex-end;
}

.td-no-comments {
    text-align: center;
    color: #666;

}

.td-no-comments p {
    margin: 0;
    font-size: 16px;
    color: #666;
}

.td-auth-message {
    background: #e3f2fd;
    color: #1976d2;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    margin-top: 15px;
}

.td-comments-list {
    transition: max-height 0.5s ease;
}

.td-comments-list.expanded,
.td-comments-container.expanded {
    max-height: none !important;
    min-height: auto !important;
    height: auto !important;
    overflow: visible !important;
}

.td-comments-container--limited {
    overflow: hidden;
    max-height: var(--td-comments-max-height, 400px);
}

.td-show-more-container {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.td-show-more-btn {
    background: transparent;
    border: 2px solid #6c757d;
    color: #6c757d;
    padding: 10px 25px;
    border-radius: 25px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.td-show-more-btn:hover {
    background-color: #f8f9fa;
    transform: translateY(-2px);
}

.td-fade-shadow {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.8), #fff);
    pointer-events: none;
    display: block;
    z-index: 5;
}

.td-comments-container.expanded .td-fade-shadow {
    display: none;
}
