/* Стилі для сторінки фінансового словника */
.glossary-section {
    padding: 60px 0;
    background-color: var(--bg-color);
}

.glossary-intro {
    margin-bottom: 30px;
    font-size: 1.1rem;
    line-height: 1.6;
    max-width: 900px;
    color: var(--text-color);
    font-family: 'Share Tech Cyr', var(--main-font);
}

/* Алфавітна навігація */
.alphabet-navigation {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin: 30px 0;
    padding: 15px;
    background-color: var(--light-bg);
    border-radius: var(--border-radius);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 70px;
    z-index: 10;
}

.alphabet-item {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 5px;
    border-radius: 50%;
    font-weight: 600;
    background-color: white;
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s ease;
    font-family: 'Share Tech Cyr', var(--main-font);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.alphabet-item:hover, .alphabet-item.active {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 59, 113, 0.2);
}

/* Стилі для блоків термінів */
.glossary-letter {
    margin-bottom: 50px;
    padding-top: 20px;
}

.letter-heading {
    font-size: 2.5rem;
    color: var(--primary-color);
    border-bottom: 3px solid var(--accent-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-family: 'Share Tech Cyr', var(--main-font);
    font-weight: 700;
}

.term-item {
    margin-bottom: 25px;
    padding: 20px;
    background-color: var(--light-bg);
    border-radius: var(--border-radius);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.term-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.term-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #ddd;
    font-family: 'Share Tech Cyr', var(--main-font);
}

.term-definition {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-color);
    font-family: 'Share Tech Cyr', var(--main-font);
}

/* Кнопка повернення вгору */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--accent-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 100;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
}

/* Стилі для спливаючих підказок термінів */
.glossary-term {
    position: relative;
    display: inline-block;
    border-bottom: 1px dotted var(--accent-color);
    color: var(--secondary-color);
    cursor: help;
    font-weight: 500;
}

.glossary-tooltip {
    visibility: hidden;
    width: 300px;
    background-color: white;
    color: var(--text-color);
    text-align: left;
    border-radius: var(--border-radius);
    padding: 15px;
    position: absolute;
    z-index: 100;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    border-left: 3px solid var(--accent-color);
    font-weight: normal;
    font-size: 0.9rem;
    line-height: 1.5;
}

.glossary-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -8px;
    border-width: 8px;
    border-style: solid;
    border-color: white transparent transparent transparent;
}

.glossary-term:hover .glossary-tooltip {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(-10px);
}

.glossary-more {
    display: block;
    margin-top: 10px;
    text-align: right;
    color: var(--secondary-color);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
}

.glossary-more:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Адаптивні стилі */
@media (max-width: 768px) {
    .alphabet-item {
        width: 35px;
        height: 35px;
        margin: 3px;
    }
    
    .glossary-tooltip {
        width: 250px;
    }
    
    .term-title {
        font-size: 1.1rem;
    }
    
    .term-definition {
        font-size: 0.95rem;
    }
    
    .alphabet-navigation {
        top: 60px;
        padding: 10px 5px;
    }
}

@media (max-width: 576px) {
    .alphabet-item {
        width: 30px;
        height: 30px;
        font-size: 0.85rem;
    }
    
    .glossary-tooltip {
        width: 200px;
        left: 0;
        transform: translateX(0);
    }
    
    .glossary-term:hover .glossary-tooltip {
        transform: translateX(0) translateY(-10px);
    }
    
    .glossary-tooltip::after {
        left: 20px;
    }
    
    .letter-heading {
        font-size: 2rem;
    }
    
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
    }
}