/* 
===========================================
🎨 Assaqafah.com - কমেন্ট সিস্টেম CSS
===========================================
*/

/* প্রাইমারি কালার - ইসলামিক গ্রীন */
:root {
    --primary-color: #1B5E40;
    --primary-dark: #134430;
    --primary-light: #2a7d5a;
    
    /* সেকেন্ডারি কালার - গোল্ডেন */
    --secondary-color: #D4AF37;
    --secondary-dark: #b89020;
    
    /* অ্যাকসেন্ট কালার */
    --accent-color: #8B4513;
    
    /* টেক্সট কালার */
    --text-dark: #2c3e50;
    --text-light: #6c757d;
    
    /* ব্যাকগ্রাউন্ড কালার */
    --bg-white: #ffffff;
    --bg-light: #f8f9fa;
    --bg-gray: #e9ecef;
    
    /* বর্ডার */
    --border-color: #dee2e6;
    
    /* স্ট্যাটাস কালার */
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    
    /* ফন্ট ফ্যামিলি */
    --font-bengali: 'Noto Sans Bengali', sans-serif;
    --font-arabic: 'Scheherazade New', serif;
    
    /* ট্রানজিশন */
    --transition: all 0.3s ease;
    
    /* শ্যাডো */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
}

/* কমেন্ট সেকশন কন্টেইনার */
.comment-section-container {
    max-width: 800px;
    margin: 40px auto 15px auto;
    padding: 25px 40px; /* পাশের প্যাডিং যোগ করা হয়েছে */
    border-top: 2px solid var(--border-color);
}

/* যখন কোন মন্তব্য নেই - আপডেট করা ডিজাইন */
.no-comments-container {
    text-align: center;
    color: var(--text-light);
    padding: 50px 20px;
    background-color: var(--bg-light);
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid rgba(27, 94, 64, 0.15); /* চিকন সলিড বর্ডার */
}

.no-comments-icon {
    font-size: 3rem;
    color: var(--primary-light);
    margin-bottom: 15px;
    opacity: 0.7;
}

.no-comments-message {
    font-size: 1.1rem;
    line-height: 1.6;
}

/* কমেন্ট হেডার */
.comment-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.comment-header h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 900;
}

.comment-count { 
    font-weight: 600; 
    color: var(--text-light);
    background-color: var(--bg-light);
    padding: 5px 15px;
    border-radius: 20px;
}

/* মন্তব্য লিস্ট */
#comments-list {
    margin-bottom: 30px;
}

/* মন্তব্য ফর্ম সেকশন */
.comment-form-section {
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.section-title {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    display: flex; 
    align-items: center; 
    gap: 10px;
    font-weight: 900;
}

/* ফর্ম গ্রুপ স্টাইল */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

/* আবশ্যকীয় ফিল্ডের জন্য স্টার চিহ্ন */
.required-star {
    color: var(--danger);
    margin-left: 3px;
}

/* প্লেসহোল্ডার স্টাইল */
::placeholder {
    color: var(--text-light);
    opacity: 0.8;
}

:-ms-input-placeholder {
    color: var(--text-light);
}

::-ms-input-placeholder {
    color: var(--text-light);
}

/* --- ফর্ম ডিজাইন (প্রধান এবং রিপ্লাই ফর্মের জন্য কমন) --- */
#comment-form { margin-bottom: 0; padding: 0; }
.reply-form { padding: 0; }
.form-group input, .form-group textarea, .reply-form input[type="text"], .reply-form input[type="email"], .reply-form input[type="url"], .reply-form textarea {
    width: 100%; 
    padding: 14px 16px; 
    border: 1px solid var(--border-color); 
    border-radius: 8px; 
    font-family: var(--font-bengali); 
    font-size: 1.05rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    color: var(--text-dark);
}

.form-group input:focus, .form-group textarea:focus, .reply-form input[type="text"]:focus, .reply-form input[type="email"]:focus, .reply-form input[type="url"]:focus, .reply-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(27, 94, 64, 0.1);
}

.form-group textarea, .reply-form textarea {
    min-height: 140px; 
    resize: vertical;
}

.form-footer { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    flex-wrap: wrap; 
    gap: 15px; 
}

.submit-btn { 
    background-color: var(--primary-color); 
    color: var(--bg-white); 
    padding: 12px 30px; 
    border: none; 
    border-radius: 8px; 
    font-weight: 600; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    gap: 8px;
    transition: background-color 0.3s ease, transform 0.1s ease;
    font-size: 1rem;
}

.submit-btn:hover {
    background-color: var(--primary-light);
}

.submit-btn:active, .submit-btn.loading {
    background-color: var(--accent-color) !important; /* #8B4513 */
    transform: scale(0.98);
}

.submit-btn:disabled {
    background-color: var(--accent-color) !important; /* #8B4513 */
    color: var(--bg-white);
    cursor: not-allowed;
    transform: scale(1);
}

.cancel-btn { background-color: var(--bg-gray) !important; color: var(--text-dark) !important; }

/* চেকবক্সের জন্য স্পেস */
.save-info input[type="checkbox"] {
    margin-right: 5px; 
}

/* --- কমেন্ট লেআউট --- */
.comment-item { position: relative; margin-bottom: 10px; }
.comment-item.has-replies::before {
    content: ''; position: absolute; top: 40px; left: 19px; bottom: 0;
    width: 2px; background-color: var(--border-color); z-index: 1;
}
.comment-main-wrapper { display: flex; gap: 10px; position: relative; z-index: 2; padding-bottom: 5px; }
.comment-avatar {
    width: 38px; height: 38px; border-radius: 50%; background-color: var(--primary-color); color: var(--bg-white);
    display: flex; justify-content: center; align-items: center; font-weight: 700; flex-shrink: 0; border: 2px solid #fff; position: relative; z-index: 3;
}
.comment-content-area { max-width: calc(100% - 50px); }
.comment-bubble { background-color: var(--bg-light); padding: 10px 15px; border-radius: 18px; display: inline-block; }
.comment-author { font-weight: 700; font-size: 0.9rem; color: var(--text-dark); text-decoration: none; }
.comment-author:hover { color: var(--primary-color); }
.comment-body { font-size: 0.95rem; line-height: 1.4; }

/* --- অ্যাকশনস এবং আইকন ডিজাইন --- */
.comment-actions {
    margin-left: 12px; margin-top: 3px; display: flex; gap: 15px;
    font-size: 0.85rem; color: var(--text-light); font-weight: 600;
}
.comment-action { cursor: pointer; transition: color 0.2s; display: flex; align-items: center; gap: 4px; }
.comment-action:hover { color: var(--primary-color); }
.comment-action i { font-size: 1rem; }
.like-btn.active { color: var(--primary-color); }
.love-btn.active { color: var(--danger); }
.dislike-btn.active { color: var(--text-light); }
.reaction-count { font-size: 0.8rem; font-weight: normal; }

/* --- রিপ্লাই থ্রেডিং এবং মাস্কিং --- */
.replies { padding-left: 55px; position: relative; }
/* সিলেক্টর পরিবর্তন করা হয়েছে */
.replies .comment-item::before {
    content: ''; position: absolute; top: 20px; left: -36px; width: 36px; height: 2px;
    background-color: var(--border-color); z-index: 2; border-bottom-left-radius: 10px;
}
/* সিলেক্টর পরিবর্তন করা হয়েছে */
.replies .comment-item:last-child::after {
    content: ''; position: absolute; left: -40px; top: 22px; bottom: 0; width: 10px;
    background-color: var(--bg-white); z-index: 1;
}
.reply-form-container {
    margin-top: 10px; margin-left: 55px; padding: 10px; background-color: var(--bg-light); border-radius: 8px; display: none; position: relative;
}
.reply-form-container::before {
    content: ''; position: absolute; top: -10px; left: -36px; width: 36px; height: 35px;
    border-bottom: 2px solid var(--border-color); border-left: 2px solid var(--border-color); border-bottom-left-radius: 10px; z-index: 0;
}
.reply-form-container.active { display: block; }
.reply-form .form-group { margin-bottom: 10px; }
.reply-form .form-footer { margin-top: 10px; }

/* পেন্ডিং কমেন্ট স্টাইল */
.pending-comment .comment-bubble {
    background-color: rgba(255, 193, 7, 0.1);
    border-left: 3px solid var(--warning);
}
.pending-notice {
    color: var(--warning);
    font-style: italic;
}

/* সফল মেসেজ স্টাইল - দুটি আলাদা বার্তা */
.success-message, .reply-success-message {
    position: fixed;
    top: 30px;
    right: 30px;
    background: linear-gradient(135deg, var(--success), #2ECC71);
    color: white;
    padding: 20px 25px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 15px;
    max-width: 400px;
    animation: slideInRight 0.5s ease-out;
    display: none;
}

.reply-success-message {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
}

.success-message.show, .reply-success-message.show {
    display: flex;
}

.success-icon {
    font-size: 2rem;
}

.success-text h4 {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.success-text p {
    font-size: 0.9rem;
    opacity: 0.9;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* স্পিনার ইফেক্ট */
.spinner {
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
/* রেসপন্সিভ */
@media (max-width: 768px) {
    .comment-section-container {
        padding: 20px 15px;
        margin: 10px auto;
    }
    
    .section-title {
        font-size: 1.3rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
        font-weight: 900;
    }
    
    /* --- সঠিক এবং চূড়ান্ত কোডটি এখানে --- */
    .comment-header {
        display: flex;
        justify-content: space-between; /* একদিকে শিরোনাম, আরেকদিকে কাউন্ট */
        align-items: center; /* উপরে-নিচে মিলিয়ে রাখার জন্য */
        margin-top: 20px;
        padding-bottom: 8px; /* ফাঁকা জায়গা কমানোর জন্য */
        border-bottom: 1px solid var(--border-color);
    }
    /* --- চূড়ান্ত কোড শেষ --- */
    
    .no-comments-container {
        padding: 30px 15px;
        font-size: 1rem;
        margin-bottom: 10px;
    }
    
    .no-comments-icon {
        font-size: 2.5rem;
    }
    
    .form-group input, .form-group textarea, .reply-form input[type="text"], .reply-form input[type="email"], .reply-form input[type="url"], .reply-form textarea {
        padding: 12px 14px;
        font-size: 1rem;
    }
    
    .form-group textarea, .reply-form textarea {
        min-height: 120px;
    }
    
    .form-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    /* মোবাইলে সেভ-ইনফো সাবমিট বাটনের আগে */
    .save-info {
        order: 1;
        text-align: center;
        margin-bottom: 10px;
    }
    
    .submit-btn {
        order: 2;
        width: 100%;
        justify-content: center;
        padding: 14px;
    }
    
    .replies { 
        padding-left: 40px; 
    }
    
    .reply-form-container { 
        margin-left: 40px; 
    }
    
    .comment-item.has-replies::before { 
        left: 15px; 
        top: 35px; 
    }
    
    .replies .comment-item::before { 
        left: -25px; 
        width: 25px; 
    }
    
    .replies .comment-item:last-child::after { 
        left: -29px; 
    }
    
    .reply-form-container::before { 
        left: -25px; 
        width: 25px; 
    }
    
    .comment-avatar { 
        width: 32px; 
        height: 32px; 
        font-size: 0.9rem; 
    }
    
    .comment-actions { 
        gap: 10px; 
        font-size: 0.8rem;
        flex-wrap: wrap;
    }
    
    .comment-action i {
        font-size: 0.9rem;
    }
    
    .comment-bubble {
        padding: 8px 12px;
    }
    
    .comment-body {
        font-size: 0.9rem;
    }
    
    .success-message, .reply-success-message {
        top: 20px;
        right: 20px;
        left: 20px;
        max-width: none;
        padding: 15px 20px;
        font-size: 0.9rem;
    }
}