/* Glossary Tooltip Styling */
.legal-term {
    border-bottom: 2px solid #d3d3d3;
    /* Light grey underline */
    cursor: help;
    position: relative;
    display: inline;
    padding-bottom: 1px;
    transition: all 0.2s ease;
    font-weight: 500;
    scroll-margin-top: 100px;
    /* Offset for fixed header */
}

.legal-term:hover {
    background-color: rgba(211, 211, 211, 0.1);
    color: #808080;
}

/* Tooltip container */
.glossary-tooltip {
    position: absolute;
    z-index: 10000;
    max-width: 320px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(211, 211, 211, 0.2);
    border-radius: 0;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(211, 211, 211, 0.05);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #2c3e50;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    pointer-events: auto;
    /* Enable interaction */
}

.glossary-tooltip.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.glossary-tooltip h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 700;
    color: #d3d3d3;
    display: flex;
    align-items: center;
    gap: 8px;
}

.glossary-tooltip h4::before {
    content: 'i';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: #d3d3d3;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    line-height: 1;
}

.glossary-tooltip .definition {
    margin-bottom: 12px;
    font-weight: 400;
}

.glossary-tooltip .example {
    font-size: 13px;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 0;
    border-left: 3px solid #d3d3d3;
    font-style: italic;
    color: #555;
}

.glossary-tooltip .footer {
    margin-top: 12px;
    font-size: 12px;
    color: #95a5a6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Dark mode styling for glossary tooltip */
[data-theme="dark"] .glossary-tooltip {
    background: #000000 !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 10px 40px rgba(255, 255, 255, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.05) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .glossary-tooltip h4 {
    color: #ffffff !important;
}

[data-theme="dark"] .glossary-tooltip h4::before {
    background: #ffffff !important;
    color: #000000 !important;
}

[data-theme="dark"] .glossary-tooltip .definition {
    color: #ffffff !important;
}

[data-theme="dark"] .glossary-tooltip .example {
    background: rgba(255, 255, 255, 0.1) !important;
    border-left-color: rgba(255, 255, 255, 0.3) !important;
    color: #e0e0e0 !important;
}

[data-theme="dark"] .glossary-tooltip .footer {
    color: #b0b0b0 !important;
}

[data-theme="dark"] .glossary-tooltip .footer i {
    color: #b0b0b0 !important;
}

/* Arrow removed as per user request */

/* Offset for table rows in glossary when linked to (navbar + alphabet header on kapitel9) */
tr[id^="term-"] {
    scroll-margin-top: 220px;
}