﻿
/* ============================================
   CUSTOM TOOLTIP SYSTEM
   ============================================ */
[data-tip] {
    position: relative;
    cursor: pointer;
}

[data-tip]::before,
[data-tip]::after {
    position: absolute;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--duration-fast) var(--ease-spring),
                transform var(--duration-fast) var(--ease-spring);
    transform: translateX(-50%) translateY(4px);
}

[data-tip]::before {
    content: attr(data-tip);
    bottom: calc(100% + 8px);
    left: 50%;
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    background: var(--surface-overlay);
    color: var(--text-primary);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.45;
    white-space: nowrap;
    max-width: 280px;
    white-space: normal;
    text-align: center;
    box-shadow: 0 4px 14px rgba(0,0,0,.35);
    border: 1px solid var(--border-default);
    letter-spacing: 0.01em;
}

[data-tip]::after {
    content: '';
    bottom: calc(100% + 2px);
    left: 50%;
    margin-left: -5px;
    border: 5px solid transparent;
    border-top-color: var(--surface-overlay);
}

[data-tip]:hover::before,
[data-tip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Right-aligned tooltip variant */
[data-tip-pos="right"]::before {
    left: auto;
    right: 0;
    transform: translateX(0) translateY(4px);
}
[data-tip-pos="right"]::after {
    left: auto;
    right: 14px;
    transform: translateX(0) translateY(4px);
}
[data-tip-pos="right"]:hover::before,
[data-tip-pos="right"]:hover::after {
    transform: translateX(0) translateY(0);
}

/* Left-aligned tooltip variant */
[data-tip-pos="left"]::before {
    left: 0;
    transform: translateX(0) translateY(4px);
}
[data-tip-pos="left"]::after {
    left: 14px;
    transform: translateX(0) translateY(4px);
}
[data-tip-pos="left"]:hover::before,
[data-tip-pos="left"]:hover::after {
    transform: translateX(0) translateY(0);
}

/* Light theme tooltip */
[data-theme="light"] [data-tip]::before {
    background: #1e293b;
    color: #f1f5f9;
    border-color: #334155;
    box-shadow: 0 4px 14px rgba(0,0,0,.18);
}
[data-theme="light"] [data-tip]::after {
    border-top-color: #1e293b;
}

/* ============================================
   INFO SECTION (SECTION FOOTER HINTS)
   ============================================ */
.section-info {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 18px;
    padding: 12px 16px;
    background: var(--brand-muted);
    border-left: 3px solid var(--brand);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.section-info i {
    color: var(--brand);
    font-size: 0.95rem;
    margin-top: 2px;
    flex-shrink: 0;
}

.section-info strong {
    color: var(--text-primary);
}

[data-theme="light"] .section-info {
    background: rgba(99, 102, 241, 0.07);
    border-left-color: var(--brand);
    color: var(--text-secondary);
}

/* ============================================
   SCROLL-TO-TOP BUTTON
   ============================================ */
.scroll-to-top {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 8000;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: var(--brand-gradient);
    color: #fff;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(99,102,241,.35);
    transition: opacity var(--duration-fast), transform var(--duration-fast);
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}
.scroll-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.scroll-to-top:hover {
    transform: translateY(-3px) scale(1.08);
    box-shadow: 0 6px 22px rgba(99,102,241,.45);
}

/* ============================================
   BREADCRUMB NAVIGATION
   ============================================ */
.jrl-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 0 4px 0;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.jrl-breadcrumb a {
    color: var(--brand);
    text-decoration: none;
    transition: color var(--duration-fast);
}
.jrl-breadcrumb a:hover {
    color: var(--brand-hover);
    text-decoration: underline;
}
.jrl-breadcrumb .sep {
    color: var(--text-muted);
    font-size: 0.65rem;
}
.jrl-breadcrumb .current {
    color: var(--text-secondary);
    font-weight: 600;
}

/* ============================================
   KEYBOARD SHORTCUT HINTS
   ============================================ */
.kbd-hint {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-left: 6px;
}
.kbd-hint kbd {
    display: inline-block;
    padding: 1px 5px;
    border-radius: 3px;
    background: var(--surface-overlay);
    border: 1px solid var(--border-default);
    font-family: var(--font-sans);
    font-size: 0.62rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

[data-theme="light"] .kbd-hint kbd {
    background: #e2e8f0;
    border-color: #cbd5e1;
    color: #475569;
}

/* ============================================
   ANIMATED PAGE HEADER UNDERLINE
   ============================================ */
header > div:first-child {
    position: relative;
}
header > div:first-child::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    height: 2px;
    width: 0;
    background: var(--brand-gradient);
    border-radius: 2px;
    transition: width 0.5s var(--ease-spring);
}
header:hover > div:first-child::after {
    width: 100%;
}

/* ============================================
   STAT CARD HOVER GLOW EFFECT
   ============================================ */
.stats .card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: var(--brand-gradient);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
}
.stats .card {
    position: relative;
}
.stats .card:hover::before {
    opacity: 1;
}
