.glossary-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Alphabet Navigation */
.glossary-alphabet {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    justify-content: center;
}

.alpha-link {
    display: inline-block;
    width: 35px;
    height: 35px;
    line-height: 35px;
    text-align: center;
    background: #0073aa;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.alpha-link:hover {
    background: #005177;
    transform: scale(1.1);
}

.alpha-link.disabled {
    background: #ddd;
    color: #999;
    cursor: not-allowed;
    pointer-events: none;
}

/* Filter Buttons */
.glossary-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.filter-btn {
    padding: 12px 24px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.filter-btn:hover {
    background: #e0e0e0;
}

.filter-btn.active {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

/* Letter Sections */
.glossary-letter-section,
.glossary-category-section {
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}

.glossary-letter-header,
.glossary-category-header {
    margin: 0;
    padding: 15px 20px;
    background: linear-gradient(135deg, #0073aa 0%, #005177 100%);
    color: white;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    transition: background 0.3s ease;
}

.glossary-letter-header:hover,
.glossary-category-header:hover {
    background: linear-gradient(135deg, #005177 0%, #003a56 100%);
}

.letter-toggle,
.category-toggle {
    display: inline-block;
    transition: transform 0.3s ease;
    font-size: 20px;
}

.collapsed .letter-toggle,
.collapsed .category-toggle {
    transform: rotate(-90deg);
}

.term-count {
    font-size: 14px;
    opacity: 0.9;
    font-weight: normal;
    margin-left: auto;
}

.glossary-letter-content,
.glossary-category-content {
    padding: 0;
    max-height: 5000px;
    overflow: hidden;
    transition: max-height 0.5s ease, padding 0.3s ease;
}

.collapsed .glossary-letter-content,
.collapsed .glossary-category-content {
    max-height: 0;
    padding: 0;
}

/* Terms */
.glossary-term {
    padding: 20px;
    background: white;
    border-bottom: 1px solid #e0e0e0;
    transition: background 0.3s ease;
}

.glossary-term:last-child {
    border-bottom: none;
}

.glossary-term:hover {
    background: #f9f9f9;
}

.glossary-term-title {
    margin: 0 0 10px 0;
    font-size: 20px;
    color: #333;
    font-weight: 600;
}

.glossary-term-definition {
    margin: 0 0 10px 0;
    color: #555;
    line-height: 1.6;
}

.glossary-term-category {
    display: inline-block;
    padding: 4px 12px;
    background: #0073aa;
    color: white;
    font-size: 12px;
    border-radius: 3px;
    font-weight: 500;
}

/* Smooth scrolling for anchor links */
html {
    scroll-behavior: smooth;
}

/* Highlight target when jumped to */
.glossary-letter-section:target {
    animation: highlight 2s ease;
}

@keyframes highlight {
    0% { background: #fff3cd; }
    100% { background: transparent; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .glossary-alphabet {
        gap: 5px;
    }
    
    .alpha-link {
        width: 30px;
        height: 30px;
        line-height: 30px;
        font-size: 14px;
    }
    
    .glossary-filters {
        flex-direction: column;
    }
    
    .filter-btn {
        width: 100%;
    }
    
    .glossary-letter-header,
    .glossary-category-header {
        font-size: 20px;
        padding: 12px 15px;
    }
    
    .term-count {
        font-size: 12px;
    }
}