/* ===== GLOSSARY PAGE STYLES ===== */

/* Breadcrumb Navigation */
.glossary-breadcrumb {
    margin-bottom: 1.5rem;
    padding: 0.75rem 0;
}

.glossary-breadcrumb ol {
    margin-bottom: 0;
    padding-left: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.glossary-breadcrumb li {
    display: flex;
    align-items: center;
}

.glossary-breadcrumb li:not(:last-child)::after {
    content: '>';
    margin-left: 0.5rem;
    color: var(--text-muted);
}

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

.glossary-breadcrumb a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.glossary-breadcrumb .active {
    color: var(--text);
    font-weight: 600;
}

/* Back to Calculator Button */
.back-to-calculator-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: var(--text-white);
    border: none;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    margin-bottom: 2rem;
}

.back-to-calculator-btn:hover {
    opacity: 0.9;
    transform: translateY(-0.125rem);
    color: var(--text-white);
    text-decoration: none;
}

.back-to-calculator-btn svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* Glossary Content Layout */
.glossary-page-container {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.glossary-main-content {
    flex: 1;
    min-width: 0; /* Prevents flex item from overflowing */
}

.glossary-main-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--primary);
}

.glossary-main-content h2 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.glossary-main-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.glossary-content-text {
    line-height: 1.8;
    font-size: 1.1rem;
    color: var(--text);
    margin-bottom: 1.5rem;
}

.glossary-content-text p {
    margin-bottom: 1rem;
}

.glossary-content-text ul,
.glossary-content-text ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.glossary-content-text li {
    margin-bottom: 0.5rem;
}

/* Formula Styling */
.glossary-formula {
    background: var(--bg-dark-forcards);
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
    border-left: 4px solid var(--primary);
}

.glossary-formula code {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    background: transparent;
    padding: 0;
    color: var(--text);
}

.glossary-formula .formula-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

/* Example Box Styling */
.glossary-example {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
    border-left: 4px solid var(--secondary);
}

.glossary-example .example-label {
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--secondary);
}

.glossary-example .example-content {
    line-height: 1.8;
}

/* Related Terms Sidebar */
.glossary-sidebar {
    width: 280px;
    flex-shrink: 0;
}

.glossary-sidebar-card {
    background: var(--bg);
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    position: sticky;
    top: 2rem;
}

.glossary-sidebar-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--primary);
}

#relatedTermsList {
    list-style: none;
    padding: 0;
    margin: 0;
}

.related-term-item {
    margin-bottom: 0.75rem;
}

.related-term-link {
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--text);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s;
    background: var(--bg-light);
}

.related-term-link:hover {
    background: var(--primary);
    color: var(--text-white);
    transform: translateX(0.25rem);
}

/* Cross-reference Links */
.glossary-cross-reference {
    color: var(--primary);
    text-decoration: underline;
    text-decoration-color: var(--primary);
    text-underline-offset: 2px;
    transition: all 0.2s;
}

.glossary-cross-reference:hover {
    color: var(--secondary);
    text-decoration-color: var(--secondary);
}

/* Term Category Badge */
.term-category-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--primary-50);
    color: var(--primary);
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Mobile Responsive */
@media (max-width: 992px) {
    .glossary-page-container {
        flex-direction: column;
    }
    
    .glossary-sidebar {
        width: 100%;
        margin-top: 2rem;
    }
    
    .glossary-sidebar-card {
        position: static;
    }
    
    .glossary-main-content h1 {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .glossary-main-content h1 {
        font-size: 1.75rem;
    }
    
    .glossary-content-text {
        font-size: 1rem;
    }
    
    .back-to-calculator-btn {
        width: 100%;
        justify-content: center;
        padding: 0.875rem 1.5rem;
    }
    
    .glossary-formula,
    .glossary-example {
        padding: 1rem;
    }
    
    .glossary-breadcrumb {
        font-size: 0.875rem;
    }
}

