/**
 * VK Chart Builder — Template chart type styles.
 *
 * Base styles for the built-in "Cards" layout. Custom layouts registered via
 * the vk_cb_chart_templates filter can supply their own markup and CSS.
 */

.vk-chart-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.vk-chart-card {
    position: relative;
    flex: 1 1 180px;
    min-width: 180px;
    box-sizing: border-box;
    padding: 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.vk-chart-card__content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.vk-chart-card__value {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.1;
}

.vk-chart-card__title {
    font-size: 0.95rem;
    color: #555;
}

/* Optional info tooltip (shown only when a tooltip column has a value). */
.vk-chart-card__info {
    position: absolute;
    top: 12px;
    right: 12px;
}

.vk-chart-card__info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    font-size: 12px;
    font-style: italic;
    font-weight: 700;
    color: #fff;
    background: #767676;
    border-radius: 50%;
    cursor: help;
}

.vk-chart-card__tooltip {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 10;
    width: max-content;
    max-width: 240px;
    margin-top: 6px;
    padding: 8px 10px;
    font-size: 0.85rem;
    color: #fff;
    background: #2c2c2c;
    border-radius: 4px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease;
}

.vk-chart-card__info:hover .vk-chart-card__tooltip,
.vk-chart-card__info:focus-within .vk-chart-card__tooltip {
    opacity: 1;
    visibility: visible;
}
