/* ============================================================================
   ANIMATION CORE STYLES - 3D Rendering & Geometry
   ============================================================================
   
   This stylesheet contains ONLY the styles needed for 3D rendering and DOM
   geometry. It can be used on both server-side (Puppeteer screenshot) and
   client-side rendering contexts.
   
   NO client interaction styles or viewport layout in this file.
   Client-only UI styles are in animation-ui.css
*/

/* Universal box-sizing for all elements */
*,*::after,*::before {
    box-sizing: border-box;
}

/* ============================================================================
   3D CONTAINER ELEMENTS
   ============================================================================ */

/* Container for the 3D prism collection */
.object-group {
    position: relative;
    transform-style: preserve-3d;
    transform-origin: 50% 50% 50%;
    transform: rotateX(0deg) rotateY(0deg) rotateZ(0) translateX(0) translateY(0) translateZ(0);
    pointer-events: auto;
    backface-visibility: visible;
    cursor: grab;
}

.object-group:active {
    cursor: grabbing;
}

/* Main fabrication container with 3D perspective */
.fabrication {    
    position: relative;
    transform-style: preserve-3d;
    transform-origin: 50% 50% 50%;
    transform: rotateX(0deg) rotateY(0deg) rotateZ(0) translateX(0) translateY(0) translateZ(0);
    backface-visibility: visible;
    pointer-events: auto;
    cursor: grab;
}

.fabrication:active {
    cursor: grabbing;
}

/* ============================================================================
   PRISM ELEMENTS (Rectangular)
   ============================================================================ */

/* Individual prism container */
.prism {
    position: absolute;
    transform-style: preserve-3d;
    transform-origin: 50% 50% 50%;
    backface-visibility: visible;
    pointer-events: auto !important;
    cursor: grab;
}

.prism:active {
    cursor: grabbing;
}

/* Individual face of a prism */
.face {
    width: 100px;
    height: 100px;
    position: absolute;
    background-color: lightblue;
    opacity: 0.7;
    box-sizing: border-box;
    border: 1px solid rgba(102, 102, 102, 0.5);
    pointer-events: auto;
}

/* ============================================================================
   PRISM ELEMENTS (Cylindrical/Symmetrical)
   ============================================================================ */

/* Container for cylindrical prisms made of segments */
.symmetrical-prism-container {
    position: absolute;
    transform-style: preserve-3d;
    display: flex;
    backface-visibility: visible;
    pointer-events: auto;
}

/* Surface segments wrapping around cylindrical prisms */
.surface-segment {
    position: absolute;
    background-color: #999999;
    border: none;
    opacity: 1;
    box-sizing: border-box;
    transform-origin: center center;
    border: solid 1px rgba(240, 240, 240, 0.2);
}

/* Container for end faces */
.end-faces {
    position: absolute;
    transform-style: preserve-3d;
}

/* Circular end faces for cylindrical prisms */
.end-face {
    position: absolute;
    background: rgba(0, 128, 255, 1.0);
    border: none;
    box-sizing: border-box;
    transform: rotateX(0deg) rotateY(0deg) rotateZ(0) translateX(0) translateY(0) translateZ(0);
    transform-origin: center center;
}

/* ============================================================================
   BASIC GEOMETRY ELEMENTS
   ============================================================================ */

/* Basic circle for visualization */
.circle {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: blue;
}

/* ============================================================================
   COORDINATE AXES (for orientation reference)
   ============================================================================ */

#axes {
    top: 50%;
    left: 50%;
    transition: all 0.1s;
}

.axis {
    position: absolute;
    width: 500px;
    height: 4px;
    transform-origin: left center;
}

.axis-label {
    position: absolute;
    color: black;
    font-family: Arial, sans-serif;
    font-size: 16px;
    transform: translateZ(1px);
}

#x-axis {
    background: red;
    transform: rotateY(0deg) rotateX(0deg); /* Points right along X */
}

#x-label {
    left: 540px;
    top: -8px;
    font-size: 24px;
}

#y-axis {
    background: green;
    transform: rotateZ(-90deg); /* Points up along Y */
}

#y-label {
    transform: translateY(-540px) rotateZ(90deg) rotateX(90deg) translateZ(1px);
    top: 0;
    left: 0;
    font-size: 24px;
}

#z-axis {
    background: blue;
    transform: rotateY(90deg); /* Points into screen along Z */
}

#z-label {
    transform: rotateY(90deg) translateX(540px) translateZ(1px);
    top: 0;
    left: 0;
    font-size: 24px;
}

/* ============================================================================
   SELECTION & VISUAL FEEDBACK (3D Geometry)
   ============================================================================ */

/* Visual feedback for selected 3D objects */
.selected-object {
    background-color: #39B54A;
    border: 1px solid #000;
}

/* ============================================================================
   PICK POINT SYSTEM STYLES (3D positioned)
   ============================================================================
   
   Pick points are geometrically positioned in 3D space and are part of the
   3D model rendering, not pure client interaction.
*/

.pick-points-container {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    perspective: none;
}

/* Pick point styling - 3D positioned circles */
.pick-point-circle {
    position: absolute;
    background-color: white;
    cursor: pointer;
    pointer-events: auto;
    z-index: 100;
    margin: 0;
    border: none;
}

/* Pick point hover state */
.pick-point-circle:hover,
.pick-point-hover {
    background-color: #FF0000;
}

/* Pick point connected state */
.pick-point-connected {
    background-color: #39B54A;
    border-color: #39B54A;
    box-shadow: 0 0 12px rgba(57, 181, 74, 0.8);
}

/* Pick point cursor states */
.pick-point-circle:active {
    cursor: grabbing;
}

/* Mobile touch interactions */
@media (hover: none) and (pointer: coarse) {
    .pick-point-circle {
        cursor: pointer;
    }
}

/* Responsive pick point sizing */
@media (max-width: 768px) {
    .pick-point-circle {
        width: 12px;
        height: 12px;
        margin-left: -6px;
        margin-top: -6px;
    }

    .pick-point-circle:hover,
    .pick-point-hover {
        width: 16px;
        height: 16px;
        margin-left: -8px;
        margin-top: -8px;
    }
}
