/**
 * Knowledge Pill Internal Linking System
 * Styles for inline links, tooltip, and "Mentioned in this article" box.
 *
 * @package CreateAI
 */

/* ============================================
   KNOWLEDGE PILL LINK — inline in text
   ============================================ */

.kp-link {
    color: rgba(0, 230, 118, 0.85);
    text-decoration: none;
    border-bottom: 1px dashed rgba(0, 230, 118, 0.4);
    cursor: pointer;
    transition: color 0.2s ease, border-bottom-color 0.2s ease;
    position: relative;
}

.kp-link:hover,
.kp-link:focus {
    color: #00E676;
    border-bottom-color: rgba(0, 230, 118, 0.8);
    text-decoration: none;
    outline: none;
}

/* ============================================
   KNOWLEDGE PILL TOOLTIP
   ============================================ */

#kp-tooltip {
    position: absolute;
    z-index: 99998;
    width: 290px;
    background: rgba(4, 10, 7, 0.97);
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    border: 1px solid rgba(0, 230, 118, 0.2);
    border-radius: 14px;
    padding: 1.25rem 1.5rem;
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.75),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset,
        0 0 40px rgba(0, 230, 118, 0.06);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

#kp-tooltip.kp-tt--show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

/* Eyebrow label */
.kp-tt-eyebrow {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.6rem;
}

.kp-tt-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(0, 230, 118, 0.7);
    background: rgba(0, 230, 118, 0.08);
    border: 1px solid rgba(0, 230, 118, 0.18);
    border-radius: 4px;
    padding: 0.15rem 0.5rem;
}

/* Title */
.kp-tt-title {
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

/* Description */
.kp-tt-desc {
    font-size: 0.82rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 1.1rem;
}

/* CTA button */
.kp-tt-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-decoration: none;
    color: #000;
    background: linear-gradient(135deg, #00C853, #00E676);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 0 14px rgba(0, 230, 118, 0.3);
}

.kp-tt-btn:hover {
    background: linear-gradient(135deg, #00E676, #69F0AE);
    box-shadow: 0 0 20px rgba(0, 230, 118, 0.5);
    text-decoration: none;
    color: #000;
}

/* ============================================
   MENTIONED IN THIS ARTICLE BOX
   ============================================ */

.kp-mentioned-box {
    margin-top: 2.5rem;
    background: rgba(28, 28, 30, 0.5);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(0, 230, 118, 0.15);
    border-radius: 14px;
    padding: 1.5rem 1.75rem;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 0 50px rgba(0, 230, 118, 0.04);
}

/* Header row */
.kp-mentioned-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(0, 230, 118, 0.7);
    margin-bottom: 1.1rem;
}

.kp-mentioned-header svg {
    flex-shrink: 0;
    color: rgba(0, 230, 118, 0.6);
}

/* List */
.kp-mentioned-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Each item */
.kp-mentioned-item,
.kp-mentioned-item:visited,
.kp-mentioned-item:hover,
.kp-mentioned-item:active,
.kp-mentioned-item:focus {
    text-decoration: none;
    color: inherit;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.kp-mentioned-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.9rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 9px;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    cursor: pointer;
}

.kp-mentioned-item:hover {
    background: rgba(0, 230, 118, 0.05);
    border-color: rgba(0, 230, 118, 0.18);
    transform: translateX(3px);
}

/* Type label pill */
.kp-mentioned-item-label {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(0, 230, 118, 0.7);
    background: rgba(0, 230, 118, 0.08);
    border: 1px solid rgba(0, 230, 118, 0.15);
    border-radius: 4px;
    padding: 0.1rem 0.4rem;
    flex-shrink: 0;
    white-space: nowrap;
}

/* Entity name */
.kp-mentioned-item-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Arrow */
.kp-mentioned-item-arrow {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.3);
    transition: transform 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
}

.kp-mentioned-item:hover .kp-mentioned-item-arrow {
    transform: translateX(3px);
    color: rgba(0, 230, 118, 0.7);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    #kp-tooltip {
        width: calc(100vw - 32px);
        max-width: 320px;
    }

    .kp-mentioned-box {
        padding: 1.25rem 1.25rem;
        margin-top: 2rem;
    }
}
