/* Glossary Styles */
body.glossary-body {
    padding-top: 80px; /* Account for fixed header */
}

.glossary-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.glossary-page .breadcrumbs {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #666;
}

.glossary-page .breadcrumbs a {
    color: #007bff;
    text-decoration: none;
}

.glossary-page .breadcrumbs a:hover {
    text-decoration: underline;
}

.glossary-page h1 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 2.5rem;
}

.glossary-page .aliases {
    background: #f8f9fa;
    padding: 1rem;
    border-left: 4px solid #007bff;
    margin: 1rem 0;
    border-radius: 4px;
}

.glossary-page .definition {
    font-size: 1.1rem;
    line-height: 1.6;
    margin: 1.5rem 0;
}

.glossary-page .definition p {
    margin: 0 0 1rem 0;
}

.glossary-page .definition p:last-child {
    margin-bottom: 0;
}

.glossary-page .formula-section,
.glossary-page .example-section {
    background: #f8f9fa;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 8px;
    border-left: 4px solid #28a745;
}

.glossary-page .formula-section h2,
.glossary-page .example-section h2 {
    color: #28a745;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.glossary-page .formula-section pre {
    background: #fff;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    border: 1px solid #dee2e6;
}

.glossary-page .calculators-section {
    background: #e3f2fd;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 8px;
    border-left: 4px solid #2196f3;
}

.glossary-page .calculators-section h2 {
    color: #1976d2;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.glossary-page .cta-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.glossary-page .btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.glossary-page .btn:hover {
    background: #0056b3;
    color: white;
    text-decoration: none;
}

.glossary-page .related-terms {
    background: #fff3cd;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 8px;
    border-left: 4px solid #ffc107;
}

.glossary-page .related-terms h2 {
    color: #856404;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.glossary-page .related-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.glossary-page .related-list li {
    margin: 0.5rem 0;
}

.glossary-page .related-list a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.glossary-page .related-list a:hover {
    text-decoration: underline;
}

/* Main Glossary Index Styles */
.page-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
    padding-top: 6rem; /* Account for fixed header */
}

.page-header h1 {
    font-size: 3rem;
    color: #333;
    margin-bottom: 1rem;
}

.page-header .lead {
    font-size: 1.2rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

.search-section {
    margin-bottom: 3rem;
}

.search-container {
    display: flex;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto 2rem;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    padding: 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    min-width: 300px;
}

.search-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.search-btn, .clear-btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.search-btn {
    background: #007bff;
    color: white;
}

.search-btn:hover {
    background: #0056b3;
}

.clear-btn {
    background: #6c757d;
    color: white;
}

.clear-btn:hover {
    background: #545b62;
}

.search-results {
    margin-top: 1rem;
}

.search-results.hidden {
    display: none;
}

.letter-nav {
    margin-bottom: 3rem;
    text-align: center;
}

.letter-nav h2 {
    margin-bottom: 1.5rem;
    color: #333;
}

.letter-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.letter-btn {
    padding: 0.75rem 1rem;
    border: 2px solid #ddd;
    background: white;
    color: #333;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s;
    min-width: 50px;
    text-align: center;
}

.letter-btn:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
    text-decoration: none;
}

.letter-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.letter-btn.disabled {
    background: #f8f9fa;
    color: #6c757d;
    border-color: #e9ecef;
    cursor: not-allowed;
}

.terms-section {
    margin-bottom: 3rem;
}

.terms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.term-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s;
}

.term-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.term-card h3 {
    margin: 0 0 0.5rem 0;
    color: #007bff;
    font-size: 1.2rem;
}

.term-card h3 a {
    color: inherit;
    text-decoration: none;
}

.term-card h3 a:hover {
    text-decoration: underline;
}

.term-card .category {
    background: #e9ecef;
    color: #495057;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    display: inline-block;
    margin-bottom: 0.75rem;
}

.term-card .definition {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

.term-card .aliases {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: #888;
}

.term-card .aliases strong {
    color: #666;
}

.term-card .card-actions {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.term-card .learn-more-btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.term-card .learn-more-btn:hover {
    background: #0056b3;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination button {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    background: white;
    color: #333;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.pagination button:disabled {
    background: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
}

.pagination .current-page {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.no-results {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.no-results h3 {
    margin-bottom: 1rem;
    color: #333;
}

/* Responsive Design */
@media (max-width: 768px) {
    .page-header h1 {
        font-size: 2rem;
    }
    
    .search-container {
        flex-direction: column;
    }
    
    .search-input {
        min-width: auto;
    }
    
    .terms-grid {
        grid-template-columns: 1fr;
    }
    
    .letter-buttons {
        gap: 0.25rem;
    }
    
    .letter-btn {
        min-width: 40px;
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
}

/* Loading States */
.loading {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Footer Styles for Glossary Pages */
.footer {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    margin-top: 4rem;
    padding: 3rem 0 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.footer-brand-section {
    max-width: 300px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.footer-brand img {
    width: 36px;
    height: 36px;
}

.footer-desc {
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

.footer-section {
    display: flex;
    flex-direction: column;
}

.footer-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 1rem 0;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: #64748b;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: #6366f1;
}

.footer-bottom {
    border-top: 1px solid #e2e8f0;
    margin-top: 2rem;
    padding-top: 1.5rem;
    text-align: center;
    color: #64748b;
    font-size: 0.85rem;
}

/* Responsive Footer */
@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
    }
    
    .footer-brand-section {
        max-width: none;
    }
    
    .footer-brand {
        justify-content: center;
    }
}

/* Enhanced Definition Page Layout */
.glossary-page .breadcrumbs {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
    padding: 0.75rem 1rem;
    margin: -2rem -1rem 2rem -1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #64748b;
}

.glossary-page .breadcrumbs a {
    color: #6366f1;
    text-decoration: none;
    font-weight: 500;
}

.glossary-page .breadcrumbs a:hover {
    text-decoration: underline;
}

.glossary-page .breadcrumbs a:not(:last-child)::after {
    content: " › ";
    margin: 0 0.5rem;
    color: #94a3b8;
}

/* Enhanced CTAs and Navigation */
.glossary-navigation {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
}

.glossary-navigation h3 {
    margin: 0 0 1rem 0;
    color: #1e293b;
    font-size: 1.1rem;
}

.glossary-nav-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.glossary-nav-links .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: #6366f1;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.glossary-nav-links .btn:hover {
    background: #4f46e5;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.glossary-nav-links .btn-secondary {
    background: #64748b;
}

.glossary-nav-links .btn-secondary:hover {
    background: #475569;
}

.glossary-nav-links .btn-outline {
    background: transparent;
    color: #6366f1;
    border: 2px solid #6366f1;
}

.glossary-nav-links .btn-outline:hover {
    background: #6366f1;
    color: white;
}

/* Enhanced Related Terms Section */
.glossary-page .related-terms {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #f59e0b;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
}

.glossary-page .related-terms h2 {
    color: #92400e;
    margin-bottom: 1rem;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.glossary-page .related-terms h2::before {
    content: "🔗";
    font-size: 1.2rem;
}

.glossary-page .related-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.glossary-page .related-list li {
    margin: 0;
}

.glossary-page .related-list a {
    display: block;
    padding: 0.75rem 1rem;
    background: white;
    color: #92400e;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid #fbbf24;
}

.glossary-page .related-list a:hover {
    background: #fef3c7;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
}

/* Enhanced Calculators Section */
.glossary-page .calculators-section {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border: 1px solid #3b82f6;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
}

.glossary-page .calculators-section h2 {
    color: #1e40af;
    margin-bottom: 1rem;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.glossary-page .calculators-section h2::before {
    content: "🧮";
    font-size: 1.2rem;
}

.glossary-page .cta-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.glossary-page .cta-buttons .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: #3b82f6;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.glossary-page .cta-buttons .btn:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

/* Back to Glossary Link */
.back-to-glossary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #6366f1;
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 1rem;
    padding: 0.5rem 1rem;
    background: #f8fafc;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.back-to-glossary:hover {
    background: #eef2ff;
    color: #4f46e5;
    transform: translateX(-2px);
}

.back-to-glossary::before {
    content: "←";
    font-size: 1.2rem;
}

/* Responsive Design for Enhanced Layout */
@media (max-width: 768px) {
    .glossary-nav-links {
        flex-direction: column;
    }
    
    .glossary-nav-links .btn {
        justify-content: center;
    }
    
    .glossary-page .related-list {
        grid-template-columns: 1fr;
    }
    
    .glossary-page .cta-buttons {
        flex-direction: column;
    }
    
    .glossary-page .cta-buttons .btn {
        justify-content: center;
    }
}

/* Glossary Guide Container */
main .glossary-guide-container {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    border-top: 4px solid #007bff !important;
    margin-top: 3rem !important;
    padding: 3rem 0 !important;
    width: 100% !important;
    clear: both !important;
    display: block !important;
}

.glossary-guide-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1rem;
}

main .glossary-guide-container .glossary-guide-content h2 {
    color: #212529 !important;
    font-size: 2.2rem !important;
    font-weight: 700 !important;
    margin-bottom: 1rem !important;
    text-align: center !important;
    display: block !important;
}

main .glossary-guide-container .guide-intro {
    font-size: 1.1rem !important;
    line-height: 1.7 !important;
    color: #495057 !important;
    margin-bottom: 2.5rem !important;
    text-align: center !important;
    max-width: 800px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

main .glossary-guide-container .guide-section {
    background: #ffffff !important;
    border-radius: 12px !important;
    padding: 2rem !important;
    margin-bottom: 2rem !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08) !important;
    border: 1px solid #e9ecef !important;
    display: block !important;
}

main .glossary-guide-container .guide-section h3 {
    color: #007bff !important;
    font-size: 1.5rem !important;
    font-weight: 600 !important;
    margin-bottom: 1rem !important;
    border-bottom: 2px solid #e9ecef !important;
    padding-bottom: 0.5rem !important;
}

main .glossary-guide-container .guide-section h4 {
    color: #495057 !important;
    font-size: 1.2rem !important;
    font-weight: 600 !important;
    margin: 1.5rem 0 0.75rem 0 !important;
}

main .glossary-guide-container .guide-section p {
    color: #495057 !important;
    line-height: 1.6 !important;
    margin-bottom: 1rem !important;
}

main .glossary-guide-container .guide-section ul, 
main .glossary-guide-container .guide-section ol {
    margin: 1rem 0 !important;
    padding-left: 1.5rem !important;
}

main .glossary-guide-container .guide-section li {
    color: #495057 !important;
    line-height: 1.6 !important;
    margin-bottom: 0.5rem !important;
}

/* Case Studies */
.case-study {
    background: #f8f9fa;
    border-left: 4px solid #28a745;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 8px 8px 0;
}

.case-study h4 {
    color: #28a745;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.case-study p {
    margin-bottom: 0;
    color: #495057;
}

/* Table Styling */
.table-container {
    overflow-x: auto;
    margin: 1.5rem 0;
}

.glossary-categories-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.glossary-categories-table th {
    background: #007bff;
    color: #ffffff;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.95rem;
}

.glossary-categories-table td {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    color: #495057;
    line-height: 1.5;
}

.glossary-categories-table tr:last-child td {
    border-bottom: none;
}

.glossary-categories-table tr:nth-child(even) {
    background: #f8f9fa;
}

/* FAQ Items */
.faq-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
    border-left: 4px solid #ffc107;
}

.faq-item h4 {
    color: #ffc107;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.faq-item p {
    margin-bottom: 0;
    color: #495057;
}

/* Key Takeaway */
.key-takeaway {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 2px solid #2196f3;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    text-align: center;
}

.key-takeaway p {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 500;
    color: #1565c0;
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: #ffffff;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    margin: 2rem 0;
}

.cta-section p {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Conclusion Section */
.conclusion-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #007bff;
}

/* Responsive Design for Guide */
@media (max-width: 768px) {
    .glossary-guide-container {
        padding: 2rem 0;
    }
    
    .glossary-guide-content {
        padding: 0 0.5rem;
    }
    
    .glossary-guide-content h2 {
        font-size: 1.8rem;
    }
    
    .guide-section {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .guide-section h3 {
        font-size: 1.3rem;
    }
    
    .case-study, .faq-item {
        padding: 1rem;
    }
    
    .key-takeaway, .cta-section {
        padding: 1.5rem;
    }
    
    .glossary-categories-table th,
    .glossary-categories-table td {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
}
