/* ============================================================
   Knowviabd অভিধান — Global Styles
   ============================================================ */

/* ---- Base ---- */
html { scroll-behavior: smooth; }
body {
    font-family: 'Hind Siliguri', 'Inter', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---- Selection ---- */
::selection {
    background: #111827;
    color: #ffffff;
}

/* ---- Focus outline (accessible) ---- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid #111827;
    outline-offset: 2px;
}

/* ---- Smooth fade-in for page sections ---- */
@keyframes kb-fade-up {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
main > section,
main > article {
    animation: kb-fade-up .35s ease-out both;
}

/* ============================================================
   Live Search Dropdown
   ============================================================ */
.kb-suggest {
    max-height: 420px;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.kb-suggest-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .7rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: background .15s ease;
}
.kb-suggest-item:last-child { border-bottom: 0; }
.kb-suggest-item:hover,
.kb-suggest-item.is-active {
    background: #f9fafb;
}
.kb-suggest-word {
    font-weight: 600;
    color: #111827;
}
.kb-suggest-pron {
    font-size: .8rem;
    color: #9ca3af;
    margin-top: .1rem;
}
.kb-suggest-type {
    font-size: .7rem;
    padding: .15rem .5rem;
    border-radius: .375rem;
    background: #f3f4f6;
    color: #6b7280;
    white-space: nowrap;
}
.kb-suggest-item mark {
    background: #fef08a;
    color: #111827;
    padding: 0 .15rem;
    border-radius: .2rem;
}
.kb-suggest-empty {
    padding: 1rem;
    text-align: center;
    color: #9ca3af;
    font-size: .9rem;
}

/* ============================================================
   Prose (লিগ্যাল পেজ কনটেন্ট)
   ============================================================ */
.prose-page { line-height: 1.75; color: #1f2937; }
.prose-page > :first-child { margin-top: 0; }
.prose-page h1,
.prose-page h2,
.prose-page h3,
.prose-page h4 {
    font-weight: 700;
    color: #111827;
    line-height: 1.35;
    margin: 1.75em 0 .6em;
}
.prose-page h1 { font-size: 1.75rem; }
.prose-page h2 { font-size: 1.4rem; }
.prose-page h3 { font-size: 1.2rem; }
.prose-page h4 { font-size: 1.05rem; }
.prose-page p { margin: .9em 0; }
.prose-page ul,
.prose-page ol { margin: 1em 0; padding-left: 1.5em; }
.prose-page ul { list-style: disc; }
.prose-page ol { list-style: decimal; }
.prose-page li { margin: .4em 0; }
.prose-page li > ul,
.prose-page li > ol { margin: .3em 0; }
.prose-page a {
    color: #1d4ed8;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.prose-page a:hover { color: #1e40af; }
.prose-page strong { font-weight: 700; color: #111827; }
.prose-page em { font-style: italic; }
.prose-page blockquote {
    border-left: 3px solid #e5e7eb;
    padding: .25em 0 .25em 1em;
    color: #4b5563;
    margin: 1.25em 0;
}
.prose-page table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.25em 0;
    font-size: .95rem;
}
.prose-page th,
.prose-page td {
    border: 1px solid #e5e7eb;
    padding: .55em .8em;
    text-align: left;
    vertical-align: top;
}
.prose-page th { background: #f9fafb; font-weight: 600; }
.prose-page code {
    background: #f3f4f6;
    padding: .15em .4em;
    border-radius: .3rem;
    font-size: .9em;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.prose-page pre {
    background: #111827;
    color: #f9fafb;
    padding: 1em;
    border-radius: .5rem;
    overflow-x: auto;
    margin: 1.25em 0;
}
.prose-page pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}
.prose-page img {
    max-width: 100%;
    height: auto;
    border-radius: .5rem;
    margin: 1em 0;
}
.prose-page hr {
    border: 0;
    border-top: 1px solid #e5e7eb;
    margin: 2em 0;
}

/* ============================================================
   Utility
   ============================================================ */
.kb-truncate-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================================
   Print (শব্দের পেজ)
   ============================================================ */
@media print {
    header, footer, nav, button { display: none !important; }
    main, article { max-width: 100%; padding: 0 !important; }
    a { color: #111827 !important; text-decoration: none !important; }
    .prose-page a[href]::after {
        content: " (" attr(href) ")";
        font-size: .8em;
        color: #6b7280;
    }
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}
/* ============================================================
   Clickable Design Upgrade — Colorful Smooth
   ============================================================ */

/* ---- Colorful Word Cards (Homepage) ---- */
.kb-card {
    position: relative;
    display: block;
    padding: 1.25rem;
    border-radius: 1rem;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    transition: all .25s cubic-bezier(.4,0,.2,1);
    overflow: hidden;
}
.kb-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(59,130,246,.04), rgba(168,85,247,.04));
    opacity: 0;
    transition: opacity .25s ease;
    pointer-events: none;
}
.kb-card:hover {
    border-color: #d1d5db;
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -8px rgba(17,24,39,.12);
}
.kb-card:hover::before { opacity: 1; }

.kb-card-word {
    font-weight: 700;
    font-size: 1.05rem;
    color: #111827;
    transition: color .2s;
}
.kb-card:hover .kb-card-word { color: #1d4ed8; }

.kb-card-sub {
    font-size: .8rem;
    color: #9ca3af;
    margin-top: .15rem;
}

/* ---- Alphabet Button Upgrade ---- */
.kb-alpha {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1/1;
    border-radius: .65rem;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #374151;
    font-weight: 500;
    transition: all .2s ease;
    text-decoration: none;
}
.kb-alpha:hover {
    border-color: #111827;
    background: #111827;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px -6px rgba(17,24,39,.4);
}
.kb-alpha.is-active {
    background: #111827;
    border-color: #111827;
    color: #fff;
}
.kb-alpha.is-disabled {
    color: #d1d5db;
    border-color: #f3f4f6;
    pointer-events: none;
}

/* ---- Relation Pills (Synonym/Antonym/Related) ---- */
.kb-pill {
    display: inline-flex;
    align-items: center;
    padding: .4rem .9rem;
    border-radius: 9999px;
    font-size: .875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all .2s cubic-bezier(.4,0,.2,1);
    border: 1px solid transparent;
}
.kb-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px -4px rgba(0,0,0,.15);
}

/* Synonym — soft blue */
.kb-pill-synonym {
    background: linear-gradient(135deg,#eff6ff,#dbeafe);
    color: #1e40af;
    border-color: #bfdbfe;
}
.kb-pill-synonym:hover {
    background: linear-gradient(135deg,#dbeafe,#bfdbfe);
    border-color: #60a5fa;
}

/* Antonym — soft red */
.kb-pill-antonym {
    background: linear-gradient(135deg,#fef2f2,#fee2e2);
    color: #991b1b;
    border-color: #fecaca;
}
.kb-pill-antonym:hover {
    background: linear-gradient(135deg,#fee2e2,#fecaca);
    border-color: #f87171;
}

/* Related — soft purple */
.kb-pill-related {
    background: linear-gradient(135deg,#faf5ff,#f3e8ff);
    color: #6b21a8;
    border-color: #e9d5ff;
}
.kb-pill-related:hover {
    background: linear-gradient(135deg,#f3e8ff,#e9d5ff);
    border-color: #a78bfa;
}

/* Disabled / not in DB */
.kb-pill-disabled {
    background: #f9fafb;
    color: #d1d5db;
    border-color: #f3f4f6;
    pointer-events: none;
    cursor: not-allowed;
}

/* ---- Meaning Block (Single View) ---- */
.kb-meaning {
    padding: 1.25rem 1.5rem;
    border-left: 3px solid #e5e7eb;
    border-radius: .5rem;
    background: #fff;
    transition: border-color .25s, background .25s;
}
.kb-meaning:hover {
    border-left-color: #1d4ed8;
    background: #fafbff;
}
.kb-meaning-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: .5rem;
    background: #f3f4f6;
    color: #374151;
    font-size: .8rem;
    font-weight: 700;
    margin-right: .65rem;
    flex-shrink: 0;
    transition: all .25s;
}
.kb-meaning:hover .kb-meaning-num {
    background: #1d4ed8;
    color: #fff;
}

/* ---- Example Quote ---- */
.kb-example {
    position: relative;
    padding: 1rem 1.25rem 1rem 2.75rem;
    border-radius: .75rem;
    background: linear-gradient(135deg,#f9fafb,#f3f4f6);
    color: #374151;
    font-style: italic;
    margin-top: .75rem;
}
.kb-example::before {
    content: "“";
    position: absolute;
    left: .75rem;
    top: 0;
    font-size: 2.5rem;
    color: #d1d5db;
    font-family: Georgia, serif;
    line-height: 1;
}
.kb-example-bn {
    font-style: normal;
    color: #6b7280;
    font-size: .9rem;
    margin-top: .35rem;
}

/* ---- Header Bar (Single View) ---- */
.kb-word-header {
    position: relative;
    padding: 2rem 1.75rem;
    border-radius: 1.25rem;
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    border: 1px solid #e5e7eb;
    overflow: hidden;
}
.kb-word-header::after {
    content: "";
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(59,130,246,.08), transparent 70%);
    pointer-events: none;
}
.kb-word-title {
    font-size: clamp(1.75rem, 5vw, 2.75rem);
    font-weight: 800;
    color: #111827;
    letter-spacing: -.02em;
    line-height: 1.15;
    position: relative;
    z-index: 1;
}
.kb-word-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem .75rem;
    margin-top: 1rem;
    align-items: center;
    position: relative;
    z-index: 1;
}
.kb-chip {
    display: inline-flex;
    align-items: center;
    padding: .3rem .75rem;
    border-radius: 9999px;
    font-size: .8rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    color: #4b5563;
}
.kb-chip-ipa {
    font-family: ui-monospace, monospace;
    background: #f0f9ff;
    border-color: #bae6fd;
    color: #0369a1;
}
.kb-chip-pos {
    background: #fef3c7;
    border-color: #fde68a;
    color: #92400e;
    font-weight: 600;
}

/* ---- Section Heading ---- */
.kb-section-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #6b7280;
    margin-bottom: .85rem;
}
.kb-section-title::before {
    content: "";
    width: 3px;
    height: 14px;
    border-radius: 2px;
    background: currentColor;
}

/* ---- Back Button ---- */
.kb-back {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem .9rem;
    border-radius: .5rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    color: #4b5563;
    font-size: .875rem;
    transition: all .2s;
    text-decoration: none;
}
.kb-back:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #111827;
}

/* ---- Smooth Scroll & Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
    .kb-card:hover,
    .kb-pill:hover,
    .kb-alpha:hover {
        transform: none;
    }
}
/* ============================================================
   Shobdik-style Green Theme & Soft Cards
   ============================================================ */
:root {
    --kb-green: #10b981;
    --kb-green-light: #ecfdf5;
    --kb-green-dark: #047857;
}

/* Index-এর জন্য সফট গ্রিন কার্ড */
.kb-card-green {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 1.25rem;
    padding: 1.25rem;
    transition: all .3s ease;
    position: relative;
    overflow: hidden;
}
.kb-card-green:hover {
    border-color: var(--kb-green);
    box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.15);
    transform: translateY(-2px);
}

/* নামের অর্থ পেজের বড় হেডার কার্ড */
.kb-header-card {
    background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%);
    border: 1px solid #d1fae5;
    border-radius: 1.5rem;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 20px -5px rgba(16, 185, 129, 0.1);
}

/* বিখ্যাত ব্যক্তি বা যৌগিক নামের পিল */
.kb-pill-green {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
    padding: .5rem 1rem;
    border-radius: 9999px;
    font-size: .875rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    transition: all .2s;
}
.kb-pill-green:hover {
    background: var(--kb-green-light);
    border-color: var(--kb-green);
    color: var(--kb-green-dark);
}
/* ============================================================
   Awesome Card Design (Glassmorphism & Glow)
   ============================================================ */
.kb-card-glass {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.kb-card-glass:hover {
    box-shadow: 0 20px 40px -10px rgba(16, 185, 129, 0.15), 0 0 20px rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
}
/* ============================================================
   Word Constellation Animation
   ============================================================ */
@keyframes pulse-slow {
    0%, 100% { transform: scale(1); box-shadow: 0 0 40px rgba(16,185,129,0.4); }
    50% { transform: scale(1.05); box-shadow: 0 0 60px rgba(16,185,129,0.6); }
}
.animate-pulse-slow {
    animation: pulse-slow 4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* মোবাইলের জন্য কনসটেলেশন এরিয়ার ব্যাসার্ধ ছোট করা */
@media (max-width: 640px) {
    #constellationContainer a, 
    #constellationContainer div[class*="absolute"] {
        /* জাভাস্ক্রিপ্টের ইনলাইন স্টাইলকে ওভাররাইড করতে !important */
        transform: scale(0.7) translate(var(--x), var(--y)) !important; 
    }
}