/* রেফারেন্স লিঙ্কের জন্য CSS স্টাইল */

/* গ্লোবাল ফন্ট সেটআপ - SolaimanLipi এবং SiyamRupali */
* {
    font-family: 'SolaimanLipi', 'SiyamRupali';
}

/* সুপারস্ক্রিপ্ট রেফারেন্স লিঙ্ক (যেমন: ১৮) */
.reference-link {
    color: #007cba;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    position: relative;
    font-family: 'SolaimanLipi', 'SiyamRupali';
}

.reference-link:hover {
    color: #005a87;
    text-decoration: underline;
    background-color: rgba(0, 124, 186, 0.1);
    border-radius: 3px;
    padding: 2px 4px;
}

/* রেফারেন্স ব্যাখ্যার লিঙ্ক (যেমন: ১৮। এর শুরুতে) */
.back-reference {
    color: #d63384;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1em;
    transition: all 0.3s ease;
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SolaimanLipi', 'SiyamRupali';
}

.back-reference:hover {
    color: #b02653;
    background-color: rgba(214, 51, 132, 0.1);
    text-decoration: none;
    transform: scale(1.05);
}

/* রেফারেন্স ব্যাখ্যার কন্টেইনার */
span[id^="ref-"] {
    position: relative;
    scroll-margin-top: 20px; /* স্ক্রল করার সময় শীর্ষে কিছু জায়গা রাখা */
}

/* সুপারস্ক্রিপ্ট রেফারেন্স কন্টেইনার */
[id^="backref-"] {
    scroll-margin-top: 20px;
}

/* আর্টিকেল কন্টেন্টে রেফারেন্স স্টাইলিং */
.article-content-full .reference-link,
.prose .reference-link {
    font-size: 0.85em;
    vertical-align: super;
    line-height: 0;
}

.article-content-full .back-reference,
.prose .back-reference {
    font-size: 1em;
    margin-right: 4px;
}

/* হভার ইফেক্ট - যখন রেফারেন্সে মাউস নিয়ে যাবেন */
.reference-link::after {
    content: " 🔗";
    opacity: 0;
    transition: opacity 0.3s ease;
    font-size: 0.8em;
}

.reference-link:hover::after {
    opacity: 1;
}

.back-reference::before {
    content: "↵ ";
    opacity: 0;
    transition: opacity 0.3s ease;
    font-size: 0.9em;
}

.back-reference:hover::before {
    opacity: 1;
}

/* স্মুথ স্ক্রলিং */
html {
    scroll-behavior: smooth;
}

/* টার্গেট হাইলাইট (যখন লিঙ্কে ক্লিক করে কোন রেফারেন্সে যাবেন) */
:target {
    animation: highlightTarget 2s ease-in-out;
}

@keyframes highlightTarget {
    0% {
        background-color: #fff3cd;
        border-left: 4px solid #ffc107;
        padding-left: 10px;
    }
    100% {
        background-color: transparent;
        border-left: none;
        padding-left: 0;
    }
}

/* div.box স্টাইল উন্নতিকরণ */
.article-content-full div.box,
.prose div.box {
    background-color: #d0d0d0e6;
    border: 3px solid #e9ecef;
    padding: 16px 20px;
    margin: 16px 0;
    border-radius: 9px;
    font-size: 1.1em;
    line-height: 1.6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    font-family: 'SolaimanLipi', 'SiyamRupali';
}

/* h1, strong ট্যাগের জন্য বিশেষ স্টাইল */
.article-content-full h1 {
    color: #155724;
    font-size: 1.8em;
    margin: 24px 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #28a745;
    font-family: 'SolaimanLipi', 'SiyamRupali';
}

.article-content-full strong {
    color: #495057;
    font-weight: 600;
    font-family: 'SolaimanLipi', 'SiyamRupali';
}

/* hr ট্যাগের জন্য স্টাইল */
.article-content-full hr.system-pagebreak {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent, #007cba, transparent);
    margin: 32px 0;
}

/* মোবাইল রেস্পন্সিভ */
@media (max-width: 768px) {
    .reference-link,
    .back-reference {
        font-size: 0.9em;
        padding: 3px 5px;
    }
    
    .reference-link::after,
    .back-reference::before {
        display: none; /* মোবাইলে আইকন লুকানো */
    }
    
    .article-content-full div.box,
    .prose div.box {
        padding: 12px 16px;
        margin: 12px 0;
        font-size: 1em;
    }
}

/* প্রিন্ট মিডিয়া - প্রিন্ট করার সময় লিঙ্ক রং পরিবর্তন */
@media print {
    .reference-link,
    .back-reference {
        color: #000;
        text-decoration: none;
    }
    
    .reference-link::after,
    .back-reference::before {
        display: none;
    }
    
    .article-content-full div.box,
    .prose div.box {
        background-color: #f5f5f5;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* ডার্ক মোড সাপোর্ট */
@media (prefers-color-scheme: dark) {
    .reference-link {
        color: #4fc3f7;
    }
    
    .reference-link:hover {
        color: #29b6f6;
        background-color: rgba(79, 195, 247, 0.15);
    }
    
    .back-reference {
        color: #f48fb1;
    }
    
    .back-reference:hover {
        color: #f06292;
        background-color: rgba(244, 143, 177, 0.15);
    }
    
    .article-content-full div.box,
    .prose div.box {
        /* background-color: #2d3748; */
        border-color: #4a5568;
        color: #11386c;
    }
}