/* Glossary Frontend Styles */

/* Glossary trigger styling */
.glossary-trigger {
    position: relative;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-decoration-color: #007cba;
    color: inherit;
    transition: all 0.2s ease;
}

.glossary-trigger:hover {
    /* text-decoration-color: #005a87;
    color: #005a87; */
}

.glossary-trigger.glossary-active {
    /* text-decoration-color: #005a87;
    color: #005a87; */
    /* font-weight: 600; */
}

/* Tooltip base styles */
.gt-glossary-tooltip {
    position: absolute;
    z-index: 999999;
    max-width: 350px;
    min-width: 250px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

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

/* Tooltip header */
.gt-glossary-tooltip-header {
    padding: 16px 20px 12px;
    border-bottom: 1px solid #e1e1e1;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
    position: relative;
}

.gt-glossary-tooltip-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1d2327;
    line-height: 1.3;
    padding-right: 30px;
}

.gt-glossary-tooltip-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #646970;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.gt-glossary-tooltip-close:hover {
    background: #e1e1e1;
    color: #1d2327;
}

/* Tooltip content */
.gt-glossary-tooltip-content {
    padding: 16px 20px;
    color: #3c434a;
}

.gt-glossary-tooltip-content p {
    margin: 0;
    line-height: 1.6;
}

.gt-glossary-tooltip-content p:not(:last-child) {
    margin-bottom: 12px;
}

/* Loading state */
.gt-glossary-tooltip-loading .gt-glossary-tooltip-content {
    text-align: center;
    padding: 20px;
}

.gt-glossary-loading {
    color: #fff;
    font-style: italic;
}

.gt-glossary-loading::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #e1e1e1;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: gt-glossary-spin 1s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes gt-glossary-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error state */
.gt-glossary-tooltip-error .gt-glossary-tooltip-content {
    color: #d63638;
    text-align: center;
    padding: 20px;
}

/* Tooltip arrow */
.gt-glossary-tooltip-arrow {
    position: absolute;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
}

.gt-glossary-tooltip.arrow-top .gt-glossary-tooltip-arrow {
    top: -8px;
    border-bottom: 8px solid #fff;
}

.gt-glossary-tooltip.arrow-top .gt-glossary-tooltip-arrow::before {
    content: '';
    position: absolute;
    top: 1px;
    left: -8px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #ddd;
}

.gt-glossary-tooltip.arrow-bottom .gt-glossary-tooltip-arrow {
    bottom: -8px;
    border-top: 8px solid #fff;
}

.gt-glossary-tooltip.arrow-bottom .gt-glossary-tooltip-arrow::before {
    content: '';
    position: absolute;
    top: -9px;
    left: -8px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #ddd;
}

/* Responsive design */
@media (max-width: 768px) {
    .gt-glossary-tooltip {
        max-width: 280px;
        min-width: 200px;
        font-size: 13px;
    }
    
    .gt-glossary-tooltip-header {
        padding: 12px 16px 8px;
    }
    
    .gt-glossary-tooltip-title {
        font-size: 15px;
        padding-right: 25px;
    }
    
    .gt-glossary-tooltip-close {
        top: 8px;
        right: 12px;
        width: 20px;
        height: 20px;
        font-size: 18px;
    }
    
    .gt-glossary-tooltip-content {
        padding: 12px 16px;
    }
}

@media (max-width: 480px) {
    .gt-glossary-tooltip {
        max-width: 250px;
        min-width: 180px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .gt-glossary-tooltip {
        border-width: 2px;
        border-color: #000;
    }
    
    .gt-glossary-tooltip-header {
        background: #f0f0f0;
        border-bottom-color: #000;
    }
    
    .gt-glossary-tooltip-title {
        color: #000;
    }
    
    .gt-glossary-tooltip-content {
        color: #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .gt-glossary-tooltip {
        transition: none;
    }
    
    .glossary-trigger {
        transition: none;
    }
    
    .gt-glossary-loading::before {
        animation: none;
        border: 2px solid #007cba;
    }
}

/* Print styles */
@media print {
    .gt-glossary-tooltip {
        display: none !important;
    }
    
    .glossary-trigger {
        text-decoration: none;
        font-weight: normal;
    }
}

.gt-glossary-tooltip {
    background-color: #00818A;
    border: 0;
    border-radius: 0;
    padding: 30px;
}

.gt-glossary-tooltip-header {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
}

.gt-glossary-tooltip-title {
    color: #fff;
    font-size: 23px;
    font-weight: 400;
    line-height: 135%;
    padding: 0;
}

.gt-glossary-tooltip-content {
    padding: 0;
}

.gt-glossary-tooltip-content p {
    color: #fff;
    font-size: 17px;
    font-weight: 400;
    line-height: 160%;
}

.gt-glossary-tooltip-close {
    color: #fff;
    right: -20px;
    top: -20px;
}

.gt-glossary-tooltip.arrow-bottom .gt-glossary-tooltip-arrow,
.gt-glossary-tooltip.arrow-bottom .gt-glossary-tooltip-arrow::before {
    border-top-color: #00818A;
}

.gt-glossary-tooltip.arrow-top .gt-glossary-tooltip-arrow::before,
.gt-glossary-tooltip.arrow-top .gt-glossary-tooltip-arrow {
    border-bottom-color: #00818A;
}

.gt-glossary-tooltip-close:hover {
    background-color: transparent;
    color: #fff;
}
