/**
 * Comments Section Styles
 * Beautiful and responsive comment design with Bootstrap 5
 */

/* ====================================
   Comments Area
==================================== */

.comments-area {
    background: transparent;
}

.comments-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #2c3e50;
}

.comments-title i {
    font-size: 1.5rem;
}

/* ====================================
   Comment Item
==================================== */

.comment-item {
    position: relative;
    margin-bottom: 1.5rem;
}

.comment-item .card {
    transition: all 0.3s ease;
    background: #fff;
    border: 1px solid #e9ecef;
}

.comment-item .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.1) !important;
}

/* Comment Avatar */
.comment-item .rounded-circle {
    border: 3px solid #f8f9fa;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.comment-item:hover .rounded-circle {
    border-color: #e9ecef;
    transform: scale(1.05);
}

/* Comment Author */
.comment-author a,
.comment-author span {
    font-size: 1rem;
    transition: color 0.3s ease;
}

.comment-author a:hover {
    color: #007bff !important;
}

/* Comment Content */
.comment-content {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #495057;
}

.comment-content p {
    margin-bottom: 0.75rem;
}

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

/* Comment Actions */
.comment-actions .btn {
    font-size: 0.85rem;
    padding: 0.375rem 1rem;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.comment-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.comment-actions .btn-outline-primary:hover {
    background: #007bff;
    color: #fff;
}

.comment-actions .btn-outline-secondary:hover {
    background: #6c757d;
    color: #fff;
}

/* ====================================
   Nested Comments
==================================== */

.children {
    position: relative;
    padding-right: 2rem;
    padding-top: 1rem;
    margin-top: 1rem;
}

@media (min-width: 768px) {
    .children {
        padding-right: 3rem;
    }
}

.children::before {
    content: '';
    position: absolute;
    right: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #e9ecef 0%, #e9ecef 80%, transparent 100%);
}

@media (min-width: 768px) {
    .children::before {
        right: 30px;
    }
}

.children .comment-item {
    position: relative;
}

/* Nested levels */
.children .children {
    padding-right: 1.5rem;
}

@media (min-width: 768px) {
    .children .children {
        padding-right: 2rem;
    }
}

/* ====================================
   Comment Form
==================================== */

.comment-respond-wrapper {
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
    border-radius: 12px;
}

.comment-form .form-floating {
    position: relative;
}

.comment-form .form-control {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: #fff;
}

.comment-form .form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.1);
    background: #fff;
}

.comment-form label {
    color: #6c757d;
    font-weight: 500;
}

.comment-form .btn-primary {
    border-radius: 25px;
    padding: 0.75rem 2.5rem;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.comment-form .btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

.comment-form .btn-primary:active {
    transform: translateY(-1px);
}

/* Comment Reply Title */
.comment-reply-title {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
}

.comment-reply-title i {
    font-size: 1.3rem;
}

#cancel-comment-reply-link {
    font-size: 0.875rem;
    color: #dc3545;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
}

#cancel-comment-reply-link:hover {
    background: #dc3545;
    color: #fff;
}

/* Alert Styles */
.comments-area .alert {
    border-radius: 8px;
    border: none;
}

.comments-area .alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
}

.comments-area .alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
}

/* Comment Navigation */
.comment-navigation .nav-links a {
    color: #007bff;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    transition: all 0.3s ease;
    display: inline-block;
    background: #f8f9fa;
}

.comment-navigation .nav-links a:hover {
    background: #007bff;
    color: #fff;
    transform: translateY(-2px);
}

/* ====================================
   Post Author Badge
==================================== */

.bypostauthor > .card {
    border: 2px solid #007bff !important;
    position: relative;
}

.bypostauthor > .card::before {
    content: 'نویسنده';
    position: absolute;
    top: 10px;
    left: 10px;
    background: #007bff;
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 10;
}

/* ====================================
   Responsive Styles
==================================== */

@media (max-width: 768px) {
    .comments-title {
        font-size: 1.5rem;
    }

    .comment-reply-title {
        font-size: 1.25rem;
    }

    .comment-item .rounded-circle {
        width: 50px !important;
        height: 50px !important;
    }

    .comment-author a,
    .comment-author span {
        font-size: 0.9rem;
    }

    .comment-meta {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .comment-actions {
        flex-direction: column;
        width: 100%;
    }

    .comment-actions .btn {
        width: 100%;
        text-align: center;
    }

    .children::before {
        right: 15px;
    }

    .comment-respond-wrapper .card-body {
        padding: 1.5rem !important;
    }

    .comment-form .btn-primary {
        width: 100%;
        padding: 0.875rem 1rem;
    }
}

/* ====================================
   Animation
==================================== */

.comment-item,
.comment-respond-wrapper {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form Focus State Enhancement */
.comment-form .form-floating > .form-control:focus ~ label,
.comment-form .form-floating > .form-control:not(:placeholder-shown) ~ label {
    color: #007bff;
}

/* Required Field Indicator */
.comment-form .text-danger {
    color: #dc3545 !important;
    font-weight: 700;
}

/* Empty Comments State */
.no-comments {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.no-comments i {
    font-size: 4rem;
    opacity: 0.3;
    margin-bottom: 1rem;
}

/* Comment Pending Approval */
.comment-awaiting-moderation {
    color: #856404;
    background: #fff3cd;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}
