/**
 * Unified Tooltips Styles
 * 
 * Consolidated tooltip styles used across all champion guide widgets
 * for consistent visual appearance
 * 
 * @package ChampionGuideSystem
 */

/* ====================
   Base Tooltip Styles
   ==================== */

/* Base Tooltip - wird von allen Tooltip-Typen verwendet */
.guide-tooltip,
.item-tooltip,
.spell-tooltip,
.rune-tooltip,
.champion-tooltip,
.skill-tooltip,
.alt-rune-tooltip {
    position: fixed !important;
    z-index: 999999 !important;
    background: #1a1c21;
    border: 2px solid #463715;
    border-radius: 8px;
    padding: 16px;
    max-width: 360px;
    min-width: 300px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    opacity: 0;
    display: none;
    visibility: hidden;
    transition: opacity 0.2s ease;
    color: #f0e6d2;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.guide-tooltip.show,
.item-tooltip.show,
.spell-tooltip.show,
.rune-tooltip.show,
.champion-tooltip.show,
.skill-tooltip.show,
.alt-rune-tooltip.show {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* ====================
   Tooltip Header
   ==================== */

.tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(70, 55, 21, 0.35);
}

.tooltip-item-name,
.tooltip-spell-name,
.tooltip-rune-name,
.tooltip-champion-name,
.tooltip-header h4 {
    font-size: 16px;
    font-weight: 700;
    color: #c89b3c;
    margin: 0;
    flex: 1;
}

.tooltip-item-price {
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(to bottom, #c8aa6c 0%, #785c28 100%);
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: 12px;
}

.tooltip-item-price .gold-icon {
    font-size: 10px;
    margin-right: 2px;
}

/* ====================
   Plaintext / Short Description
   ==================== */

.tooltip-item-plaintext,
.tooltip-spell-plaintext,
.tooltip-rune-plaintext {
    font-size: 13px;
    line-height: 1.5;
    color: #f0e6d2;
    margin-bottom: 12px;
    font-style: italic;
}

/* ====================
   Custom Description (from editor)
   ==================== */

.tooltip-item-custom-description,
.tooltip-spell-custom-description,
.tooltip-rune-custom-description {
    background: rgba(70, 55, 21, 0.15);
    border-left: 3px solid #463715;
    border-radius: 4px;
    padding: 10px 12px;
    margin-bottom: 12px;
    margin-top: 0;
}

/* Trennlinie nach Guide-Notiz für bessere visuelle Trennung */
.tooltip-item-custom-description + .tooltip-item-plaintext,
.tooltip-item-custom-description + .tooltip-item-tags,
.tooltip-item-custom-description + .tooltip-gold-info,
.tooltip-item-custom-description + .tooltip-item-description,
.tooltip-item-custom-description + .tooltip-item-stats,
.tooltip-spell-custom-description + .tooltip-spell-plaintext,
.tooltip-spell-custom-description + .tooltip-spell-description,
.tooltip-rune-custom-description + .tooltip-rune-description {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(200, 155, 60, 0.2);
}

.custom-description-label {
    font-size: 11px;
    font-weight: 700;
    color: #c89b3c;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.custom-description-text {
    font-size: 13px;
    color: #f0e6d2;
    line-height: 1.5;
    white-space: pre-wrap;
}

/* ====================
   Tags
   ==================== */

.tooltip-item-tags,
.tooltip-spell-tags {
    display: none !important; /* Ausgeblendet auf Wunsch */
}

.tooltip-item-tags:empty,
.tooltip-spell-tags:empty {
    display: none;
}

.item-tag,
.spell-tag {
    display: inline-block;
    padding: 3px 8px;
    background: rgba(200, 155, 60, 0.2);
    border: 1px solid rgba(200, 155, 60, 0.4);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #c89b3c;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ====================
   Gold Information
   ==================== */

.tooltip-gold-info {
    background: rgba(120, 90, 40, 0.2);
    border: 1px solid rgba(200, 155, 60, 0.3);
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 12px;
}

.gold-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.gold-info-row:last-child {
    margin-bottom: 0;
}

.gold-label {
    font-size: 12px;
    color: #a09b8c;
    font-weight: 500;
}

.gold-value {
    font-size: 13px;
    color: #f0e6d2;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
}

.gold-value .gold-icon {
    font-size: 11px;
}

/* ====================
   Main Description
   ==================== */

.tooltip-item-description,
.tooltip-spell-description,
.tooltip-rune-description {
    font-size: 13px;
    line-height: 1.5;
    color: #c8aa6e;
    margin-bottom: 10px;
}

.tooltip-item-description:empty,
.tooltip-spell-description:empty,
.tooltip-rune-description:empty {
    display: none;
}

.tooltip-item-description strong,
.tooltip-spell-description strong,
.tooltip-rune-description strong {
    color: #f0e6d2;
}

/* ====================
   Stats
   ==================== */

.tooltip-item-stats,
.tooltip-champion-stats {
    display: none !important; /* Ausgeblendet auf Wunsch */
}

.tooltip-item-stats:empty,
.tooltip-champion-stats:empty {
    display: none;
}

.stats-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-line {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    line-height: 1.5;
}

.stat-name {
    color: #a09b8c;
    font-weight: 400;
}

.stat-value {
    color: #5bc0de;
    font-weight: 600;
}

/* ====================
   Animation
   ==================== */

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.guide-tooltip.active,
.item-tooltip.active,
.spell-tooltip.active,
.rune-tooltip.active,
.champion-tooltip.active,
.skill-tooltip.active,
.alt-rune-tooltip.active {
    animation: tooltipFadeIn 0.2s ease;
}

/* Skill Tooltip spezifische Styles */
.skill-tooltip .tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.skill-tooltip .ability-key-badge {
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: rgba(200, 155, 60, 0.3);
    padding: 4px 8px;
    border-radius: 4px;
    margin-left: 8px;
}

.skill-tooltip .tooltip-level-info {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.skill-tooltip .skill-level-badge,
.skill-tooltip .ability-level-badge {
    font-size: 11px;
    font-weight: 600;
    color: #c8aa6e;
    background: rgba(200, 155, 60, 0.15);
    padding: 3px 6px;
    border-radius: 3px;
}

.skill-tooltip .skill-status {
    font-size: 11px;
    font-weight: 600;
}

.skill-tooltip .tooltip-description {
    font-size: 13px;
    line-height: 1.5;
    color: #c8aa6e;
    margin-bottom: 10px;
}

.skill-tooltip .ability-stats {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.skill-tooltip .ability-stats-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.skill-tooltip .ability-stats-row {
    display: grid;
    grid-template-columns: 68px repeat(var(--rank-columns, 3), minmax(0, 1fr));
    gap: 4px 6px;
    align-items: center;
}

.skill-tooltip .ability-stats-row--header {
    margin-bottom: 2px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.skill-tooltip .stat-label {
    color: #a09b8c;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
}

.skill-tooltip .stat-label--header {
    visibility: hidden;
}

.skill-tooltip .stat-rank-header {
    text-align: center;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #7a7568;
    text-transform: uppercase;
}

.skill-tooltip .stat-rank-header.is-current {
    color: #c89b3c;
    text-shadow: 0 0 8px rgba(200, 155, 60, 0.55);
}

.skill-tooltip .stat-cell {
    display: block;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1.3;
    padding: 4px 2px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.03);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.skill-tooltip .stat-cell.is-current {
    background: rgba(200, 155, 60, 0.14);
    box-shadow: inset 0 0 0 1px rgba(200, 155, 60, 0.35);
    font-weight: 700;
}

.skill-tooltip .stat-value--cooldown {
    color: #46d1fd;
}

.skill-tooltip .stat-value--cost {
    color: #6eb5ff;
}

.skill-tooltip .stat-value--range {
    color: #e8dcc4;
    font-size: 10px;
}

.skill-tooltip .stat-cell.is-current.stat-value--cooldown {
    color: #ffffff;
    text-shadow: 0 0 8px rgba(70, 209, 253, 0.55);
}

.skill-tooltip .stat-cell.is-current.stat-value--cost {
    color: #ffffff;
    text-shadow: 0 0 8px rgba(110, 181, 255, 0.55);
}

.skill-tooltip .stat-cell.is-current.stat-value--range {
    color: #ffffff;
    text-shadow: 0 0 8px rgba(232, 220, 196, 0.45);
}

.skill-tooltip .stat-rank-bar {
    display: block;
    height: 8px;
    border-radius: 999px;
    background: rgba(200, 155, 60, 0.1);
    overflow: visible;
}

.skill-tooltip .stat-rank-bar-fill {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
}

.skill-tooltip .stat-rank-bar.is-unlocked:not(.is-current) .stat-rank-bar-fill {
    background: linear-gradient(180deg, #c8aa6e 0%, #a07a2e 55%, #5c4520 100%);
    box-shadow:
        0 0 4px rgba(200, 155, 60, 0.4),
        0 0 10px rgba(200, 155, 60, 0.2);
}

.skill-tooltip .stat-rank-bar.is-unlocked.is-current .stat-rank-bar-fill {
    background: linear-gradient(180deg, #fff0c2 0%, #e4c472 35%, #c89b3c 100%);
    box-shadow:
        0 0 8px rgba(255, 240, 194, 0.85),
        0 0 16px rgba(200, 155, 60, 0.65),
        0 0 24px rgba(200, 155, 60, 0.35);
}

.skill-tooltip .stat-rank-bar.is-locked {
    background: rgba(0, 0, 0, 0.35);
}

.skill-tooltip .stat-rank-bar.is-locked .stat-rank-bar-fill {
    background: linear-gradient(180deg, #3a3428 0%, #2a2520 55%, #1a1815 100%);
    box-shadow: none;
    opacity: 0.55;
}

.skill-tooltip .ability-stats-row--rank {
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Tooltip below indicator */
.tooltip-below::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #463715;
}

.tooltip-below::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #463715;
}

/* ====================
   Responsive Design
   ==================== */

@media (max-width: 768px) {
    .guide-tooltip,
    .item-tooltip,
    .spell-tooltip,
    .rune-tooltip,
    .champion-tooltip,
    .skill-tooltip,
    .alt-rune-tooltip {
        max-width: 90vw;
        min-width: 280px;
        padding: 14px;
        font-size: 12px;
    }
    
    .tooltip-item-name,
    .tooltip-spell-name,
    .tooltip-rune-name,
    .tooltip-champion-name,
    .tooltip-header h4 {
        font-size: 14px;
    }
    
    .tooltip-item-price {
        font-size: 11px;
        padding: 3px 6px;
    }
    
    .tooltip-item-plaintext,
    .tooltip-spell-plaintext,
    .tooltip-rune-plaintext,
    .tooltip-item-description,
    .tooltip-spell-description,
    .tooltip-rune-description {
        font-size: 12px;
    }
    
    .tooltip-gold-info {
        padding: 8px 10px;
    }
    
    .gold-label,
    .gold-value {
        font-size: 11px;
    }
    
    .stat-line {
        font-size: 11px;
    }
    
    .custom-description-text {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .guide-tooltip,
    .item-tooltip,
    .spell-tooltip,
    .rune-tooltip,
    .champion-tooltip,
    .skill-tooltip,
    .alt-rune-tooltip {
        min-width: 260px;
        padding: 12px;
    }
    
    .tooltip-header {
        margin-bottom: 10px;
        padding-bottom: 10px;
    }
    
    .tooltip-item-name,
    .tooltip-spell-name,
    .tooltip-rune-name,
    .tooltip-champion-name,
    .tooltip-header h4 {
        font-size: 13px;
    }
}

/* ====================
   Print Styles
   ==================== */

@media print {
    .guide-tooltip,
    .item-tooltip,
    .spell-tooltip,
    .rune-tooltip,
    .champion-tooltip,
    .skill-tooltip,
    .alt-rune-tooltip {
        display: none !important;
    }
}

/* ====================
   Accessibility
   ==================== */

@media (prefers-reduced-motion: reduce) {
    .guide-tooltip,
    .item-tooltip,
    .spell-tooltip,
    .rune-tooltip,
    .champion-tooltip,
    .skill-tooltip,
    .alt-rune-tooltip {
        transition: none;
    }
    
    .guide-tooltip.active,
    .item-tooltip.active,
    .spell-tooltip.active,
    .rune-tooltip.active,
    .champion-tooltip.active,
    .skill-tooltip.active,
    .alt-rune-tooltip.active {
        animation: none;
    }
}

/* ====================
   High Contrast Mode
   ==================== */

@media (prefers-contrast: high) {
    .guide-tooltip,
    .item-tooltip,
    .spell-tooltip,
    .rune-tooltip,
    .champion-tooltip,
    .skill-tooltip,
    .alt-rune-tooltip {
        background: #000;
        border: 3px solid #fff;
    }
    
    .tooltip-header {
        border-bottom-color: #fff;
    }
    
    .tooltip-item-name,
    .tooltip-spell-name,
    .tooltip-rune-name,
    .tooltip-champion-name,
    .tooltip-header h4 {
        color: #fff;
    }
}

/* ====================
   Dark Theme Support
   ==================== */

body.dark-theme .guide-tooltip,
body.dark-theme .item-tooltip,
body.dark-theme .spell-tooltip,
body.dark-theme .rune-tooltip,
body.dark-theme .champion-tooltip,
body.dark-theme .skill-tooltip,
body.dark-theme .alt-rune-tooltip,
.dark-mode .guide-tooltip,
.dark-mode .item-tooltip,
.dark-mode .spell-tooltip,
.dark-mode .rune-tooltip,
.dark-mode .champion-tooltip,
.dark-mode .skill-tooltip,
.dark-mode .alt-rune-tooltip {
    background: #1a1c21;
}

