/* Custom styles for dashboard */
body {
    font-family: Arial, sans-serif;
    background: #fafafa;
    color: #222;
    margin: 0;
    padding: 0;
}
label {
    font-weight: bold;
    margin-bottom: 4px;
    display: block;
}
select {
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #ccc;
    min-width: 180px;
}
#controls > div {
    min-width: 220px;
}
#plots-container {
    margin-top: 16px;
}
#tab-bar {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 0;
    border-bottom: 1px solid #ccc;
}

.tab-button {
    background: #f4f4f4;
    border: 1px solid #ccc;
    border-bottom: 1px solid transparent;
    border-radius: 8px 8px 0 0;
    color: #333;
    cursor: pointer;
    font-size: 1rem;
    padding: 10px 18px;
    margin-bottom: -1px;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.tab-button:hover,
.tab-button:focus {
    background: #eaeaea;
    outline: none;
}

.tab-button.active {
    background: #fff;
    border-color: #ccc;
    border-bottom-color: #fff;
    color: #000;
    font-weight: 700;
}

.tab-panel {
    display: none;
    padding: 24px 0 16px;
    border: 1px solid #ccc;
    border-top: none;
    background: #fff;
}

#controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
}

.tab-panel.active {
    display: block;
}

#tab-contexts {
    min-height: 240px;
}

#tab-contexts .context-view-controls {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 24px;
}

#tab-contexts .context-view-controls label {
    margin-bottom: 0;
}

.stacked-filter-controls {
    display: none;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px 16px;
    width: min(90vw, 1200px);
    margin: 0 auto 20px;
    padding: 12px 16px;
    background: #f7f7f7;
    border: 1px solid #ddd;
    border-radius: 10px;
}

.stacked-filter-controls .stacked-filter-label {
    margin: 0;
    font-size: 0.95rem;
}

.stacked-filter-controls .stacked-filter-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 14px;
}

.stacked-filter-controls .stacked-filter-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 400;
    margin: 0;
}

.stacked-filter-controls .stacked-filter-option input {
    margin: 0;
}

.x-axis-label-gif-popup {
    position: absolute;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 20;
    transform: translate(-50%, -100%);
}

.x-axis-label-gif-popup.visible {
    opacity: 1;
}

.x-axis-label-gif-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 180px;
    max-width: 240px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16);
}

.x-axis-label-gif-image {
    width: 100%;
    min-height: 100px;
    background: #f6f6f6;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.x-axis-label-gif-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.x-axis-label-gif-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

.x-axis-label-gif-spinner {
    width: 32px;
    height: 32px;
    border: 4px solid rgba(0, 0, 0, 0.12);
    border-top-color: #444;
    border-radius: 50%;
    animation: xaxis-gif-spin 1s linear infinite;
}

@keyframes xaxis-gif-spin {
    to { transform: rotate(360deg); }
}

.x-axis-label-gif-text {
    font-size: 0.85rem;
    text-align: center;
    color: #111;
    line-height: 1.25;
}
