﻿@import url('https://fonts.googleapis.com/css2?family=Roboto+Condensed:ital,wght@0,400;0,500;0,700;0,800;1,400&display=swap');

:root {
    /* Colors */
    --theme-spirit-header: #a854b8;
    --theme-spirit-text: #d69aff;
    --theme-weapon-header: #c97a26;
    --theme-weapon-text: #e8b17d;
    --theme-vitality-header: #6c8316;
    --theme-vitality-text: #b9d668;
    --card-bg: #242126;
    --card-bg-pattern: #2a272c;
    --text-primary: #ffffff;
    --highlight-green: #6ff0aa;
    --active-bar-bg: #131114;
    --stat-box-bg: #302c34;
    --border-radius: 6px;
}

/* --- Wrapper & Trigger --- */
.tooltip-wrapper {
    position: relative;
    display: inline-block;
}

/* Use a specific class for the trigger in the context of the card logic */
/* Note: The main styling of the text is handled by the patch notes CSS. 
   This just handles the hover interaction structure. */
.item-hover-trigger {
    position: relative;
    cursor: help; /* Indicate interactability */
}

/* --- Card Container --- */
.ihc-card-tooltip {
    position: absolute;
    left: 50%;
    bottom: 100%; /* Position above the text */
    transform: translateX(-50%) translateY(10px);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    /* Updated transition to match ability cards */
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    margin-bottom: 10px;
    /* Reset fonts for the card specifically */
    font-family: 'Roboto Condensed', sans-serif;
    font-weight: normal;
    line-height: normal;
}

.item-hover-trigger:hover .ihc-card-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-5px);
}

.ihc-card {
    width: 340px;
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.9);
    color: var(--text-primary);
    background-image: radial-gradient(var(--card-bg-pattern) 1px, transparent 1px);
    background-size: 4px 4px;
    text-transform: none;
    text-align: left;
    font-size: 14px;
}

    /* --- Header --- */
    .ihc-card.spirit .ihc-header {
        background-color: var(--theme-spirit-header);
    }

    .ihc-card.weapon .ihc-header {
        background-color: var(--theme-weapon-header);
    }

    .ihc-card.vitality .ihc-header {
        background-color: var(--theme-vitality-header);
    }

.ihc-header {
    background-image: repeating-linear-gradient(45deg, rgba(0,0,0,0.05), rgba(0,0,0,0.05) 2px, transparent 2px, transparent 4px);
    padding: 12px 16px;
}

.ihc-item-name {
    font-size: 22px;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    line-height: 1.1;
    margin-bottom: 4px;
    color: white;
}

.ihc-item-cost {
    display: flex;
    align-items: center;
    font-size: 18px;
    font-weight: 700;
    color: var(--highlight-green);
}

.soul-icon {
    height: 16px;
    width: auto;
    margin-right: 6px;
    fill: var(--highlight-green);
}

/* --- Innate Section (Top Stats) --- */
.ihc-innate-section {
    padding: 10px 16px;
    background-color: rgba(0,0,0,0.2);
    font-size: 14px;
    font-weight: 500;
    color: #e0e0e0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ihc-innate-line {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ihc-innate-val {
    font-weight: 800;
    color: #fff;
}

/* --- Active/Passive Header Bar --- */
.ihc-ability-bar {
    background-color: var(--active-bar-bg);
    padding: 6px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255,255,255,0.08);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.ihc-ability-label {
    font-weight: 800;
    font-size: 14px;
    color: #eee;
    text-transform: capitalize;
}

.ihc-cooldown-box {
    background-color: #000;
    padding: 3px 8px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
}

.ihc-cooldown-icon {
    width: 12px;
    height: 12px;
    filter: brightness(0) invert(1);
}

/* --- Attribute Block --- */
.ihc-attribute-block {
    padding: 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

    .ihc-attribute-block:last-child {
        border-bottom: none;
    }

/* --- Description Styling with Icon Fixes --- */
.ihc-description {
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.45;
    color: #ccc;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

    /* Force inline images/svgs to be small like emojis */
    .ihc-description img,
    .ihc-description svg {
        height: 1.3em !important;
        width: auto !important;
        max-width: 100%;
        vertical-align: middle !important;
        display: inline-block;
        margin: 0 2px;
    }

.highlight {
    color: #fff;
    font-weight: 600;
}

.diminish {
    color: #888;
    font-size: 0.95em;
    display: block;
    margin-top: 6px;
}

/* --- Stats Grid --- */
.ihc-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 2px;
    padding: 0 16px 12px 16px;
}

.ihc-stat-box {
    background-color: var(--stat-box-bg);
    padding: 8px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    border-radius: 3px;
    min-height: 65px;
}

.ihc-stat-box-header {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 3px;
    justify-content: center;
}

.ihc-stat-box-icon {
    width: 14px;
    height: 14px;
    filter: brightness(0) invert(1);
}

.icon-colored {
    filter: none !important;
}

.ihc-stat-box-val {
    font-size: 17px;
    font-weight: 800;
    color: #fff;
}

/* Stat Label Wrapping */
.ihc-stat-box-label {
    font-size: 11px;
    color: #bbb;
    line-height: 1.1;
    font-weight: 500;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    padding: 0 2px;
}

.ihc-stat-conditional {
    font-size: 10px;
    font-style: italic;
    color: #777;
    margin-top: 2px;
}

/* --- Secondary Stats (Footer-like) --- */
.ihc-secondary-stats {
    padding: 8px 16px 12px 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: space-around;
    background-color: var(--card-bg);
}

.ihc-sec-stat {
    font-size: 12px;
    font-weight: 600;
    color: #bbb;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ihc-sec-stat-val {
    color: #fff;
    font-weight: 700;
    font-size: 13px;
}
