/* ==========================================================================
   Glossary — Prop Trading Glossary Pages
   White-card theme: #fff cards, dark text, purple gradient page bg
   ========================================================================== */

/* ── Hero ─────────────────────────────────────────────────────────────── */
.glossary-hero {
    text-align: center;
    padding: 1rem 1rem 2rem;
}

.glossary-hero__title {
    font-size: 2.2rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.glossary-hero__subtitle {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.05rem;
    line-height: 1.6;
    max-width: 560px;
    margin: 0 auto 1.5rem;
}

/* ── Search ───────────────────────────────────────────────────────────── */
.glossary-search {
    position: relative;
    max-width: 480px;
    margin: 0 auto;
}

.glossary-search__icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 1.2rem;
    pointer-events: none;
}

.glossary-search__input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background: #fff;
    color: #1a1a2e;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.glossary-search__input::placeholder {
    color: #999;
}

.glossary-search__input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

/* ── Letter Index ─────────────────────────────────────────────────────── */
.glossary-letters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.glossary-letters__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
}

.glossary-letters__item--active {
    background: #fff;
    color: #6366f1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.glossary-letters__item--active:hover {
    background: #6366f1;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.glossary-letters__item--disabled {
    background: transparent;
    color: rgba(255, 255, 255, 0.3);
    cursor: default;
}

/* ── Category Pills ───────────────────────────────────────────────────── */
.glossary-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 2rem;
}

.glossary-cat-pill {
    padding: 8px 16px;
    border-radius: 20px;
    border: 1.5px solid #e5e7eb;
    background: #fff;
    color: #555;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.glossary-cat-pill:hover {
    border-color: #6366f1;
    color: #6366f1;
}

.glossary-cat-pill--active {
    background: #6366f1;
    color: #fff;
    border-color: #6366f1;
}

.glossary-cat-pill--active:hover {
    background: #5558e6;
    color: #fff;
}

/* ── No Results ───────────────────────────────────────────────────────── */
.glossary-no-results {
    text-align: center;
    padding: 3rem 1rem;
    background: #fff;
    border-radius: 12px;
    color: #666;
    font-size: 0.95rem;
}

/* ── Letter Groups ────────────────────────────────────────────────────── */
.glossary-letter-group {
    margin-bottom: 1.5rem;
}

.glossary-letter-heading {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    padding: 0.5rem 0 0.5rem 4px;
    margin-bottom: 0.5rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.15);
}

/* ── Term Cards ───────────────────────────────────────────────────────── */
.glossary-term-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: #fff;
    border-radius: 12px;
    margin-bottom: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.glossary-term-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    color: inherit;
    text-decoration: none;
}

.glossary-term-card__icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #f0f0ff;
    color: #6366f1;
    font-size: 1.3rem;
}

.glossary-term-card__body {
    flex: 1;
    min-width: 0;
}

.glossary-term-card__title {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 4px;
    line-height: 1.3;
}

.glossary-term-card__def {
    font-size: 0.85rem;
    color: #666;
    margin: 0 0 4px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.glossary-term-card__category {
    font-size: 0.72rem;
    font-weight: 600;
    color: #6366f1;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.glossary-term-card__arrow {
    flex-shrink: 0;
    font-size: 1.3rem;
    color: #ccc;
    transition: transform 0.2s ease, color 0.2s ease;
}

.glossary-term-card:hover .glossary-term-card__arrow {
    color: #6366f1;
    transform: translateX(4px);
}

/* ── CTA Section ──────────────────────────────────────────────────────── */
.glossary-cta {
    text-align: center;
    background: #fff;
    border-radius: 16px;
    padding: 2.5rem 2rem;
    margin-top: 2rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.glossary-cta__title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 0.5rem;
}

.glossary-cta__text {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.glossary-cta__buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.glossary-cta__btn {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.glossary-cta__btn--primary {
    background: #6366f1;
    color: #fff;
}

.glossary-cta__btn--primary:hover {
    background: #5558e6;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.glossary-cta__btn--secondary {
    background: #f5f5ff;
    color: #6366f1;
}

.glossary-cta__btn--secondary:hover {
    background: #eaebff;
    color: #5558e6;
}

/* ==========================================================================
   Glossary Show Page (Article)
   ========================================================================== */

.glossary-article {
    background: #fff;
    border-radius: 16px;
    padding: 2rem 2.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    margin-bottom: 2rem;
}

.glossary-article__header {
    margin-bottom: 1.5rem;
}

.glossary-article__category {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #6366f1;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.5rem;
}

.glossary-article__title {
    font-size: 2rem;
    font-weight: 800;
    color: #1a1a2e;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin: 0;
}

/* ── Definition Box ───────────────────────────────────────────────────── */
.glossary-article__definition {
    background: #f8f9ff;
    border-left: 4px solid #6366f1;
    border-radius: 0 12px 12px 0;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
}

.glossary-article__def-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6366f1;
    margin-bottom: 0.3rem;
}

.glossary-article__def-text {
    font-size: 1.05rem;
    color: #1a1a2e;
    font-weight: 500;
    line-height: 1.6;
    margin: 0;
}

/* ── Explanation ──────────────────────────────────────────────────────── */
.glossary-article__explanation {
    margin-bottom: 2rem;
}

.glossary-article__section-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.glossary-article__explanation p {
    font-size: 0.95rem;
    color: #333;
    line-height: 1.75;
    margin-bottom: 1rem;
}

.glossary-article__lead {
    font-size: 1.05rem !important;
    color: #1a1a2e !important;
    font-weight: 500;
}

/* ── Context Firms ────────────────────────────────────────────────────── */
.glossary-article__firms {
    margin-bottom: 2rem;
}

.glossary-article__firms-intro {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.75rem;
}

.glossary-firm-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.glossary-firm-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid #f0f0f0;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.glossary-firm-item:hover {
    border-color: #e0e0ff;
    background: #fafaff;
    text-decoration: none;
    color: inherit;
}

.glossary-firm-item__logo {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.glossary-firm-item__logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.glossary-firm-item__initials {
    font-size: 0.75rem;
    font-weight: 700;
    color: #6366f1;
    text-transform: uppercase;
}

.glossary-firm-item__info {
    flex: 1;
    min-width: 0;
}

.glossary-firm-item__name {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: #1a1a2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.glossary-firm-item__meta {
    font-size: 0.78rem;
    color: #888;
}

.glossary-firm-item__score {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    background: #10b981;
    color: #fff;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
}

.glossary-firm-item__chevron {
    flex-shrink: 0;
    color: #ccc;
    font-size: 1.1rem;
    transition: color 0.2s ease;
}

.glossary-firm-item:hover .glossary-firm-item__chevron {
    color: #6366f1;
}

/* ── Related Terms ────────────────────────────────────────────────────── */
.glossary-article__related {
    margin-bottom: 2rem;
}

.glossary-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
}

.glossary-related-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid #f0f0f0;
    text-decoration: none;
    transition: all 0.2s ease;
}

.glossary-related-card:hover {
    border-color: #6366f1;
    background: #fafaff;
    text-decoration: none;
}

.glossary-related-card__icon {
    font-size: 1.2rem;
    color: #6366f1;
}

.glossary-related-card__term {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1a1a2e;
}

.glossary-related-card:hover .glossary-related-card__term {
    color: #6366f1;
}

/* ── Category List ────────────────────────────────────────────────────── */
.glossary-article__category-terms {
    margin-bottom: 1rem;
}

.glossary-category-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 16px;
}

.glossary-category-list li a {
    display: block;
    padding: 6px 0;
    font-size: 0.88rem;
    color: #6366f1;
    text-decoration: none;
    border-bottom: 1px solid #f5f5f5;
    transition: color 0.2s ease;
}

.glossary-category-list li a:hover {
    color: #4f46e5;
}

/* ==========================================================================
   Sidebar
   ========================================================================== */
.glossary-sidebar {
    position: sticky;
    top: 80px;
}

.glossary-sidebar__card {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 1rem;
}

.glossary-sidebar__heading {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #1a1a2e;
    margin: 0 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.glossary-sidebar__link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease;
}

.glossary-sidebar__link i {
    font-size: 1.1rem;
    color: #6366f1;
    width: 20px;
    text-align: center;
}

.glossary-sidebar__link:hover {
    background: #f5f5ff;
    color: #6366f1;
    text-decoration: none;
}

.glossary-sidebar__cat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 0.84rem;
    font-weight: 500;
    color: #555;
    text-decoration: none;
    transition: all 0.2s ease;
}

.glossary-sidebar__cat:hover {
    background: #f5f5ff;
    color: #6366f1;
    text-decoration: none;
}

.glossary-sidebar__cat--active {
    background: #f0f0ff;
    color: #6366f1;
    font-weight: 600;
}

.glossary-sidebar__count {
    font-size: 0.75rem;
    color: #999;
    font-weight: 600;
}

.glossary-sidebar__back {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #6366f1;
    text-decoration: none;
    transition: color 0.2s ease;
}

.glossary-sidebar__back:hover {
    color: #4f46e5;
    text-decoration: none;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 768px) {
    .glossary-hero__title {
        font-size: 1.6rem;
    }

    .glossary-hero__subtitle {
        font-size: 0.92rem;
    }

    .glossary-letters {
        gap: 4px;
    }

    .glossary-letters__item {
        width: 30px;
        height: 30px;
        font-size: 0.75rem;
    }

    .glossary-categories {
        gap: 6px;
    }

    .glossary-cat-pill {
        padding: 6px 12px;
        font-size: 0.75rem;
    }

    .glossary-term-card {
        padding: 12px 14px;
        gap: 12px;
    }

    .glossary-term-card__icon {
        width: 38px;
        height: 38px;
        font-size: 1.1rem;
    }

    .glossary-term-card__title {
        font-size: 0.92rem;
    }

    .glossary-term-card__def {
        font-size: 0.8rem;
        -webkit-line-clamp: 1;
    }

    .glossary-article {
        padding: 1.5rem 1.25rem;
    }

    .glossary-article__title {
        font-size: 1.5rem;
    }

    .glossary-related-grid {
        grid-template-columns: 1fr;
    }

    .glossary-category-list {
        grid-template-columns: 1fr;
    }

    .glossary-sidebar {
        position: static;
        margin-top: 1.5rem;
    }
}
