/* ============================================
   CORPUS LINK STYLES - Enhanced Theme-Aware
   ============================================ */

/* Base Corpus Link Styling */
.corpus-link {
    position: relative;
    text-decoration: none;
    font-weight: var(--font-semibold, 600);
    border-bottom: 2px dashed var(--corpus-link-color, var(--color-accent));
    color: var(--corpus-link-color, var(--color-accent));
    transition: all 0.3s ease;
    padding-bottom: 2px;
    display: inline;
}

/* Book Icon Indicator */
.corpus-link::before {
    content: "📖";
    font-size: 0.75em;
    margin-right: 4px;
    opacity: 0.8;
    transition: opacity 0.3s ease;
    display: inline;
}

/* Hover State */
.corpus-link:hover {
    color: var(--corpus-link-hover, var(--color-primary));
    border-bottom-style: solid;
    border-bottom-width: 3px;
    border-bottom-color: var(--corpus-link-hover, var(--color-primary));
}

.corpus-link:hover::before {
    opacity: 1;
}

/* Tooltip on Hover */
.corpus-link:hover::after {
    content: "📚 View in ancient texts";
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-surface);
    color: var(--color-text-primary);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--text-xs);
    white-space: nowrap;
    box-shadow: var(--shadow-2xl);
    border: 2px solid var(--corpus-link-color, var(--color-accent));
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    animation: tooltipFadeIn 0.3s ease forwards 0.2s;
}

@keyframes tooltipFadeIn {
    to { opacity: 1; }
}

/* ============================================
   THEME-SPECIFIC CORPUS LINK COLORS
   ============================================ */

/* Day Theme - Warm scholarly brown */
[data-theme="day"] .corpus-link {
    --corpus-link-color: #8B4513;
    --corpus-link-hover: #CD853F;
}

/* Night Theme - Deep purple */
[data-theme="night"] .corpus-link {
    --corpus-link-color: #9370DB;
    --corpus-link-hover: #BA55D3;
}

/* Fire Theme - Ember orange */
[data-theme="fire"] .corpus-link {
    --corpus-link-color: #FF6347;
    --corpus-link-hover: #FF8C00;
}

/* Water Theme - Deep ocean blue */
[data-theme="water"] .corpus-link {
    --corpus-link-color: #4682B4;
    --corpus-link-hover: #87CEEB;
}

/* Earth Theme - Forest green */
[data-theme="earth"] .corpus-link {
    --corpus-link-color: #228B22;
    --corpus-link-hover: #32CD32;
}

/* Air Theme - Sky cyan */
[data-theme="air"] .corpus-link {
    --corpus-link-color: #00CED1;
    --corpus-link-hover: #40E0D0;
}

/* Celestial Theme - Starlight gold */
[data-theme="celestial"] .corpus-link {
    --corpus-link-color: #FFD700;
    --corpus-link-hover: #FFA500;
}

/* Abyssal Theme - Dark crimson */
[data-theme="abyssal"] .corpus-link {
    --corpus-link-color: #DC143C;
    --corpus-link-hover: #FF1493;
}

/* ============================================
   TRADITION-SPECIFIC OVERRIDES
   ============================================ */

/* Jewish Tradition - Sapphire blue */
.tradition-jewish .corpus-link {
    --corpus-link-color: #4169E1;
    --corpus-link-hover: #1E90FF;
}

/* Christian Tradition - Byzantine purple */
.tradition-christian .corpus-link {
    --corpus-link-color: #8B008B;
    --corpus-link-hover: #BA55D3;
}

/* Islamic Tradition - Emerald green */
.tradition-islamic .corpus-link {
    --corpus-link-color: #2E8B57;
    --corpus-link-hover: #3CB371;
}

/* Hindu Tradition - Saffron orange */
.tradition-hindu .corpus-link {
    --corpus-link-color: #FF8C00;
    --corpus-link-hover: #FFA500;
}

/* Buddhist Tradition - Lotus pink */
.tradition-buddhist .corpus-link {
    --corpus-link-color: #FF69B4;
    --corpus-link-hover: #FF1493;
}

/* Egyptian Tradition - Bronze */
.tradition-egyptian .corpus-link {
    --corpus-link-color: #CD853F;
    --corpus-link-hover: #DAA520;
}

/* Greek Tradition - Olympian gold */
.tradition-greek .corpus-link {
    --corpus-link-color: #DAA520;
    --corpus-link-hover: #FFD700;
}

/* Roman Tradition - Imperial purple */
.tradition-roman .corpus-link {
    --corpus-link-color: #9370DB;
    --corpus-link-hover: #BA55D3;
}

/* Norse Tradition - Runic silver */
.tradition-norse .corpus-link {
    --corpus-link-color: #C0C0C0;
    --corpus-link-hover: #E5E5E5;
}

/* Celtic Tradition - Druid green */
.tradition-celtic .corpus-link {
    --corpus-link-color: #2E8B57;
    --corpus-link-hover: #3CB371;
}

/* Chinese Tradition - Jade green */
.tradition-chinese .corpus-link {
    --corpus-link-color: #00A86B;
    --corpus-link-hover: #50C878;
}

/* Babylonian Tradition - Lapis lazuli blue */
.tradition-babylonian .corpus-link {
    --corpus-link-color: #4169E1;
    --corpus-link-hover: #6495ED;
}

/* Sumerian Tradition - Clay brown */
.tradition-sumerian .corpus-link {
    --corpus-link-color: #A0826D;
    --corpus-link-hover: #C19A6B;
}

/* Persian Tradition - Fire red */
.tradition-persian .corpus-link {
    --corpus-link-color: #DC143C;
    --corpus-link-hover: #FF6347;
}

/* Tarot Tradition - Mystical violet */
.tradition-tarot .corpus-link {
    --corpus-link-color: #9370DB;
    --corpus-link-hover: #BA55D3;
}
