/**
 * Datei: vtkc2/system/contexthelp.css
 * Funktion: Kontextbezogenes Hilfesystem - "?" Icons mit Hilfe-Popups
 * Globales, wiederverwendbares System fuer alle Module
 */

/* =============================================
   ? Icon
   ============================================= */
.contexthelp-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    cursor: pointer;
    color: var(--farbehaupt, #627E91);
    opacity: 0.55;
    transition: opacity 0.2s, color 0.2s;
    font-size: 0.85rem;
    vertical-align: middle;
    margin-left: 4px;
}

.contexthelp-icon:hover {
    opacity: 1;
    color: var(--farberand, #7B2A6E);
}

.contexthelp-icon.active {
    opacity: 1;
    color: var(--farberand, #7B2A6E);
}

/* In Überschriften: Textfarbe erben */
h2 .contexthelp-icon {
    color: inherit;
    opacity: 0.7;
}

h2 .contexthelp-icon:hover,
h2 .contexthelp-icon.active {
    color: inherit;
    opacity: 1;
}

/* Helle Variante fuer dunkle Hintergruende (z.B. Popup-Header) */
.contexthelp-icon-light {
    color: #fff;
    opacity: 0.7;
}

.contexthelp-icon-light:hover,
.contexthelp-icon-light.active {
    color: #fff;
    opacity: 1;
}

/* =============================================
   Overlay (transparent, faengt Klicks ab)
   ============================================= */
.contexthelp-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1100;
    background: transparent;
}

.contexthelp-overlay.hidden {
    display: none;
}

/* =============================================
   Popup
   ============================================= */
.contexthelp-popup {
    position: absolute;
    width: 320px;
    max-width: 90vw;
    max-height: 400px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    border: 1px solid #ddd;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Pfeil nach oben (Standard: Popup unter dem Icon) */
.contexthelp-popup::before {
    content: '';
    position: absolute;
    top: -8px;
    left: var(--arrow-left, 20px);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid var(--farbehaupt, #627E91);
}

/* Pfeil nach unten (wenn Popup ueber dem Icon) */
.contexthelp-popup.above::before {
    top: auto;
    bottom: -8px;
    border-bottom: none;
    border-top: 8px solid #f8f9fa;
}

/* Header */
.contexthelp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: var(--farbehaupt, #627E91);
    color: #fff;
    flex-shrink: 0;
}

.contexthelp-title {
    font-weight: bold;
    font-size: 0.85rem;
}

.contexthelp-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.3rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 0.2rem;
    opacity: 0.8;
}

.contexthelp-close:hover {
    opacity: 1;
}

/* Body */
.contexthelp-body {
    padding: 0.75rem;
    font-size: 0.82rem;
    line-height: 1.55;
    color: #333;
    overflow-y: auto;
    flex: 1;
}

.contexthelp-body ul {
    margin: 0.4rem 0;
    padding-left: 1.2rem;
}

.contexthelp-body li {
    margin-bottom: 0.25rem;
}

.contexthelp-body strong {
    color: var(--farbefooter, #08314E);
}

.contexthelp-body em {
    color: var(--farberand, #7B2A6E);
    font-style: normal;
    font-weight: 600;
}

/* Footer (optional, fuer Links) */
.contexthelp-footer {
    padding: 0.4rem 0.75rem;
    border-top: 1px solid #eee;
    background: #f8f9fa;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.contexthelp-footer:empty {
    display: none;
}

.contexthelp-footer a {
    color: var(--farbehaupt, #627E91);
    text-decoration: none;
}

.contexthelp-footer a:hover {
    text-decoration: underline;
}

/* =============================================
   Responsive
   ============================================= */
@media (max-width: 500px) {
    .contexthelp-popup {
        width: calc(100vw - 20px);
        left: 10px !important;
        right: 10px !important;
    }
}
