/* Modern Comments CSS - Enhanced Version */

/* Reset and base styles */
.comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comment-list .comment {
    background: #ffffff;
    border: 1px solid #e1e5e9;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.comment-list .comment::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #007cba, #00a0d2);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.comment-list .comment:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
    border-color: #007cba;
}

.comment-list .comment:hover::before {
    opacity: 1;
}

/* Comment author section */
.comment-author {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    position: relative;
}

/* RTL adjustments to match screenshots */
.rtl .comment-list,
body.rtl .comment-list {
    direction: rtl;
    text-align: right;
}

.rtl .comment-author,
body.rtl .comment-author {
    flex-direction: row-reverse;
}

.rtl .comment-author .avatar,
body.rtl .comment-author .avatar {
    margin-right: 0;
    margin-left: 16px;
}

.rtl .reply,
body.rtl .reply {
    text-align: left;
}

.comment-author .avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    margin-right: 16px;
    border: 3px solid #f8f9fa;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.comment-author .avatar:hover {
    transform: scale(1.05);
}

.comment-author .fn {
    font-weight: 700;
    color: #2c3e50;
    font-size: 18px;
    margin: 0;
    text-decoration: none;
    transition: color 0.3s ease;
}

.comment-author .fn:hover {
    color: #007cba;
}

.comment-metadata {
    margin-left: auto;
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
    background: #f8f9fa;
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid #e9ecef;
}

/* Inline small rating beside author name (orange stars) */
.comment-inline-rating {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-inline-start: 8px;
}
.comment-inline-rating .star {
    font-size: 14px;
    color: #f6a01a; /* orange like screenshot */
    line-height: 1;
}
.rtl .comment-inline-rating,
body.rtl .comment-inline-rating {
    margin-inline-start: 0;
    margin-inline-end: 8px;
}

/* Rating display */
/* Block rating (kept for backward compat, not shown inline) */
.comment-rating-display {
    margin: 12px 0 16px 0;
    font-size: 18px;
    color: #f6a01a;
    letter-spacing: 2px;
}

/* Comment content */
.comment-content {
    color: #495057;
    line-height: 1.7;
    margin: 16px 0;
    font-size: 15px;
    position: relative;
}

.comment-content p {
    margin: 0 0 12px 0;
}

.comment-content p:last-child {
    margin-bottom: 0;
}

/* Reply section */
.reply {
    margin-top: 20px;
    text-align: right;
}

.comment-reply-link {
    background: #e9ecef;
    color: #495057;
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    display: inline-block;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.comment-reply-link:hover {
    background: #dee2e6;
    color: #212529;
}

/* Rating field in comment form */
.comment-rating-field {
    margin: 24px 0;
    padding: 24px;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border-radius: 12px;
    border: 2px solid #e9ecef;
    position: relative;
    overflow: hidden;
}

.comment-rating-field::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #007cba, #00a0d2);
}

.comment-rating-field label {
    display: block;
    margin-bottom: 12px;
    font-weight: 700;
    color: #495057;
    font-size: 16px;
}

/* Star rating system */
.star-rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 4px;
}

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

.star-rating label {
    font-size: 28px;
    color: #ddd;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    position: relative;
}

.star-rating label:hover,
.star-rating label:hover ~ label,
.star-rating input[type="radio"]:checked ~ label {
    color: #ffc107;
    transform: scale(1.1);
}

.star-rating label:hover {
    text-shadow: 0 2px 4px rgba(255, 193, 7, 0.3);
}

/* Comment form styling */
.comment-form {
    background: transparent;
    border: 1px solid #cfd4da;
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
    box-shadow: none;
    position: relative;
}

.comment-form::before { display: none; }

.comment-form-comment textarea {
    width: 100%;
    min-height: 180px; /* larger like screenshot */
    padding: 14px;
    border: 1px solid #cfd4da;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.2s ease;
    background: #ffffff;
    line-height: 1.7;
}

.comment-form-comment textarea:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 4px rgba(0, 124, 186, 0.1);
    background: #ffffff;
}

.comment-form-comment textarea::placeholder {
    color: #adb5bd;
    font-style: italic;
}

/* Form submit button */
.form-submit {
    margin-top: 16px;
    text-align: right;
}

.form-submit input[type="submit"] {
    background: #ff8a00; /* orange button like screenshot */
    color: #fff;
    padding: 10px 18px 10px 44px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease;
    position: relative;
}

.form-submit input[type="submit"]::before {
    content: '\2709'; /* envelope icon */
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    font-size: 16px;
    opacity: .95;
}

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

.form-submit input[type="submit"]:active {
    transform: translateY(0);
}

/* Nested comments (replies) */
.children {
    margin-left: 40px;
    margin-top: 24px;
    position: relative;
}

.children::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, #007cba, transparent);
    opacity: 0.3;
}

.children .comment {
    background: #f8f9fa;
    border-left: 4px solid #007cba;
    position: relative;
}

.rtl .children .comment,
body.rtl .children .comment {
    border-left: 0;
    border-right: 4px solid #007cba;
}

.children .comment::before {
    content: '';
    position: absolute;
    left: -4px;
    top: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid #007cba;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
}

/* Comment form fields */
.comment-form-author,
.comment-form-email,
.comment-form-url {
    margin-bottom: 20px;
}

.comment-form-author input,
.comment-form-email input,
.comment-form-url input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #fafbfc;
}

.comment-form-author input:focus,
.comment-form-email input:focus,
.comment-form-url input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
    background: #ffffff;
}

.comment-form-author label,
.comment-form-email label,
.comment-form-url label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

/* Responsive design */
@media (max-width: 768px) {
    .children {
        margin-left: 20px;
    }
    
    .comment {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .comment-author .avatar {
        width: 48px;
        height: 48px;
    }
    
    .comment-author .fn {
        font-size: 16px;
    }
    
    .comment-form {
        padding: 24px;
    }
    
    .comment-rating-field {
        padding: 20px;
    }
    
    .star-rating label {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .children {
        margin-left: 10px;
    }
    
    .comment {
        padding: 16px;
    }
    
    .comment-author {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .comment-author .avatar {
        margin-right: 0;
        margin-bottom: 12px;
    }
    
    .comment-metadata {
        margin-left: 0;
        margin-top: 8px;
    }
    
    .comment-form {
        padding: 20px;
    }
}

/* Loading animation */
.comment-loading {
    opacity: 0.6;
    pointer-events: none;
}

.comment-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #007cba;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Success message */
.comment-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}

/* Error message */
.comment-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}
/* Modern Comments CSS - Enhanced Version */

/* Reset and base styles */
.comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comment-list .comment {
    background: #ffffff;
    border: 1px solid #e1e5e9;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.comment-list .comment::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #007cba, #00a0d2);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.comment-list .comment:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
    border-color: #007cba;
}

.comment-list .comment:hover::before {
    opacity: 1;
}

/* Comment author section */
.comment-author {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    position: relative;
}

/* RTL adjustments to match screenshots */
.rtl .comment-list,
body.rtl .comment-list {
    direction: rtl;
    text-align: right;
}

.rtl .comment-author,
body.rtl .comment-author {
    flex-direction: row-reverse;
}

.rtl .comment-author .avatar,
body.rtl .comment-author .avatar {
    margin-right: 0;
    margin-left: 16px;
}

.rtl .reply,
body.rtl .reply {
    text-align: left;
}

.comment-author .avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    margin-right: 16px;
    border: 3px solid #f8f9fa;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.comment-author .avatar:hover {
    transform: scale(1.05);
}

.comment-author .fn {
    font-weight: 700;
    color: #2c3e50;
    font-size: 18px;
    margin: 0;
    text-decoration: none;
    transition: color 0.3s ease;
}

.comment-author .fn:hover {
    color: #007cba;
}

.comment-metadata {
    margin-left: auto;
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
    background: #f8f9fa;
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid #e9ecef;
}

/* Inline small rating beside author name (orange stars) */
.comment-inline-rating {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-inline-start: 8px;
}
.comment-inline-rating .star {
    font-size: 14px;
    color: #f6a01a; /* orange like screenshot */
    line-height: 1;
}
.rtl .comment-inline-rating,
body.rtl .comment-inline-rating {
    margin-inline-start: 0;
    margin-inline-end: 8px;
}

/* Rating display */
/* Block rating (kept for backward compat, not shown inline) */
.comment-rating-display {
    margin: 12px 0 16px 0;
    font-size: 18px;
    color: #f6a01a;
    letter-spacing: 2px;
}

/* Comment content */
.comment-content {
    color: #495057;
    line-height: 1.7;
    margin: 16px 0;
    font-size: 15px;
    position: relative;
}

.comment-content p {
    margin: 0 0 12px 0;
}

.comment-content p:last-child {
    margin-bottom: 0;
}

/* Reply section */
.reply {
    margin-top: 20px;
    text-align: right;
}

.comment-reply-link {
    background: #e9ecef;
    color: #495057;
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    display: inline-block;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.comment-reply-link:hover {
    background: #dee2e6;
    color: #212529;
}

/* Rating field in comment form */
.comment-rating-field {
    margin: 24px 0;
    padding: 24px;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border-radius: 12px;
    border: 2px solid #e9ecef;
    position: relative;
    overflow: hidden;
}

.comment-rating-field::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #007cba, #00a0d2);
}

.comment-rating-field label {
    display: block;
    margin-bottom: 12px;
    font-weight: 700;
    color: #495057;
    font-size: 16px;
}

/* Star rating system */
.star-rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 4px;
}

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

.star-rating label {
    font-size: 28px;
    color: #ddd;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    position: relative;
}

.star-rating label:hover,
.star-rating label:hover ~ label,
.star-rating input[type="radio"]:checked ~ label {
    color: #ffc107;
    transform: scale(1.1);
}

.star-rating label:hover {
    text-shadow: 0 2px 4px rgba(255, 193, 7, 0.3);
}

/* Comment form styling */
.comment-form {
    background: transparent;
    border: 1px solid #cfd4da;
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
    box-shadow: none;
    position: relative;
}

.comment-form::before { display: none; }

.comment-form-comment textarea {
    width: 100%;
    min-height: 180px; /* larger like screenshot */
    padding: 14px;
    border: 1px solid #cfd4da;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.2s ease;
    background: #ffffff;
    line-height: 1.7;
}

.comment-form-comment textarea:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 4px rgba(0, 124, 186, 0.1);
    background: #ffffff;
}

.comment-form-comment textarea::placeholder {
    color: #adb5bd;
    font-style: italic;
}

/* Form submit button */
.form-submit {
    margin-top: 16px;
    text-align: right;
}

.form-submit input[type="submit"] {
    background: #ff8a00; /* orange button like screenshot */
    color: #fff;
    padding: 10px 18px 10px 44px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease;
    position: relative;
}

.form-submit input[type="submit"]::before {
    content: '\2709'; /* envelope icon */
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    font-size: 16px;
    opacity: .95;
}

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

.form-submit input[type="submit"]:active {
    transform: translateY(0);
}

/* Nested comments (replies) */
.children {
    margin-left: 40px;
    margin-top: 24px;
    position: relative;
}

.children::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, #007cba, transparent);
    opacity: 0.3;
}

.children .comment {
    background: #f8f9fa;
    border-left: 4px solid #007cba;
    position: relative;
}

.rtl .children .comment,
body.rtl .children .comment {
    border-left: 0;
    border-right: 4px solid #007cba;
}

.children .comment::before {
    content: '';
    position: absolute;
    left: -4px;
    top: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid #007cba;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
}

/* Comment form fields */
.comment-form-author,
.comment-form-email,
.comment-form-url {
    margin-bottom: 20px;
}

.comment-form-author input,
.comment-form-email input,
.comment-form-url input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #fafbfc;
}

.comment-form-author input:focus,
.comment-form-email input:focus,
.comment-form-url input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
    background: #ffffff;
}

.comment-form-author label,
.comment-form-email label,
.comment-form-url label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

/* Responsive design */
@media (max-width: 768px) {
    .children {
        margin-left: 20px;
    }
    
    .comment {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .comment-author .avatar {
        width: 48px;
        height: 48px;
    }
    
    .comment-author .fn {
        font-size: 16px;
    }
    
    .comment-form {
        padding: 24px;
    }
    
    .comment-rating-field {
        padding: 20px;
    }
    
    .star-rating label {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .children {
        margin-left: 10px;
    }
    
    .comment {
        padding: 16px;
    }
    
    .comment-author {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .comment-author .avatar {
        margin-right: 0;
        margin-bottom: 12px;
    }
    
    .comment-metadata {
        margin-left: 0;
        margin-top: 8px;
    }
    
    .comment-form {
        padding: 20px;
    }
}

/* Loading animation */
.comment-loading {
    opacity: 0.6;
    pointer-events: none;
}

.comment-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #007cba;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Success message */
.comment-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}

/* Error message */
.comment-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}
