/**
 * 3D Isometric Bar Chart Styles
 * JDIH GRMS - Modern 3D Public Statistics
 */

.chart-3d-wrapper {
    position: relative;
    width: 100%;
    min-height: 460px;
    padding: 1.5rem 1.25rem 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05);
    overflow: hidden;
}

.chart-3d-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0 0.5rem;
}

.chart-3d-dataset-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: #15803d;
}

.chart-3d-total-count {
    font-size: 12.5px;
    color: #64748b;
}

.chart-3d-svg-container {
    width: 100%;
    height: auto;
    min-height: 340px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.chart-3d-svg {
    width: 100%;
    height: auto;
    min-height: 340px;
    max-height: 520px;
    display: block;
    overflow: visible;
    filter: drop-shadow(0 10px 18px rgba(15, 23, 42, 0.06));
}

/* Background Guide Column (Track) */
.chart-3d-track {
    fill: #f1f5f9;
    fill-opacity: 0.65;
    stroke: rgba(203, 213, 225, 0.4);
    stroke-width: 0.75;
    transition: fill-opacity 0.25s ease, fill 0.25s ease;
}

.chart-3d-track-chevron {
    fill: #e2e8f0;
    fill-opacity: 0.8;
    stroke: rgba(203, 213, 225, 0.5);
    stroke-width: 0.75;
}

/* 3D Column Group */
.chart-3d-column-group {
    cursor: pointer;
    transition: filter 0.25s ease;
}

.chart-3d-column-group:hover {
    filter: brightness(1.06) drop-shadow(0 12px 24px rgba(15, 23, 42, 0.18));
}

.chart-3d-column-group:hover .chart-3d-track {
    fill-opacity: 0.9;
    fill: #e2e8f0;
}

/* Facets */
.chart-3d-face-top {
    transition: fill 0.2s ease, opacity 0.2s ease;
    filter: brightness(1.05);
}

.chart-3d-face-left {
    transition: fill 0.2s ease, opacity 0.2s ease;
}

.chart-3d-face-right {
    transition: fill 0.2s ease, opacity 0.2s ease;
}

/* Value Label floating on top */
.chart-3d-value-label {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    font-weight: 700;
    fill: #1e293b;
    text-anchor: middle;
    filter: drop-shadow(0 1px 2px rgba(255, 255, 255, 0.95));
    pointer-events: none;
    transition: transform 0.25s ease;
}

.chart-3d-column-group:hover .chart-3d-value-label {
    transform: translateY(-3px);
    fill: #0f172a;
}

/* Category Label on bottom */
.chart-3d-category-label {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 13px;
    font-weight: 600;
    fill: #334155;
    text-anchor: middle;
    pointer-events: none;
    transition: fill 0.2s ease;
}

.chart-3d-column-group:hover .chart-3d-category-label {
    fill: #0f172a;
    font-weight: 700;
}

.chart-3d-count-label {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 11px;
    font-weight: 500;
    fill: #64748b;
    text-anchor: middle;
    pointer-events: none;
}

/* Floating interactive tooltip */
.chart-3d-tooltip {
    position: absolute;
    pointer-events: none;
    z-index: 1050;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #ffffff;
    border-radius: 12px;
    font-size: 13px;
    box-shadow: 0 14px 30px -4px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.12);
    opacity: 0;
    transform: translate(-50%, -100%) scale(0.92);
    transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
}

.chart-3d-tooltip.active {
    opacity: 1;
    transform: translate(-50%, -100%) scale(1);
}

.chart-3d-tooltip::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px 6px 0 6px;
    border-style: solid;
    border-color: rgba(15, 23, 42, 0.96) transparent transparent transparent;
}

.chart-3d-tooltip-title {
    font-weight: 700;
    font-size: 13.5px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-3d-tooltip-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.chart-3d-tooltip-value {
    color: #38bdf8;
    font-weight: 700;
    font-size: 15px;
}

.chart-3d-tooltip-sub {
    color: #94a3b8;
    font-size: 11.5px;
}

.chart-3d-tooltip-breakdown {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 12px;
    min-width: 160px;
}

.chart-3d-tooltip-breakdown-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    color: #94a3b8;
    line-height: 1.6;
}

.chart-3d-tooltip-breakdown-row strong {
    color: #f8fafc;
    font-weight: 600;
}

/* Legend bar */
.chart-3d-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px dashed rgba(226, 232, 240, 0.9);
    width: 100%;
}

.chart-3d-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    cursor: default;
    transition: color 0.2s ease;
}

.chart-3d-legend-item:hover {
    color: #0f172a;
}

.chart-3d-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 4px;
}

/* Animation on entry */
@keyframes chart3dGrow {
    from {
        transform: scaleY(0);
        opacity: 0.2;
    }
    to {
        transform: scaleY(1);
        opacity: 1;
    }
}

.chart-3d-animate-grow {
    transform-box: fill-box;
    transform-origin: bottom center;
    animation: chart3dGrow 0.85s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
