/* ===== استایل‌های اختصاصی بلاگ ===== */

/* استایل بدنه مطلب */
.text_box_main {
    line-height: 1.8;
    font-size: 16px;
    text-align: justify;
}

.text_box_main h2, 
.text_box_main h3, 
.text_box_main h4 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 700;
    position: relative;
}

.text_box_main h2::after {
    content: '';
    display: block;
    width: 70px;
    height: 3px;
    background-color: var(--bs-primary);
    margin-top: 0.5rem;
    opacity: 0.7;
}

.text_box_main img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.text_box_main p {
    margin-bottom: 1.2rem;
}

.text_box_main blockquote {
    background-color: rgba(var(--bs-primary-rgb), 0.05);
    border-right: 4px solid var(--bs-primary);
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0.5rem;
    font-style: italic;
    position: relative;
}

.text_box_main blockquote:before {
    content: '\201C';
    font-size: 4rem;
    color: rgba(var(--bs-primary-rgb), 0.2);
    position: absolute;
    top: -1rem;
    right: 1rem;
    font-family: Georgia, serif;
}

/* ===== بخش دیدگاه‌ها - طراحی پیشرفته ===== */
#comments {
    border-top: 1px solid rgba(0, 0, 0, 0.07);
    padding-top: 2.5rem;
    margin-top: 3.5rem;
    position: relative;
}

#comments h3 {
    position: relative;
    display: inline-block;
    margin-bottom: 2.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
}

#comments h3:after {
    content: '';
    display: block;
    width: 50%;
    height: 3px;
    background: linear-gradient(90deg, var(--bs-primary) 0%, rgba(var(--bs-primary-rgb), 0.3) 100%);
    margin-top: 0.6rem;
    border-radius: 3px;
}

#comments::before {
    content: '\f0e6';
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    left: 0;
    top: 2.5rem;
    font-size: 2rem;
    color: rgba(var(--bs-primary-rgb), 0.1);
}

/* استایل باکس دیدگاه */
.comment-box {
    position: relative;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    margin-bottom: 1.8rem;
    padding: 1.8rem;
    border-radius: 1rem;
    background-color: #f8f9fa;
    border: 1px solid rgba(0, 0, 0, 0.03);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.03);
    overflow: hidden;
}

.comment-box::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: linear-gradient(to bottom, var(--bs-primary), transparent);
    opacity: 0.7;
    border-radius: 4px 0 0 4px;
}

.comment-box:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

/* آیکن کاربر به جای آواتار */
.comment-user-icon {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--bs-primary) 0%, rgba(var(--bs-primary-rgb), 0.7) 100%);
    color: white;
    font-size: 1.2rem;
    box-shadow: 0 4px 10px rgba(var(--bs-primary-rgb), 0.3);
    margin-left: 1rem;
    position: relative;
    overflow: hidden;
}

.comment-user-icon::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

.reply-user-icon {
    background: linear-gradient(135deg, var(--bs-secondary) 0%, rgba(var(--bs-secondary-rgb), 0.7) 100%);
    width: 40px;
    height: 40px;
    font-size: 1rem;
}

/* استایل هدر دیدگاه */
.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.comment-header-info {
    display: flex;
    flex-direction: column;
}

.comment-name {
    font-weight: 700;
    color: #2c3e50;
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
    position: relative;
    display: inline-block;
}

.comment-date {
    font-size: 0.8rem;
    color: #95a5a6;
    display: flex;
    align-items: center;
    margin-left: auto;
    margin-right: 0 !important;
}

.comment-date i {
    margin-left: 0.3rem;
    font-size: 0.75rem;
}

/* استایل متن دیدگاه */
.comment-content {
    margin-bottom: 1rem;
    line-height: 1.7;
    color: #34495e;
    position: relative;
    padding-right: 1rem;
    transition: color 0.3s ease;
}

.comment-box:hover .comment-content {
    color: #000;
}

.comment-content::before {
    content: '"';
    position: absolute;
    right: 0;
    top: 0;
    color: rgba(var(--bs-primary-rgb), 0.2);
    font-size: 1.5rem;
    font-family: Georgia, serif;
    line-height: 1;
}

/* دکمه پاسخ */
.reply-button {
    color: var(--bs-primary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    background-color: rgba(var(--bs-primary-rgb), 0.05);
    padding: 0.4rem 0.8rem;
    border-radius: 2rem;
    margin-top: 0.5rem;
}

.reply-button:hover {
    color: white !important;
    background-color: var(--bs-primary);
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(var(--bs-primary-rgb), 0.2);
}

.reply-button:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(var(--bs-primary-rgb), 0.2);
}

.reply-button i {
    margin-left: 0.5rem;
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.reply-button:hover i {
    transform: translateX(-3px);
    color: white;
}

/* کانتینر فرم پاسخ */
.reply-form-container {
    padding: 1.5rem;
    border-radius: 1rem;
    background-color: rgba(var(--bs-light-rgb), 0.7);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    margin-top: 1.2rem;
    margin-bottom: 1.5rem;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    transform: translateY(20px);
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    border: 1px solid rgba(var(--bs-primary-rgb), 0.1);
    backdrop-filter: blur(5px);
    position: relative;
}

.reply-form-container::before {
    content: '';
    position: absolute;
    top: -15px;
    right: 50px;
    width: 30px;
    height: 15px;
    background-color: rgba(var(--bs-light-rgb), 0.7);
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    transform: rotate(180deg);
    z-index: 1;
    border-top: 1px solid rgba(var(--bs-primary-rgb), 0.1);
}

.reply-form-container.active {
    transform: translateY(0);
    opacity: 1;
    max-height: 500px;
    display: block !important;
}

/* استایل پاسخ‌های دیدگاه */
.comment-replies:empty {
    display: none;
    margin: 0;
    padding: 0;
    border: none;
}

.comment-replies {
    margin-top: 1.5rem;
    margin-right: 2.5rem;
    padding-right: 1.5rem;
    border-right: 2px dashed rgba(var(--bs-primary-rgb), 0.2);
    position: relative;
}

.comment-replies:not(:empty)::before {
    content: '';
    position: absolute;
    right: -8px;
    top: -10px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: rgba(var(--bs-primary-rgb), 0.2);
}

.reply-comment-box {
    background-color: rgba(var(--bs-light-rgb), 0.5);
    border: 1px solid rgba(0, 0, 0, 0.02);
    margin-bottom: 1.2rem;
    padding: 1.2rem;
    border-radius: 0.8rem;
    transition: all 0.3s ease;
    position: relative;
    backdrop-filter: blur(5px);
}

.reply-content-wrapper {
    width: 100%;
}

.comment-replies::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: linear-gradient(to bottom, var(--bs-secondary), transparent);
    opacity: 0.5;
    border-radius: 4px 0 0 4px;
}

.reply-comment-box:hover {
    background-color: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transform: translateY(-3px);
}

/* استایل فرم ارسال دیدگاه */
#comment-form {
    padding: 2.5rem;
    border-radius: 1.2rem;
    background: linear-gradient(145deg, #f8f9fa, #ffffff);
    margin-top: 3rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(var(--bs-primary-rgb), 0.08);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

#comment-form:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    transform: translateY(-5px);
}

#comment-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--bs-primary), rgba(var(--bs-primary-rgb), 0.3));
}

#comment-form::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(var(--bs-primary-rgb), 0.05) 0%, transparent 70%);
    border-radius: 50%;
}

#comment-form h3 {
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
    color: #2c3e50;
    font-weight: 700;
}

#comment-form h3:after {
    content: '';
    display: block;
    width: 50%;
    height: 3px;
    background: linear-gradient(90deg, var(--bs-primary) 0%, rgba(var(--bs-primary-rgb), 0.3) 100%);
    margin-top: 0.5rem;
    border-radius: 3px;
}

#comment-form small {
    color: #7f8c8d;
    margin-bottom: 1.5rem;
    display: block;
}

#comment-form label {
    font-weight: 600;
    margin-bottom: 0.7rem;
    color: #34495e;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

#comment-form label i {
    margin-left: 0.4rem;
    color: var(--bs-primary);
}

.input-wrapper {
    position: relative;
    margin-bottom: 1.5rem;
}

#comment-form .form-control {
    border-radius: 0.8rem;
    box-shadow: none;
    border: 2px solid rgba(0, 0, 0, 0.05);
    padding: 1rem 1.2rem;
    transition: all 0.3s ease;
    background-color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
}

#comment-form .form-control:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.1);
    background-color: white;
}

#comment-form .form-control:focus + label,
#comment-form .form-control:not(:placeholder-shown) + label {
    color: var(--bs-primary);
}

#comment-form .form-control::placeholder {
    color: #bdc3c7;
    font-size: 0.9rem;
}

#comment-form textarea {
    resize: none;
    min-height: 130px;
}

.comment-form-footer {
    display: flex;
    align-items: center;
    margin-top: 1rem;
    justify-content: flex-start;
}

@media (min-width: 768px) {
    .comment-form-footer {
        justify-content: flex-end;
    }
}

.comment-note {
    flex: 1;
    font-size: 0.85rem;
    color: #95a5a6;
    margin-left: 1.5rem;
}

/* استایل دکمه ارسال دیدگاه */
#comment-form button[type="submit"] {
    padding: 0.8rem 2.2rem;
    font-weight: 700;
    border-radius: 2rem;
    box-shadow: 0 4px 10px rgba(var(--bs-primary-rgb), 0.3);
    transition: all 0.3s ease;
    background: linear-gradient(135deg, var(--bs-primary) 0%, rgba(var(--bs-primary-rgb), 0.8) 100%);
    border: none;
    position: relative;
    overflow: hidden;
}

#comment-form button[type="submit"]:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 15px rgba(var(--bs-primary-rgb), 0.4);
}

#comment-form button[type="submit"]:active {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(var(--bs-primary-rgb), 0.3);
}

#comment-form button[type="submit"]:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.2);
    transition: width 0.3s ease;
}

#comment-form button[type="submit"]:hover:before {
    width: 100%;
}

/* زیبایی دکمه‌های submit در فرم‌های پاسخ */
.reply-form-container button[type="submit"] {
    background: linear-gradient(135deg, var(--bs-primary) 0%, rgba(var(--bs-primary-rgb), 0.8) 100%);
    border: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(var(--bs-primary-rgb), 0.25);
}

.reply-form-container button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(var(--bs-primary-rgb), 0.35);
}

.reply-form-container button[type="submit"]:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.2);
    transition: width 0.3s ease;
}

.reply-form-container button[type="submit"]:hover:before {
    width: 100%;
}

.btn-cancel {
    background-color: #ecf0f1;
    color: #7f8c8d;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 2rem;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-right: 0.8rem;
}

.btn-cancel:hover {
    background-color: #dfe6e9;
    color: #2c3e50;
    transform: translateY(-2px);
}

/* افکت‌های انیمیشن پیشرفته */
@keyframes fadeInUp {
    from { 
        opacity: 0; 
        transform: translateY(30px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes slideIn {
    from { 
        opacity: 0; 
        transform: translateX(30px); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

@keyframes pulse {
    0% { 
        box-shadow: 0 0 0 0 rgba(var(--bs-primary-rgb), 0.4); 
    }
    70% { 
        box-shadow: 0 0 0 10px rgba(var(--bs-primary-rgb), 0); 
    }
    100% { 
        box-shadow: 0 0 0 0 rgba(var(--bs-primary-rgb), 0); 
    }
}

.comment-box {
    animation: fadeInUp 0.5s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

.comment-box:nth-child(2) { animation-delay: 0.1s; }
.comment-box:nth-child(3) { animation-delay: 0.2s; }
.comment-box:nth-child(4) { animation-delay: 0.3s; }
.comment-box:nth-child(5) { animation-delay: 0.4s; }

.reply-comment-box {
    animation: slideIn 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

.new-comment {
    animation: pulse 2s infinite;
}

/* استایل برای حالت موبایل */
@media (max-width: 768px) {
    /* بهینه‌سازی کادر دیدگاه‌ها */
    .comment-box {
        padding: 1.2rem 1rem;
        margin-bottom: 1.2rem;
    }
    
    /* کاهش اندازه آیکون کاربر */
    .comment-user-icon {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
        margin-left: 0.8rem;
        flex-shrink: 0;
    }
    
    .reply-user-icon {
        width: 30px;
        height: 30px;
        font-size: 0.7rem;
    }
    
    /* بهینه‌سازی هدر دیدگاه */
    .comment-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .comment-name {
        font-size: 0.95rem;
        margin-bottom: 0.3rem;
    }
    
    .comment-date {
        font-size: 0.7rem;
        margin-right: 0 !important;
    }
    
    /* بهینه‌سازی متن دیدگاه */
    .comment-content {
        font-size: 0.9rem;
        line-height: 1.6;
        margin-bottom: 0.8rem;
    }
    
    /* تنظیم اندازه فونت دکمه پاسخ */
    .reply-button {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }
    
    /* کاهش پدینگ و حاشیه فرم پاسخ */
    .reply-form-container {
        padding: 1rem;
        margin-top: 0.8rem;
        margin-bottom: 1rem;
    }
    
    /* بهینه‌سازی فرم ارسال دیدگاه اصلی */
    #comment-form {
        padding: 1.5rem 1rem;
    }
    
    #comment-form h3 {
        font-size: 1.2rem;
    }
    
    #comment-form .form-control {
        padding: 0.7rem 1rem;
        font-size: 0.9rem;
    }
    
    #comment-form label {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
    
    #comment-form textarea {
        min-height: 100px;
    }
    
    /* کاهش ارتفاع textarea در فرم پاسخ */
    .reply-form-container textarea {
        min-height: 80px;
    }
    
    /* تنظیم منطقه پاسخ‌ها */
    .comment-replies {
        margin-top: 1rem;
        margin-right: 1rem;
        padding-right: 0.7rem;
    }
    
    .comment-replies:not(:empty)::before {
        width: 10px;
        height: 10px;
        right: -5px;
        top: -5px;
    }
    
    /* بهینه‌سازی باکس پاسخ */
    .reply-comment-box {
        padding: 0.8rem;
        margin-bottom: 0.8rem;
    }
    
    /* تنظیمات فوتر فرم */
    .comment-form-footer {
        flex-direction: column;
    }
    
    .comment-note {
        margin-bottom: 1rem;
        margin-left: 0;
        font-size: 0.75rem;
    }
    
    /* بهبود نمایش دکمه‌ها در موبایل */
    #comment-form button[type="submit"] {
        width: 100%;
        padding: 0.6rem 1rem;
    }
    
    .reply-form-container .col-12:last-child {
        display: flex;
        gap: 0.5rem;
    }
    
    .reply-form-container button {
        flex: 1;
        font-size: 0.8rem !important;
        padding: 0.5rem 0.3rem !important;
        white-space: nowrap;
    }
    
    /* بهبود پیغام‌های خطا */
    .invalid-feedback {
        font-size: 0.75rem;
    }
    
    /* بهبود شمارشگر کاراکتر */
    .character-counter {
        font-size: 0.7rem;
    }
    
    /* بهبود دکمه اسکرول به فرم نظرات */
    .scroll-to-comment {
        font-size: 0.8rem;
        padding: 0.6rem 1rem;
        bottom: 20px;
        right: 20px;
    }
    
    /* برای نمایش خیلی کوچک */
    @media (max-width: 400px) {
        .comment-user-icon {
            width: 30px;
            height: 30px;
            font-size: 0.8rem;
            margin-left: 0.5rem;
        }
        
        .reply-user-icon {
            width: 24px;
            height: 24px;
            font-size: 0.6rem;
        }
        
        .comment-box {
            padding: 1rem 0.8rem;
        }
        
        .reply-comment-box {
            padding: 0.7rem 0.6rem;
        }
        
        .reply-form-container {
            padding: 0.8rem;
        }
        
        .comment-replies {
            margin-right: 0.7rem;
            padding-right: 0.5rem;
        }
        
        .scroll-to-comment span {
            display: none;
        }
        
        .scroll-to-comment {
            width: 45px;
            height: 45px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0;
        }
        
        .scroll-to-comment i {
            font-size: 1.2rem;
            margin: 0;
        }
    }
    
    /* بهبود فضای دکمه‌ها برای کلیک راحت‌تر در موبایل */
    .buttons-container {
        display: flex;
        gap: 0.5rem;
        margin-top: 0.8rem;
    }
    
    .buttons-container button {
        flex: 1;
        min-height: 44px; /* افزایش ارتفاع برای کلیک راحت در موبایل */
    }
    
    /* افزایش اندازه دکمه‌ها برای لمس راحت‌تر */
    .reply-button {
        min-height: 36px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* تنظیم پدینگ برای قابلیت تاچ بهتر */
    .btn {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
        touch-action: manipulation;
    }
    
    /* فاصله‌گذاری خطوط برای خوانایی بهتر */
    .comment-content {
        word-break: break-word;
    }
}

/* استایل برای پیام‌ها */
#message-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1050;
    width: 100%;
    max-width: 500px;
}

.alert {
    border: none;
    border-radius: 0.8rem;
    padding: 1.2rem;
    margin-bottom: 1rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    transform: translateY(-20px);
    opacity: 0;
    animation: alertFadeIn 0.3s forwards, alertFloat 3s ease-in-out infinite;
}

.alert.show {
    opacity: 1;
    transform: translateY(0);
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.alert::before {
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    right: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
}

.alert-success::before {
    content: "\f058"; /* fa-check-circle */
    color: #28a745;
}

.alert-danger::before {
    content: "\f057"; /* fa-times-circle */
    color: #dc3545;
}

.alert .btn-close {
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    font-size: 0.8rem;
    opacity: 0.5;
}

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

@keyframes alertFloat {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-5px);
    }
    100% {
        transform: translateY(0px);
    }
}

/* دکمه اسکرول به فرم نظر */
.scroll-to-comment {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 0.8rem 1.5rem;
    background: linear-gradient(135deg, var(--bs-primary) 0%, rgba(var(--bs-primary-rgb), 0.8) 100%);
    color: white;
    border-radius: 2rem;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(var(--bs-primary-rgb), 0.4);
    border: none;
    z-index: 99;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    animation: pulse 2s infinite;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 1;
}

.scroll-to-comment:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(var(--bs-primary-rgb), 0.5);
    color: white;
}

.scroll-to-comment i {
    font-size: 1rem;
}

/* یکسان‌سازی فرم نظرات */
#comment-form .row > div {
    margin-bottom: 1.5rem;
}

#comment-form .form-control {
    width: 100%;
    height: auto;
    border-radius: 0.8rem;
    padding: 1rem 1.2rem;
    font-size: 1rem;
}

#comment-form textarea.form-control,
#comment-form input.form-control {
    width: 100%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

/* بهبود فرم‌های پاسخ */
.reply-form-container .form-control {
    width: 100%;
    font-size: 1rem;
    padding: 0.8rem 1rem;
}

/* افکت موج آب (Ripple effect) */
.ripple-effect {
    position: relative;
    overflow: hidden;
    transform: translate3d(0, 0, 0);
}

.ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    animation: ripple 0.6s linear;
    background-color: rgba(255, 255, 255, 0.4);
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* شمارشگر کاراکتر */
.character-counter {
    display: none;
}

/* استایل‌های اعتبارسنجی فرم */
.is-invalid {
    border-color: var(--bs-danger) !important;
    box-shadow: 0 0 0 3px rgba(var(--bs-danger-rgb), 0.1) !important;
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.3rem;
    font-size: 0.875em;
    color: var(--bs-danger);
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* استایل‌های قابلیت‌های دیگر */
#comment-form textarea[name="content"]:focus ~ .character-counter {
    display: none;
}

/* زمان نسبی */
.comment-date i {
    margin-left: 0.3rem;
}

/* انیمیشن تکان خوردن برای فیلدهای خطا */
@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* استایل برای فیلدهای غیرفعال هنگام ارسال فرم */
button[disabled] {
    cursor: not-allowed;
    opacity: 0.7;
}

/* مدیریت بهتر فضای خالی در بخش کامنت‌ها */
#comments-list:empty {
    display: none;
}

/* بهبود نمایش پیام عدم وجود کامنت */
#comments-list .text-center.p-4 {
    transition: all 0.5s ease;
}

#comments-list .text-center.p-4:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.05) !important;
    transform: scale(1.02);
}

#comments-list .text-center.p-4 i {
    transition: transform 0.5s ease;
}

#comments-list .text-center.p-4:hover i {
    transform: scale(1.2);
    color: var(--bs-primary);
}

/* هایلایت پاسخ جدید */
.new-reply-highlight {
    position: relative;
    box-shadow: 0 0 20px rgba(var(--bs-primary-rgb), 0.3);
    background-color: rgba(var(--bs-primary-rgb), 0.05);
    border: 1px solid rgba(var(--bs-primary-rgb), 0.2);
    transform: translateY(0);
    z-index: 1;
    animation: highlightPulse 2s infinite;
    transition: all 0.5s ease !important;
}

@keyframes highlightPulse {
    0% {
        box-shadow: 0 0 15px rgba(var(--bs-primary-rgb), 0.3);
    }
    50% {
        box-shadow: 0 0 25px rgba(var(--bs-primary-rgb), 0.5);
    }
    100% {
        box-shadow: 0 0 15px rgba(var(--bs-primary-rgb), 0.3);
    }
}

.new-reply-highlight::after {
    content: "پاسخ جدید";
    position: absolute;
    bottom: 10px;
    left: 20px;
    background-color: var(--bs-primary);
    color: #fff;
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 15px;
    z-index: 1;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    animation: fadeInOut 5s forwards;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(10px); }
    10% { opacity: 1; transform: translateY(0); }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

/* هایلایت کامنت جدید */
.new-comment-highlight {
    position: relative;
    box-shadow: 0 0 25px rgba(var(--bs-primary-rgb), 0.35);
    background-color: rgba(var(--bs-primary-rgb), 0.03);
    border: 1px solid rgba(var(--bs-primary-rgb), 0.15);
    transform: translateY(0);
    z-index: 1;
    animation: commentHighlightPulse 2s infinite;
    transition: all 0.5s ease !important;
}

@keyframes commentHighlightPulse {
    0% {
        box-shadow: 0 0 15px rgba(var(--bs-primary-rgb), 0.3);
    }
    50% {
        box-shadow: 0 0 25px rgba(var(--bs-primary-rgb), 0.5);
    }
    100% {
        box-shadow: 0 0 15px rgba(var(--bs-primary-rgb), 0.3);
    }
}

.new-comment-highlight::after {
    content: "دیدگاه جدید";
    position: absolute;
    bottom: 10px;
    left: 30px;
    background-color: var(--bs-primary);
    color: #fff;
    font-size: 12px;
    padding: 3px 12px;
    border-radius: 15px;
    z-index: 1;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    animation: fadeInOut 5s forwards;
} 