/* ===================================================
   COMPONENT: Variant/Logogram Citation Links
   - Styles for clickable variants/logograms that show
     linked citations in a dropdown
   =================================================== */

/* === BASE LINK STYLES === */
.variant-link,
.logogram-link {
    position: relative;
    cursor: default;
    transition: all 0.2s ease;
}

/* Single citation: clickable but no special styling */
.variant-link.has-single-citation,
.logogram-link.has-single-citation {
    cursor: pointer;
}

/* Multiple citations: show as clickable with hover effect */
.variant-link.has-multiple-citations,
.logogram-link.has-multiple-citations {
    cursor: pointer;
}

.variant-link.has-multiple-citations:hover,
.logogram-link.has-multiple-citations:hover {
    text-decoration: underline;
}

/* Citation count - simple superscript number (only for multiple) */
.variant-link .citation-count-badge,
.logogram-link .citation-count-badge {
    display: inline;
    font-size: 0.65em;
    color: var(--celestial-blue, #4a90d9);
    vertical-align: super;
    line-height: 1;
    font-weight: normal;
    margin-left: 1px;
}

/* === DROPDOWN CONTAINER (tooltip-like styling) === */
/* Appended to document.body with fixed positioning to avoid overflow clipping */
.variant-citation-dropdown {
    position: fixed;
    z-index: 99999;
    min-width: 500px;
    max-width: 600px;
    max-height: 400px;
    overflow-y: auto;
    background-color: #f5f5f5;
    border-radius: var(--tooltip-border-radius, 6px);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.3);
    display: none;
    font-style: normal;
}

.variant-citation-dropdown.active {
    display: block;
}

/* Arrow pointing up - matches header */
.variant-citation-dropdown::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 20px;
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent rgba(44, 62, 80, 0.9) transparent;
}

/* Dropdown header - charcoal with opacity */
.variant-citation-dropdown .dropdown-header {
    padding: 8px 12px;
    font-weight: 600;
    font-size: 0.85em;
    color: #fff;
    background-color: var(--tooltip-background);
    border-radius: var(--tooltip-border-radius, 6px) var(--tooltip-border-radius, 6px) 0 0;
}

/* Content area - gray background */
.variant-citation-dropdown .dropdown-content {
    background-color: #f5f5f5;
    border-radius: 0 0 var(--tooltip-border-radius, 6px) var(--tooltip-border-radius, 6px);
}

/* === CITATION ITEM === */
.variant-citation-item {
    padding: 8px 12px;
    border-bottom: 1px solid #e0e0e0;
    cursor: pointer;
    transition: background-color 0.15s ease;
    line-height: 1.4;
    color: #333;
}

.variant-citation-item:last-child {
    border-bottom: none;
}

.variant-citation-item:hover {
    background-color: #e8e8e8;
}

/* Period gloss - inline */
.variant-citation-item .period-gloss {
    font-weight: 600;
    color: #2c5282;
    text-transform: uppercase;
    font-size: 0.8em;
}

/* Quote text - inline italic */
.variant-citation-item .quote-text {
    font-style: italic;
    color: #1a1a1a;
}

/* Bibliography - inline */
.variant-citation-item .bibl-text {
    color: #555;
}

/* Translation - inline with quotes */
.variant-citation-item .trans-text {
    color: #444;
}

/* === HIGHLIGHT ANIMATION === */
@keyframes citation-highlight-pulse {
    0% { background-color: rgba(74, 144, 217, 0.3); }
    100% { background-color: transparent; }
}

.citation-highlight {
    animation: citation-highlight-pulse 1.5s ease-out;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .variant-citation-dropdown {
        position: fixed;
        left: 10px;
        right: 10px;
        top: auto;
        bottom: 20px;
        max-width: none;
        width: auto;
    }

    .variant-citation-dropdown::before {
        display: none;
    }
}

/* === EDITOR-XML SPECIFIC STYLES === */
/* Editor uses tooltip instead of dropdown - subtle indicator */
.xml-visual-editor .variant-link.has-citations,
.xml-visual-editor .logogram-link.has-citations {
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-decoration-color: rgba(74, 144, 217, 0.6);
}

.xml-visual-editor .variant-link.has-citations:hover,
.xml-visual-editor .logogram-link.has-citations:hover {
    text-decoration-color: rgba(74, 144, 217, 1);
}

/* === CITATION REFERENCE NOTES (variant-ref, logogram-ref) === */
/* Individual reference note - inline with left border only */
.citation-ref-note {
    display: inline;
    padding-left: 6px;
    margin-left: 4px;
}

/* Label styling */
.citation-ref-note .ref-note-label {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75em;
    padding: 1px 4px;
    border-radius: 2px;
}

/* Value styling */
.citation-ref-note .ref-note-value {
}

/* Variant reference note - purple left border */
.variant-ref-note {
    color: #495057;
    background: aliceblue;
}

.variant-ref-note .ref-note-label {
    color: #212529;
}

/* Logogram reference note - teal left border */
.logogram-ref-note {
    color: #495057;
    background: aliceblue;
}

.logogram-ref-note .ref-note-label {
    color: #212529;
}
