/**
 * D4 Tooltip Styles
 *
 * Dedizierte CSS-Datei für alle Tooltip-Styles
 * Keine Konflikte, keine !important Overrides (außer für position/z-index)
 *
 * @package D4_Database
 * @subpackage Tooltips
 * @since 1.1.0
 */

/* ==========================================================================
   Basis Tooltip Container
   ========================================================================== */

.d4-item-tooltip {
    /* Position - MUSS !important sein für JavaScript-Positionierung */
    position: fixed !important;
    z-index: 99999 !important;
    pointer-events: none !important;

    /* Dimensionen */
    max-width: 340px;
    min-width: 280px;
    box-sizing: border-box;

    /* Border */
    border: 1px solid #3f3f46;
    border-radius: 2px;

    /* Display & Animation */
    display: block;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.15s ease-out, transform 0.15s ease-out;
}

/* Sichtbarer Tooltip */
.d4-item-tooltip.visible {
    opacity: 1;
    transform: scale(1);
}

/* Legacy-Unterstützung */
.d4-item-tooltip[style*="visible"] {
    opacity: 1;
}

/* ==========================================================================
   Tooltip Popup Content
   ========================================================================== */

/*
 * WICHTIG: Keine Background oder Border Overrides hier!
 * Diese kommen von den Inline-Styles (Rarity-Farben)
 */
.d4-tooltip-popup {
    /* Nur Layout-Regeln, keine Farben */
    font-size: 14px;
    line-height: 1.4;
}

/* Verschachtelte Elemente - keine Shadows */
.d4-item-tooltip *,
.d4-item-tooltip *:before,
.d4-item-tooltip *:after {
    box-shadow: none !important;
    filter: none !important;
    outline: none !important;
}

/* ==========================================================================
   Responsive Behavior
   ========================================================================== */

/* Mobile Tablets */
@media (max-width: 768px) {
    .d4-item-tooltip {
        max-width: 95vw;
        min-width: 280px;
        padding: 12px;
        left: 2.5vw !important;
        transform: none !important;
    }

    .d4-item-tooltip.visible {
        transform: none;
    }
}

/* Touch-Geräte - größere Touch-Targets */
@media (pointer: coarse) {
    .d4-item-tooltip {
        min-width: 300px;
        max-width: 90vw;
        font-size: 16px;
    }

    .d4-tooltip-popup {
        padding: 16px !important;
    }
}

/* Kleine Mobile Devices */
@media (max-width: 576px) {
    .d4-item-tooltip {
        max-width: 95vw;
        left: 2.5vw !important;
    }
}

/* ==========================================================================
   Performance Optimierungen
   ========================================================================== */

/* Hardware-Beschleunigung für Animationen */
.d4-item-tooltip {
    will-change: opacity, transform;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Disable animations für Nutzer die reduzierte Motion bevorzugen */
@media (prefers-reduced-motion: reduce) {
    .d4-item-tooltip {
        transition: none;
    }

    .d4-item-tooltip.visible {
        transform: none;
    }
}

/* ==========================================================================
   Debug Mode (nur wenn WP_DEBUG aktiv)
   ========================================================================== */

.d4-tooltip-debug {
    position: fixed;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.9);
    color: #0f0;
    padding: 10px;
    font-family: monospace;
    font-size: 11px;
    z-index: 100000;
    border: 1px solid #0f0;
    border-radius: 4px;
    max-width: 300px;
}
