.responsive-collapse {
    padding: 10px;
    font-size: 14px;
    display: flex;
    flex-direction: row;
    gap: 16px;
    background: var(--background-tertiary);
}

/* Simple common block styles */
.simple-common-block {
    border-right: 1px solid var(--neutral-500);
    padding: 0 16px;
    width: 441px;
}



/* Info stack */
.info-stack {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--text-primary);
    flex-direction: column;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: space-between;
}

.status-value.firing {
    color: var(--status-badge-firing);
    font-weight: 600;
}

.status-value.resolved {
    color: var(--status-badge-resolved);
    font-weight: 600;
}

.status-value.unknown {
    color: var(--status-badge-unknown);
    font-weight: 600;
}

.status-value.closed {
    color: var(--text-secondary);
    font-weight: 600;
}

.incident-link {
    color: var(--link-primary);
    text-decoration: none;
    font-size: 14px;
}

.incident-link:hover {
    color: var(--link-hover);
}

/* Labels and annotations sections */
.labels-section,
.annotations-section {
    gap: 8px;
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 12px;
    /* justify-content: space-between; */
}

/* Specific styling for simple common block labels section */
.simple-common-block .labels-section,
.simple-common-block .annotations-section {
    justify-content: flex-end;
}

.simple-common-block .labels-section .section-header,
.simple-common-block .annotations-section .section-header {
    flex: 1;
}

.section-header {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 3px;
    align-content: center;
}

.label-pill {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
    background-color: var(--label-background);
    color: var(--label-text);
}

.label-pill.group-label {
    background-color: var(--label-background);
    color: var(--label-text);
    font-weight: 500;
}

.annotation-pill {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
    border: 1.3px solid var(--annotation-border);
    background-color: transparent;
    color: var(--annotation-text);
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Alerts section styles */
.alerts-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.alerts-label {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.alerts-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.collapse-section {
    margin-bottom: 20px;
}

.collapse-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: var(--text-primary);
}

.collapse-content {
    padding-left: 10px;
}

.collapse-item {
    margin-bottom: 10px;
}

.collapse-item strong {
    color: var(--text-secondary);
    margin-right: 5px;
}

.collapse-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
}

.label-item {
    background-color: var(--background-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 14px;
    color: var(--text-primary);
    display: inline-block;
}

/* Tabulator specific overrides */
.tabulator-responsive-collapse {
    border-top: 1px solid var(--border-secondary);
    border-bottom: 1px solid var(--border-secondary);
    background-color: var(--background-tertiary);
    margin-top: -1px;
    position: relative;
    overflow: visible !important;
}

.tabulator-responsive-collapse-toggle {
    position: relative;
    padding: 8px !important;
    box-sizing: border-box;
    width: 30px;
    max-width: 30px;
    background: none !important;
}

.tabulator-responsive-collapse-toggle-open {
    fill: transparent !important;
    stroke: transparent !important;
}

.tabulator-responsive-collapse-toggle-close {
    fill: transparent !important;
    stroke: transparent !important;
}

.tabulator .tabulator-responsive-collapse-toggle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    border-left: 2px solid var(--text-primary);
    border-top: 2px solid var(--text-primary);
    transform: translate(-50%, -50%) rotate(-135deg);
}

.tabulator .tabulator-responsive-collapse-toggle.open::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.tabulator .tabulator-footer .tabulator-page:disabled {
    opacity: .4;
    font-size: 18px;
}

.info-block {
    background-color: var(--info-block-background);
    border-radius: 8px;
    padding-bottom: 20px;
    padding-left: 8px;
    padding-right: 8px;
    padding-top: 4px;
}

.common-info-block {
    width: 500px;
    padding: 20px 12px;
}

.alert-info-block {
    width: 330px;
}

.labels-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.block-separator {
    border: none;
    border-top: 1px solid var(--border-secondary);
    margin: 8px 0;
}

.status-badge {
    display: inline-block;
    font-size: 0;
    width: 12px;
    height: 12px;
    background-color: var(--status-badge-firing);
    border-radius: 50%;
}

.status-badge.firing {
    background-color: var(--status-badge-firing);
    color: var(--text-inverse);
}

.status-badge.resolved {
    background-color: var(--status-badge-resolved);
    color: var(--text-inverse);
}

.status-badge.unknown {
    background-color: var(--status-badge-unknown);
    color: var(--text-inverse);
}

.status-badge.closed {
    background-color: var(--status-badge-closed);
    color: var(--text-inverse);
}

.alert-header {
    display: flex;
    gap: 16px;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    border-bottom: 1.3px solid var(--border-secondary);
    justify-content: space-between;
    align-items: center;
    height: 20px;
}

.generator-link {
    color: var(--link-primary);
    text-decoration: none;
    font-size: 14px;
}

.generator-link:hover {
    text-decoration: underline;
    color: var(--link-hover);
}

.highlighted-labels {
    margin-bottom: 8px;
}

.label {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    background: var(--label-background);
    font-size: 14px;
    color: var(--label-text);
}

.label.highlighted {
    background: var(--label-highlighted-background);
    color: var(--label-highlighted-text);
    font-weight: 500;
}

.block-annotations {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 12px;
    position: relative;
    z-index: 1;
}

.annotation {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1.3px solid var(--annotation-border);
    font-size: 14px;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    position: relative;
    color: var(--annotation-text);
    line-height: 1.2;
    vertical-align: middle;
}

.annotation.common {
    max-width: 408px;
    mask-image: linear-gradient(to right, black 363px, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 363px, transparent 100%);
}

.annotation.alert {
    max-width: 311px;
    mask-image: linear-gradient(to right, black 286px, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 286px, transparent 100%);
}

.block-labels {
    margin-bottom: 8px;
}

/* Tooltip styles */
.annotation-wrapper,
.label-wrapper,
.time-wrapper {
    position: relative;
    display: inline-block;
    place-items: center;
}

.tooltip-text {
    visibility: hidden;
    background-color: var(--tooltip-background);
    color: var(--text-inverse);
    text-align: left;
    padding: 8px;
    border-radius: 4px;
    position: absolute;
    white-space: pre-wrap;
    min-width: 200px;
    max-width: 400px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    font-size: 14px;
    line-height: 1.4;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    bottom: calc(100% + 8px);
}

/* Add invisible bridge between wrapper and tooltip */
.annotation-wrapper:hover::before,
.label-wrapper:hover::before,
.time-wrapper:hover::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    height: 8px;
    pointer-events: auto;
}

.annotation-wrapper:hover .tooltip-text,
.time-wrapper:hover .tooltip-text,
.label-wrapper:hover .tooltip-text,
.tooltip-text:hover {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

/* Time tooltip specific styles */
.time-tooltip {
    font-family: monospace;
    white-space: pre;
    left: 50%;
    transform: translateX(-50%);
}

/* Ensure tooltip is above other content */
.block-annotations {
    position: relative;
}

.annotation .tooltip-text {
    position: fixed;
    transform: translateY(-100%);
}

/* Fix annotation tooltip positioning */
.annotation.tooltip {
    position: static;
}

.annotation .tooltip-text {
    position: fixed;
    transform: translateY(-100%);
    margin-top: -8px;
}

/* Ensure all parent containers allow overflow */
.block-annotations,
.block-labels,
.info-block,
.alert-info-block,
.common-info-block,
.alerts-wrapper,
.responsive-collapse {
    overflow: visible !important;
}

.label.common {
    max-width: 408px;
    mask-image: linear-gradient(to right, black 363px, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 363px, transparent 100%);
}

.label.alert {
    max-width: 311px;
    mask-image: linear-gradient(to right, black 286px, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 286px, transparent 100%);
}
