:root {
    --cube-size: 400px;
    --cube-margin: 40px;
    --cube-padding: 20px;
}

.triaxis-container {
    font-family: 'Arial', sans-serif;
    background: radial-gradient(circle at center, #0f2a44 0%, #0b1b2b 100%);
    color: #e0e6f0;
    padding: 20px;
    overflow-x: hidden;
}

.matrix-header {
    text-align: center;
    margin-bottom: 30px;
}
.matrix-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
}
.matrix-header p {
    font-size: 1.1rem;
    color: #7f8c8d;
}

.cube-wrapper {
    position: relative;
    background: transparent;
    border-radius: 20px;
    padding: 40px;
    margin: 0 auto;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Mode Toggle */
.mode-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}
.mode-btn {
    padding: 10px 24px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid #3498db;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    color: #e0e6f0;
}
.mode-btn.active {
    background: #3498db;
    color: white;
    box-shadow: 0 0 20px rgba(52, 152, 219, 0.5);
}
.mode-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

/* Cube Controls */
.cube-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    /* flex-wrap: wrap; */
    margin-top: -80px;
    padding-right: 800px;
}
.control-btn {
    padding: 10px 20px;
    background: #ffffff;
    border: 2px solid #4a4a4a;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    color: #2c3e50;
}
.control-btn:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}
.control-btn.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}
.controls-hidden { display: none !important; }

/* Category Filters */
.category-filters {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 80px;
    padding-left: 800px;
    margin-top: -70px;
    /* flex-wrap: wrap; */
}
.filter-btn {
    padding: 8px 16px;
    background: #ffffff;
    border: 2px solid #e8edf6;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    color: #2c3e50;
}
.filter-btn:hover {
    background: #f8f9fa;
    border-color: #4a4a4a;
}
.filter-btn.active {
    background: #2c3e50;
    color: white;
    border-color: #2c3e50;
}

/* 3D MODE - Cube Scene */
.cube-scene {
    width: var(--cube-size);
    height: var(--cube-size);
    perspective: 1200px;
    perspective-origin: 50% 50%;
    margin: var(--cube-margin) auto;
    position: relative;
    filter: drop-shadow(0 20px 40px rgba(0,0,0,0.6));
    cursor: grab;
    user-select: none;
    transition: all 0.5s ease;
}
.cube-scene.mode-3d { opacity: 1; visibility: visible; }
.cube-scene.mode-2d { opacity: 0; visibility: hidden; position: absolute; }
.cube-scene:active { cursor: grabbing; }

.cube {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    animation: autoRotate 20s infinite linear;
    transition: transform 0.5s ease;
    transform: rotateX(-15deg) rotateY(0deg) translateZ(0);
    pointer-events: none;
}
@keyframes autoRotate {
    0% { transform: rotateX(-15deg) rotateY(0deg) translateZ(0); }
    25% { transform: rotateX(-15deg) rotateY(90deg) translateZ(0); }
    50% { transform: rotateX(-15deg) rotateY(180deg) translateZ(0); }
    75% { transform: rotateX(-15deg) rotateY(270deg) translateZ(0); }
    100% { transform: rotateX(-15deg) rotateY(360deg) translateZ(0); }
}
.cube.paused { animation-play-state: paused; }

/* Glass Cube Faces - Transparent with Border Lines Only */
.cube-face {
    position: absolute;
    width: 400px;
    height: 400px;
    border: 2px solid rgba(100, 200, 255, 0.4);
    backface-visibility: hidden;
    background: transparent;
    pointer-events: none;
    box-shadow: none;
}

/* Hide old axis labels inside cube faces */
.cube-face .axis-label {
    display: none !important;
}

/* NEW: 3D Cube Axis Labels - Floating Outside with Billboard Effect */
.cube-axis-label {
    position: absolute;
    display: flex;
    flex-direction: column;
    gap: 4px;
    pointer-events: none;
    z-index: 1000;
    font-family: 'Inter', Arial, sans-serif;
    transform-style: flat;
    backface-visibility: visible;
}

.cube-axis-label .axis-title {
    font-size: 16px;
    font-weight: 700;
    color: #FFD700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    letter-spacing: 0.5px;
}

.cube-axis-label .axis-subtitle {
    font-size: 13px;
    font-weight: 600;
    color: #e0e6f0;
    opacity: 0.9;
}

/* X-axis label - Right side of cube */
.cube-x-axis {
    right: -140px;
    top: 50%;
    transform: translateY(-50%);
    text-align: left;
}

/* Y-axis label - Top of cube */
.cube-y-axis {
    top: -70px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

/* Z-axis label - Left side of cube */
.cube-z-axis {
    left: -140px;
    top: 50%;
    transform: translateY(-50%);
    text-align: right;
}

/* Axis Lines on Cube (Your existing styles) */
.axis-line {
    position: absolute;
    border-top: 1.5px dashed #fff;
    box-shadow: 0 0 8px rgba(255,255,255,0.4);
    z-index: 10;
    pointer-events: none;
}

/* Axis X (front face, bottom border) */
.axis-x {
    height: 0;
    width: 60%;
    bottom: 10%;
    left: 20%;
    transform-origin: left;
}

/* Axis Y (front face, left border) */
.axis-y {
    width: 0;
    height: 60%;
    top: 20%;
    left: 10%;
    transform-origin: top;
    transform: rotate(90deg);
}

/* Axis Z (right face, bottom edge extending depth-wise) */
.axis-z {
    width: 60%;
    height: 0;
    bottom: 20%;
    right: 10%;
    transform-origin: right;
    transform: rotate(90deg);
}

/* Axis line labels (on the cube faces) */
.axis-label-label {
    position: absolute;
    font-size: 0.75em;
    color: #fff;
    opacity: 0.8;
    font-family: Arial, sans-serif;
    pointer-events: none;
}

.face-1 { transform: rotateY(0deg) translateZ(200px); }
.face-2 { transform: rotateY(90deg) translateZ(200px); }
.face-3 { transform: rotateY(180deg) translateZ(200px); }
.top-face { transform: rotateX(90deg) translateZ(200px); }
.bottom-face { transform: rotateX(-90deg) translateZ(200px); }
.right-face { transform: rotateY(-90deg) translateZ(200px); }

.vendors-container {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    transform-style: preserve-3d;
    pointer-events: none;
}

/* 3D Vendor Dots - Simple Circular Logos Always Facing Camera */
.vendor-dot {
    position: absolute;
    width: 50px;
    height: 50px;
    cursor: pointer;
    transition: transform 0.05s linear;
    pointer-events: auto;
    transform-style: flat;
    left: 50%;
    top: 50%;
    margin-left: -25px;
    margin-top: -25px;
}

.vendor-logo-container {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid rgba(100, 200, 255, 1);
    box-shadow: 0 0 15px rgba(0, 200, 255, 0.6);
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    position: relative;
    pointer-events: auto;
    background: white;
}

.vendor-dot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
    pointer-events: none;
}

.vendor-dot:hover .vendor-logo-container {
    transform: scale(1.3);
    box-shadow: 0 0 30px rgba(0, 200, 255, 1);
}

.vendor-dot.leaders .vendor-logo-container {
    border-color: #FFD700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
}

.vendor-dot.leaders:hover .vendor-logo-container {
    box-shadow: 0 0 30px rgba(255, 215, 0, 1);
}

.vendor-dot.challengers .vendor-logo-container {
    border-color: #C0C0C0;
    box-shadow: 0 0 15px rgba(192, 192, 192, 0.8);
}

.vendor-dot.challengers:hover .vendor-logo-container {
    box-shadow: 0 0 30px rgba(192, 192, 192, 1);
}

.vendor-dot.aspirants .vendor-logo-container {
    border-color: #CD853F;
    box-shadow: 0 0 15px rgba(205, 133, 63, 0.8);
}

.vendor-dot.aspirants:hover .vendor-logo-container {
    box-shadow: 0 0 30px rgba(205, 133, 63, 1);
}

/* 3D Tooltip */
.vendor-tooltip {
    position: fixed;
    background: rgba(15, 42, 68, 0.95);
    border: 2px solid #3498db;
    border-radius: 12px;
    padding: 12px 16px;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    color: #e0e6f0;
    font-size: 12px;
    backdrop-filter: blur(10px);
}
.vendor-tooltip.show {
    opacity: 1;
    pointer-events: auto;
}
.tooltip-name {
    font-weight: bold;
    margin-bottom: 6px;
    color: #fff;
}
.tooltip-metric {
    display: flex;
    justify-content: space-between;
    margin: 4px 0;
    font-size: 11px;
}
.metric-label { color: #7f8c8d; }
.metric-value { color: #3498db; font-weight: bold; }

/* 2D MODE - Projection */
.projection-view {
    width: 100%;
    max-width: 600px;
    height: 500px;
    background: rgba(15, 42, 68, 0.5);
    border: 2px solid rgba(100, 200, 255, 0.4);
    border-radius: 20px;
    position: relative;
    margin: 0 auto;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s ease;
    backdrop-filter: blur(10px);
}
.projection-view.show {
    opacity: 1;
    visibility: visible;
}

.projection-axes {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.axis-line {
    position: absolute;
    background: linear-gradient(90deg, transparent, rgba(100, 200, 255, 0.3), transparent);
}
.axis-h { width: 100%; height: 2px; top: 50%; left: 0; }
.axis-v { width: 2px; height: 100%; top: 0; left: 50%; }

.axis-label-2d {
    position: absolute;
    font-weight: bold;
    font-size: 14px;
    color: #989898;
}
.axis-label-x { bottom: -30px; left: 50%; transform: translateX(-50%); }
.axis-label-y { left: -50px; top: 50%; transform: translateY(-50%) rotate(-90deg); transform-origin: center; }

.projection-vendors {
    position: absolute;
    width: 100%;
    height: 100%;
}
.projection-dot {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.8), rgba(100, 200, 255, 0.6));
    border: 2px solid rgba(100, 200, 255, 0.8);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 0 20px rgba(0, 200, 255, 0.6);
    transform: translate(-50%, -50%);
}
.projection-dot img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}
.projection-dot:hover {
    transform: translate(-50%, -50%) scale(1.3);
    box-shadow: 0 0 40px rgba(0, 200, 255, 0.9);
}

.projection-dot.leaders { box-shadow: 0 0 20px rgba(255, 215, 0, 0.8); }
.projection-dot.challengers { box-shadow: 0 0 20px rgba(192, 192, 192, 0.8); }
.projection-dot.aspirants { box-shadow: 0 0 20px rgba(205, 133, 63, 0.8); }

/* Projection Controls */
.projection-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s ease;
}
.projection-controls.show {
    opacity: 1;
    visibility: visible;
}
.projection-select {
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid #3498db;
    border-radius: 20px;
    color: #e0e6f0;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}
.projection-select:hover {
    background: rgba(52, 152, 219, 0.2);
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.3);
}
.projection-select option {
    background: #0b1b2b;
    color: #e0e6f0;
}

.next-projection-btn {
    padding: 10px 20px;
    background: #3498db;
    border: none;
    border-radius: 20px;
    color: white;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}
.next-projection-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

/* Hide cube in 2D mode */
.cube-scene.mode-2d .cube {
    display: none !important;
}

/* Legend */
.matrix-legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 120px;
    flex-wrap: wrap;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #fff;
}
.legend-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    box-shadow: 0 0 10px currentColor;
}
.legend-dot.gold { background: #FFD700; }
.legend-dot.silver { background: #C0C0C0; }
.legend-dot.bronze { background: #CD853F; }

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 20px;
    box-sizing: border-box;
}
.modal-overlay.show { display: flex; }

.vendor-modal {
    background: #ffffff;
    border-radius: 20px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 30px;
    border-bottom: 2px solid #e8edf6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    border-radius: 20px 20px 0 0;
}
.modal-header h2 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.8rem;
}
.modal-close {
    background: none;
    border: none;
    font-size: 2.5rem;
    cursor: pointer;
    color: #7f8c8d;
    transition: all 0.3s ease;
    line-height: 1;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}
.modal-close:hover {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
    color: #2c3e50;
}

body.modal-open { overflow: hidden; }

.vendor-modal::-webkit-scrollbar {
    width: 8px;
}
.vendor-modal::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}
.vendor-modal::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}
.vendor-modal::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}
.metric-card {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    border: 2px solid #e8edf6;
}
.metric-value {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    color: #3498db;
    margin-bottom: 10px;
}
.metric-label {
    font-size: 1rem;
    color: #7f8c8d;
    font-weight: 600;
}

/* Modal Actions */
.modal-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}
.action-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.action-btn.primary {
    background: linear-gradient(45deg, #3498db, #2980b9);
    color: white;
}
.action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(52, 152, 219, 0.4);
}
.action-btn.secondary {
    background: linear-gradient(45deg, #34495e, #2c3e50);
    color: white;
}
.action-btn.secondary:hover {
    transform: translateY(-2px);
}

/* Export Modal */
.export-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 3000;
    display: none;
}
.export-modal.show { display: block; }
.export-content h3 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
}
.export-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}
.export-btn {
    padding: 20px;
    background: #f8f9fa;
    border: 2px solid #e8edf6;
    border-radius: 15px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    text-align: center;
}
.export-btn:hover {
    background: #3498db;
    color: white;
    border-color: #3498db;
    transform: translateY(-3px);
}

/* Responsive */
@media (max-width: 768px) {
    .cube-scene { width: 300px; height: 300px; }
    .cube-face { width: 300px; height: 300px; }
    .projection-view { width: 90%; height: 300px; }
    .vendor-dot { width: 40px; height: 40px; }
    .vendor-dot img { width: 30px; height: 30px; }
    .matrix-header h1 { font-size: 1.8rem; }
    .metrics-grid { grid-template-columns: 1fr; }
    .modal-actions { flex-direction: column; }
    .export-options { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .cube-wrapper { padding: 20px; }
    .category-filters { flex-direction: column; }
    .matrix-legend { flex-direction: column; align-items: center; gap: 15px; }
    .mode-toggle { flex-direction: column; }
}

/* Base cube face border style - translucent solid to keep glass look */
.cube-face {
  position: absolute;
  width: 400px;
  height: 400px;
  border: 1px solid rgba(255, 255, 255, 0.15); /* faint translucent borders */
  background: transparent;
  box-sizing: border-box;
  backface-visibility: visible;
  pointer-events: none;
}

/* Front face bottom border - X-axis, dashed & glowing */
.face-1 {
  border-bottom: 1.5px dashed white;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

/* Front face left border - Y-axis, dashed & glowing */
.face-1 {
  border-left: 1.5px dashed white;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

/* Right face bottom border - Z-axis, dashed & glowing */
.right-face {
  border-bottom: 1.5px dashed white;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

/* Optionally top face Y-axis continuation with subtle style */
.top-face {
  border-left: 1.5px dashed rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 6px rgba(255,255,255,0.2);
}

/* Other cube faces keep faint solid borders */
.face-2, .face-3, .bottom-face {
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Dashed glowing axis lines */
.axis-line {
  position: absolute;
  border-top: 1.5px dashed #fff;
  box-shadow: 0 0 8px rgba(255,255,255,0.5);
  z-index: 10;
}

.axis-x { left: 20%; bottom: 10%; width: 60%; }
.axis-y { left: 10%; top: 20%; height: 60%; border-top: none; border-left: 1.5px dashed #fff; }
.axis-z { right: 10%; bottom: 20%; width: 60%; }

/* Axis letter labels: Positioned above/direction of line */
.axis-label {
  position: absolute;
  color: #fff;
  font-weight: 700;
  font-size: 1em;
  opacity: 0.95;
  pointer-events: none;
}

/* X, Y, Z label placement */
.axis-label-x { left: calc(80% - 12px); bottom: 13%; }
.axis-label-y { left: 6%; top: 18%; }
.axis-label-z { right: calc(10% - 12px); bottom: 22%; }

/* Axis descriptions: placed closer to the cube face side */
.axis-desc {
  position: absolute;
  color: #fff;
  font-size: 0.86em;
  opacity: 0.7;
  pointer-events: none;
}
.axis-desc-x { left: 22%; bottom: 7%; }
.axis-desc-y { left: 11%; top: 55%; }
.axis-desc-z { right: 11%; bottom: 15%; }

.axis-label,
.cube-axis-label,
.axis-desc {
  display: none !important;
}

.axis-line {
  position: absolute;
  border-top: 1.5px dashed #fff;
  box-shadow: 0 0 8px rgba(255,255,255,0.5);
  z-index: 10;
  opacity: 1;
}
.axis-x { left: 20%; bottom: 10%; width: 60%; }
.axis-y { left: 10%; top: 20%; height: 60%; border-top: none; border-left: 1.5px dashed #fff; }
.axis-z { right: 10%; bottom: 20%; width: 60%; }


