/* ======================================================
   GLOBAL: EMPTY STATES
====================================================== */
.empty-state-box {
    background: #f8f8f8;
    border-left: 4px solid #000;
    padding: 18px 20px;
    margin: 15px 0 25px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #000;
    line-height: 1.55;
    display: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.empty-state-box strong {
    display: block;
    margin-bottom: 6px;
    font-size: 17px;
}

.global-empty-state {
    background: #fff;
    text-align: center;
    padding: 40px 25px;
    font-size: 20px;
    font-weight: 600;
    color: #555;
    border-radius: 10px;
    border: 1px solid #eee;
    display: none;
    margin-top: 20px;
}

/* ======================================================
   HEADER SECTION
====================================================== */
.glossary-header {
    padding: 60px 0 30px;
    border-bottom: 1px solid #eee;
}

.glossary-title {
    font-size: 42px;
    font-weight: 800;
}

.glossary-subtitle {
    font-size: 18px;
    max-width: 720px;
    color: #555;
    line-height: 1.6;
}

/* ======================================================
   STICKY NAV + SEARCH
====================================================== */
.glossary-sticky-wrapper {
    position: sticky;
    top: 0;
    background: #fff;
    backdrop-filter: blur(6px);
    z-index: 50;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

/* A–Z Navigation */
.glossary-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    padding-bottom: 10px;
}

.glossary-nav-item {
    padding: 6px 8px;
    font-size: 14px;
    font-weight: 600;
    color: #444;
    cursor: pointer;
    border-radius: 4px;
}

.glossary-nav-item.active,
.glossary-nav-item:hover {
    background: #efefef;
}

/* Search Bar */
.glossary-search-wrapper {
    display: flex;
    justify-content: center;
}

.glossary-search-input {
    width: 100%;
    max-width: 600px;
    padding: 12px 18px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fafafa;
    font-size: 17px;
}

.glossary-search-input:focus {
    background: #fff;
    border-color: #222;
}

/* ======================================================
   MAIN CONTENT SECTIONS
====================================================== */
.glossary-section {
    margin: 40px 0;
    display: none;
}

.glossary-letter {
    font-size: 32px;
    font-weight: 700;
    border-bottom: 3px solid #000;
    padding-bottom: 6px;
    margin-bottom: 20px;
}

/* ======================================================
   GRID & CARD DESIGN
====================================================== */
.glossary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 30px;
}

.glossary-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 20px;
    transition: box-shadow 0.2s;
}

.glossary-card:hover {
    box-shadow: 0 4px 18px rgba(0,0,0,0.06);
}

.glossary-term {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
}

.glossary-quick {
    font-size: 15px;
    color: #666;
}

/* ======================================================
   UNIFIED PILL STYLE (category + synonyms)
====================================================== */
.pill-badge,
.category-badge,
.synonym-badge {
    display: inline-block;
    padding: 6px 14px;
    background: #f3f3f3;
    border: 1px solid #d6d6d6;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

/* Category pill is clickable */
.category-badge {
    cursor: pointer;
    transition: 0.2s;
}

.category-badge:hover {
    background: #e6e6e6;
}

/* LABEL ABOVE CATEGORY */
.category-label {
    font-size: 14px;
    font-weight: 700;
    color: #222;
    margin-top: 10px;
    margin-bottom: 6px;
}

/* SYNONYMS WRAPPER */
.synonym-wrapper {
    margin-top: 16px;
}

.synonym-label {
    font-size: 14px;
    font-weight: 700;
    color: #333;
    margin-bottom: 6px;
}

.glossary-synonyms {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.related-wrapper {
    margin-top: 12px;
}

.related-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
    font-size: 14px;
}

.related-items {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.related-badge {
    display: inline-block;
    padding: 4px 10px;
    background: #eef2ff;
    border-radius: 6px;
    font-size: 13px;
    color: #1d4ed8;
    text-decoration: none;
    border: 1px solid #dbeafe;
}

.related-badge:hover {
    background: #dbeafe;
}


/* ======================================================
   READ MORE
====================================================== */
.read-more-btn {
    color: #333;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
    padding-left: 22px;
    position: relative;
    display: inline-block;
}

.read-more-btn::before {
    content: "+";
    position: absolute;
    left: 0;
    top: 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 16px;
}

.read-more-btn.open::before {
    content: "–";
}

.read-more-content {
    display: none;
    margin-top: 10px;
    animation: fadeSlide 0.25s ease;
}

@keyframes fadeSlide {
    from { opacity: 0; transform: translateY(-3px); }
    to   { opacity: 1; transform: translateY(0); }
}


/* ======================================================
   CATEGORY VIEW SECTION
====================================================== */
.category-action-bar {
    background: #f5f5f5;
    border: 1px solid #e2e2e2;
    padding: 14px 18px;
    border-radius: 10px;
    margin: 25px 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 15px;
}

/* LEFT TEXT */
.active-category-label {
    font-weight: 600;
    color: #333;
}

/* SHOW ALL BUTTON */
.show-all-btn {
    background: #000;
    color: #fff;
    padding: 7px 18px;
    border-radius: 6px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: 0.2s ease-in-out;
}

.show-all-btn:hover {
    opacity: 0.85;
}

/* MOBILE RESPONSIVE */
@media (max-width: 600px) {
    .category-action-bar {
        flex-direction: column;
        align-items: flex-start;
        padding: 16px;
    }

    .show-all-btn {
        width: 100%;
        text-align: center;
    }
}


.glossary-autocomplete {
    position: absolute;
    width: 100%;
    max-width: 600px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    margin-top: 4px;
    list-style: none;
    padding: 0;
    display: none;
    z-index: 70;
}

.glossary-autocomplete li {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 15px;
    border-bottom: 1px solid #f3f3f3;
}

.glossary-autocomplete li:hover {
    background: #f7f7f7;
}

html {
    scroll-behavior: smooth;
}

.highlight-term {
    outline: 3px solid #ffe58f;
    background: #fffbe6;
    transition: background 0.5s ease;
}


/* ======================================================
   MOBILE RESPONSIVE
====================================================== */
@media(max-width: 768px) {
    .glossary-title {
        font-size: 36px;
    }
    .glossary-grid {
        grid-template-columns: 1fr;
    }
}
