/* Glossary Scoped Styles */
.glossary-page {
    /* Container & Layout */
    --primary-color: #2563eb;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --bg-light: #f8fafc;
    --border-color: #e2e8f0;
}

.glossary-page .glossary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin: 40px 0;
}

@media (max-width: 1024px) {
    .glossary-page .glossary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .glossary-page .glossary-grid {
        grid-template-columns: 1fr;
    }
}

.glossary-page .glossary-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.glossary-page .glossary-card[id] {
    scroll-margin-top: 100px;
}

.glossary-page .glossary-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
    border-color: var(--primary-color);
}

.glossary-page .glossary-card h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 12px;
}

.glossary-page .glossary-card p {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 24px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.glossary-page .read-more-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 14px;
    transition: gap 0.2s ease;
}

.glossary-page .glossary-card:hover .read-more-link {
    gap: 12px;
}

/* Breadcrumbs */
.glossary-page .breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.glossary-page .breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.glossary-page .breadcrumb a:hover {
    color: var(--primary-color);
}

.glossary-page .breadcrumb .separator {
    color: #cbd5e1;
}

/* Content Sections */
.glossary-page .term-content {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
}

.glossary-page .term-content h2 {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-color);
    margin: 48px 0 20px;
    letter-spacing: -0.5px;
}

.glossary-page .term-content h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-color);
    margin: 32px 0 16px;
}

.glossary-page .term-content p {
    font-size: 16px;
    line-height: 1.8;
    color: #475569;
    margin-bottom: 24px;
}

.glossary-page .term-content ul,
.glossary-page .term-content ol {
    margin-bottom: 24px;
    padding-left: 20px;
}

.glossary-page .term-content li {
    margin-bottom: 12px;
    font-size: 16px;
    color: #475569;
}

.glossary-page .related-section {
    background: #f1f5f9;
    border-radius: 16px;
    padding: 40px;
    margin: 60px 0;
}

.glossary-page .related-links-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 24px;
}

@media (max-width: 640px) {
    .glossary-page .related-links-grid {
        grid-template-columns: 1fr;
    }
}

.glossary-page .internal-link-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.glossary-page .internal-link-card:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateX(4px);
}

/* Alphabet Navigation */
.alphabet-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 32px;
}

.alphabet-nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.alphabet-nav a:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.2);
}

.alphabet-nav a.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f1f5f9;
    color: #94a3b8;
    border-color: #e2e8f0;
    box-shadow: none;
    transform: none;
}

/* Glossary Sections */
.glossary-section {
    margin-bottom: 60px;
    scroll-margin-top: 100px;
}

.section-letter {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-color);
    margin-bottom: 24px;
    padding-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-letter::after {
    content: '';
    flex-grow: 1;
    height: 1px;
    background: var(--border-color);
}

@media (max-width: 640px) {
    .alphabet-nav {
        gap: 6px;
    }

    .alphabet-nav a {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }
}