:root {
    --vv-tag-primary: #007bff;
    --vv-tag-primary-hover: #0056b3;
    --vv-tag-bg: #ffffff;
    --vv-tag-text: #333333;
    --vv-tag-hint-bg: rgba(255, 255, 255, 0.85);
    --vv-tag-glass-border: rgba(255, 255, 255, 0.2);
    --vv-tag-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.vv-tags-container {
    margin: 10px 0;
    padding: 0px;
    border: none;
    border-radius: 3px;
    /* background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%); */
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}


.vv-tags-group {
    margin-bottom: 15px;
    padding: 0px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.vv-tags-group:last-child {
    margin-bottom: 0;
}

.vv-tags-group.is-accordion .vv-tags-group-title {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    user-select: none;
}

.vv-tags-group.is-accordion.is-open .vv-tags-group-title {
    margin-bottom: 15px;
}

.vv-tags-group.is-accordion .vv-tags-list {
    max-height: 0;
    overflow: hidden;
    margin: 0;
    opacity: 0;
    padding-left: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.vv-tags-group.is-accordion.is-open .vv-tags-list {
    max-height: 2000px;
    opacity: 1;
    margin-top: 10px;
    overflow: visible;
}

.vv-accordion-icon {
    width: 16px;
    height: 16px;
    position: relative;
    transition: transform 0.3s ease;
}

.vv-accordion-icon::before,
.vv-accordion-icon::after {
    content: '';
    position: absolute;
    background: currentColor;
}

.vv-accordion-icon::before {
    width: 10px;
    height: 2px;
    top: 7px;
    left: 3px;
}

.vv-accordion-icon::after {
    width: 2px;
    height: 10px;
    top: 3px;
    left: 7px;
    transition: opacity 0.3s ease;
}

.vv-tags-group.is-open .vv-accordion-icon {
    transform: rotate(180deg);
}

.vv-tags-group.is-open .vv-accordion-icon::after {
    opacity: 0;
}

.vv-tags-group-title {
    position: relative;
    z-index: 1;
    margin-bottom: 8px;
    font-size: 13px;
    color: #495057;
    text-transform: uppercase;
}

.vv-tags-list {
    position: relative;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 0;
    list-style: none;
    align-items: center;
}

.vv-tag-wrapper {
    position: relative;
    display: inline-block;
}

.vv-tag-wrapper:hover {
    z-index: 999;
}

.vv-tags-group:hover {
    z-index: 10;
}

.vv-tag-item {
    display: inline-block;
    padding: 6px 14px;
    background: var(--vv-tag-primary);
    color: #ffffff;
    border-radius: 30px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    line-height: normal;
}

.vv-tag-image {
    display: block;
    max-width: 100%;
    height: auto;
    width: auto;
    border-radius: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.vv-tag-item:has(.vv-tag-image) {
    background: transparent !important;
    color: inherit !important;
    border: none !important;
    padding: 2px !important;
    font-size: inherit !important;
    box-shadow: none !important;
}

.vv-tag-image[style*="border-color"] {
    border-color: inherit !important;
}

.vv-tag-item img.vv-tag-image {
    padding: 0px;
}

.vv-tag-image {
    background: transparent !important;
    color: inherit !important;
}

.vv-tag-item img.vv-tag-image[style*="border-color"] {
    border-color: inherit !important;
}

.vv-tag-item img.vv-tag-image[style*="1px solid"] {
    border: inherit !important;
}

.vv-tag-item img.vv-tag-image {
    box-shadow: inherit !important;
}

.vv-tag-wrapper[data-display="popup"] .vv-tag-item {
    cursor: pointer;
}

.vv-tag-wrapper[data-display="popup"] .vv-tag-item:hover {
    background: var(--vv-tag-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(177 177 177 / 30%);
}

.vv-tag-wrapper[data-display="popup"] .vv-tag-item:hover .vv-tag-image {
    transform: scale(1.05);
}

.vv-tag-hint {
    visibility: hidden;
    box-sizing: border-box;
    width: min(350px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    background: var(--vv-tag-hint-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--vv-hint-color, var(--vv-tag-text));
    text-align: left;
    border-radius: 12px;
    padding: 12px;
    position: absolute;
    z-index: 1000;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--vv-tag-glass-border);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.vv-tag-hint.is-visible {
    visibility: visible;
    opacity: 1;
    /* transform задає JS (viewport clamp) або лишається translateX(-50%) за замовчуванням */
}

/* Колір групи на контейнері; span з TinyMCE (виділення кольором) НЕ чіпаємо */
.vv-tag-hint .vv-tag-hint-content {
    font-size: inherit !important;
    line-height: 1.45;
    color: inherit !important;
}

.vv-tag-hint .vv-tag-hint-content > p,
.vv-tag-hint .vv-tag-hint-content > ul,
.vv-tag-hint .vv-tag-hint-content > ol,
.vv-tag-hint .vv-tag-hint-content > li,
.vv-tag-hint .vv-tag-hint-title {
    font-size: inherit !important;
    line-height: 1.45;
    /* inherit без !important — щоб inline color з редактора на span/p працював */
    color: inherit;
}

.vv-tag-hint-title {
    font-weight: 600;
    margin: 0 0 8px 0;
}

.vv-tag-popup-inner,
.vv-tag-modal-content .vv-tag-popup-inner {
    font-size: inherit !important;
    color: inherit !important;
}

.vv-tag-popup-inner .vv-tag-hint-text,
.vv-tag-modal-content .vv-tag-hint-text {
    font-size: inherit !important;
    line-height: 1.45;
    color: inherit !important;
}

.vv-tag-popup-inner .vv-tag-hint-text > p,
.vv-tag-modal-content .vv-tag-hint-text > p {
    font-size: inherit !important;
    color: inherit;
}

.vv-tag-hint::after {
    content: "";
    position: absolute;
    top: 100%;
    left: var(--vv-arrow-left, 50%);
    margin-left: -6px;
    border-width: 6px;
    border-style: solid;
    border-color: rgba(255, 255, 255, 0.8) transparent transparent transparent;
}

.vv-tag-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
}

.vv-tag-modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 35px;
    border-radius: 20px;
    max-width: 550px;
    width: 90%;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--vv-tag-glass-border);
    animation: vvModalFadeIn 0.4s ease-out;
}

@keyframes vvModalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.vv-tag-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 32px;
    font-weight: 300;
    color: #adb5bd;
    cursor: pointer;
    background: none;
    border: none;
    line-height: 1;
    padding: 0;
    z-index: 10;
    transition: color 0.2s;
}

.vv-tag-modal-close:hover {
    color: #495057;
}

.vv-tag-popup-inner h3 {
    margin-top: 0;
    font-size: 22px;
    color: var(--vv-tag-primary);
    border-bottom: 2px solid #f1f3f5;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.vv-tag-hint-text {
    font-size: inherit;
    line-height: 1.6;
}

@media (max-width: 767px) {
    .vv-tag-hint {
        width: min(350px, calc(100vw - 24px));
        max-width: calc(100vw - 24px);
    }

    .vv-tag-modal-content {
        padding: 25px;
    }
}

.vv-tag-hint.align-left { }

.vv-tag-hint.align-right { }

.vv-tag-hint.align-left::after {
    left: 20px !important;
    margin-left: 0 !important;
}

.vv-tag-hint.align-right::after {
    left: auto !important;
    right: 20px !important;
    margin-left: 0 !important;
}

.vv-tag-hint.is-visible.align-left, .vv-tag-hint.is-visible.align-right { }


/* ===== Shared floating tooltip (body) ===== */
.vv-tag-float-hint {
    contain: layout style;

    position: fixed;
    z-index: 2147483000;
    left: 0;
    top: 0;
    width: min(320px, calc(100vw - 20px));
    max-width: calc(100vw - 20px);
    box-sizing: border-box;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.97);
    color: var(--vv-hint-color, #333);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
    font-size: 12px;
    line-height: 1.45;
    text-align: left;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.vv-tag-float-hint.is-visible {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.vv-tag-float-hint-inner {
    position: relative;
    z-index: 1;
    color: inherit;
    font-size: inherit;
    line-height: 1.45;
}
.vv-tag-float-hint-inner p,
.vv-tag-float-hint-inner li {
    color: inherit;
    font-size: inherit;
}

.vv-tag-float-title {
    font-weight: 600;
    margin: 0 0 6px;
    font-size: 13px;
}

.vv-tag-float-hint-inner p {
    margin: 0 0 0.4em;
}
.vv-tag-float-hint-inner p:last-child {
    margin-bottom: 0;
}

.vv-tag-float-arrow {
    position: absolute;
    width: 10px;
    height: 10px;
    background: inherit;
    border: inherit;
    box-sizing: border-box;
    transform: rotate(45deg);
    left: var(--vv-float-arrow-x, 20px);
    margin-left: -5px;
    pointer-events: none;
}

/* tip below tag → arrow on top edge */
.vv-tag-float-hint.place-bottom .vv-tag-float-arrow {
    top: -5px;
    border-bottom: none;
    border-right: none;
}

/* tip above tag → arrow on bottom edge */
.vv-tag-float-hint.place-top .vv-tag-float-arrow {
    bottom: -5px;
    border-top: none;
    border-left: none;
}

/* removed: overflow on html/body caused page scroll jump to top */

/* original per-tag hints are unused when JS runs; keep for no-js */
.vv-tag-wrapper[data-display="simple"] .vv-tag-hint {
    /* JS hides via style.display=none; this is fallback */
}
