/**
 * RESONANZ PROFILE HEADER CARD STYLING
 * ═══════════════════════════════════════════════════════════════════════
 * Styling für die Resonanz-Profil-Karte im Header (außerhalb Scrollbereich)
 * © 2025 Ti-age.de Alle Rechte vorbehalten.
 */

.resonanz-profile-header-card {
    background: linear-gradient(135deg, #1a1a2e 0%, #0f0f1a 100%);
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: 16px;
    padding: 20px;
    margin: 16px auto;
    max-width: 900px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.resonanz-profile-header-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(139, 92, 246, 0.2);
}

.resonanz-profile-header-icon {
    font-size: 24px;
    filter: drop-shadow(0 2px 4px rgba(139, 92, 246, 0.5));
}

.resonanz-profile-header-text {
    font-size: 18px;
    font-weight: 700;
    color: #f0f0f0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.5px;
}

.resonanz-profile-header-count {
    font-size: 14px;
    color: rgba(139, 92, 246, 0.8);
    font-weight: 500;
    margin-left: auto;
}

.resonanz-profile-header-values {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.resonanz-profile-value-item {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 2px solid var(--dimension-color, rgba(139, 92, 246, 0.3));
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.resonanz-profile-value-item.clickable {
    cursor: pointer;
    user-select: none;
}

.resonanz-profile-value-item.clickable:active {
    transform: translateY(-2px) scale(0.98);
}

.resonanz-profile-value-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--dimension-color, rgba(139, 92, 246, 0.8));
    box-shadow: 0 2px 8px var(--dimension-color, rgba(139, 92, 246, 0.6));
}

.resonanz-profile-value-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3),
                0 0 20px var(--dimension-color, rgba(139, 92, 246, 0.4));
    border-color: var(--dimension-color, rgba(139, 92, 246, 0.6));
}

.resonanz-profile-value-label {
    font-size: 14px;
    font-weight: 700;
    color: var(--dimension-color, #8B5CF6);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.resonanz-profile-value-id {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.resonanz-profile-value-number {
    font-size: 32px;
    font-weight: 900;
    color: #22c55e;
    text-shadow: 0 2px 8px rgba(34, 197, 94, 0.6),
                 0 4px 16px rgba(34, 197, 94, 0.4);
    letter-spacing: 1px;
    font-variant-numeric: tabular-nums;
}

/* Responsive Design */
@media (max-width: 768px) {
    .resonanz-profile-header-card {
        margin: 12px;
        padding: 16px;
    }

    .resonanz-profile-header-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .resonanz-profile-header-count {
        margin-left: 0;
    }

    .resonanz-profile-header-values {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .resonanz-profile-value-item {
        padding: 12px;
    }

    .resonanz-profile-value-number {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .resonanz-profile-header-values {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .resonanz-profile-value-label {
        font-size: 12px;
    }

    .resonanz-profile-value-number {
        font-size: 20px;
    }
}

/* Dark Mode ist immer aktiv - kein Light-Mode Override */

/* Animation für Werte-Updates */
@keyframes valueUpdate {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.resonanz-profile-value-number.updating {
    animation: valueUpdate 0.4s ease-in-out;
}

/* Loading State Animation */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

.resonanz-profile-header-values.loading .resonanz-profile-value-item {
    position: relative;
    pointer-events: none;
}

.resonanz-profile-header-values.loading .resonanz-profile-value-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(139, 92, 246, 0.2),
        transparent
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 10px;
}

.resonanz-profile-header-values.loading .resonanz-profile-value-number {
    animation: pulse 1s infinite;
    color: rgba(255, 255, 255, 0.4);
    text-shadow: none;
}

/* ═══════════════════════════════════════════════════════════════════════
 * DELTA-ANZEIGE
 * Zeigt Änderungen der R-Faktoren live an (↑+0.05 oder ↓-0.03)
 * ═══════════════════════════════════════════════════════════════════════ */

.resonanz-profile-delta {
    position: absolute;
    top: 38px;
    right: 8px;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 6px;
    opacity: 0;
    transform: translateY(-5px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    z-index: 10;
}

.resonanz-profile-delta.delta-positive {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.9) 0%, rgba(22, 163, 74, 0.9) 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.5);
}

.resonanz-profile-delta.delta-negative {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.9) 0%, rgba(220, 38, 38, 0.9) 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.5);
}

.resonanz-profile-delta.delta-animate {
    opacity: 1;
    transform: translateY(0);
    animation: deltaPopIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Dauerhaft sichtbar (ohne Animation/Timeout) */
.resonanz-profile-delta.delta-visible {
    opacity: 1;
    transform: translateY(0);
}

.resonanz-profile-delta.delta-visible.delta-positive {
    animation: deltaPulseGreen 2s ease-in-out infinite;
}

.resonanz-profile-delta.delta-visible.delta-negative {
    animation: deltaPulseRed 2s ease-in-out infinite;
}

@keyframes deltaPopIn {
    0% {
        opacity: 0;
        transform: translateY(-10px) scale(0.8);
    }
    50% {
        transform: translateY(2px) scale(1.1);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Pulsieren für starke Änderungen */
.resonanz-profile-delta.delta-animate.delta-positive {
    animation: deltaPopIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
               deltaPulseGreen 1s ease-in-out 0.4s infinite;
}

.resonanz-profile-delta.delta-animate.delta-negative {
    animation: deltaPopIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
               deltaPulseRed 1s ease-in-out 0.4s infinite;
}

@keyframes deltaPulseGreen {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(34, 197, 94, 0.5);
    }
    50% {
        box-shadow: 0 2px 16px rgba(34, 197, 94, 0.8), 0 0 24px rgba(34, 197, 94, 0.4);
    }
}

@keyframes deltaPulseRed {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(239, 68, 68, 0.5);
    }
    50% {
        box-shadow: 0 2px 16px rgba(239, 68, 68, 0.8), 0 0 24px rgba(239, 68, 68, 0.4);
    }
}

/* ═══════════════════════════════════════════════════════════════════════
 * v3.4: RICHTUNGS-ANZEIGE
 * Zeigt ob R-Wert über oder unter Archetyp-Erwartung liegt
 * ↑ = mehr als typisch (grün)
 * ↓ = weniger als typisch (orange)
 * = = perfekte Übereinstimmung (neutral)
 * ═══════════════════════════════════════════════════════════════════════ */

.resonanz-richtung {
    display: inline-block;
    font-size: 14px;
    font-weight: 700;
    margin-left: 4px;
    padding: 1px 4px;
    border-radius: 4px;
    vertical-align: middle;
    transition: all 0.3s ease;
}

/* Mehr als Archetyp-typisch (↑) - Grün */
.resonanz-richtung.richtung-mehr {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.15);
    text-shadow: 0 1px 4px rgba(34, 197, 94, 0.5);
}

/* Weniger als Archetyp-typisch (↓) - Orange */
.resonanz-richtung.richtung-weniger {
    color: #f97316;
    background: rgba(249, 115, 22, 0.15);
    text-shadow: 0 1px 4px rgba(249, 115, 22, 0.5);
}

/* Perfekte Übereinstimmung (=) - Neutral/Blau */
.resonanz-richtung.richtung-perfekt {
    color: #8B5CF6;
    background: rgba(139, 92, 246, 0.15);
    text-shadow: 0 1px 4px rgba(139, 92, 246, 0.5);
}

/* Hover-Effekt für Tooltip */
.resonanz-richtung:hover {
    transform: scale(1.2);
    cursor: help;
}
