/* style.css - Alias|Wavefront Maya 1.0 Theme for Maru */

:root {
    /* The Classic SGI/Windows 95 Palette */
    --bg-face: #bfbfbf;       /* Main UI gray */
    --bg-dark: #3b3b3b;       /* Viewport bg */
    --highlight: #ffffff;     /* Top/Left bevel */
    --shadow: #606060;        /* Bottom/Right bevel */
    --dark-shadow: #000000;   /* Deep borders */
    --maya-blue: #000080;     /* Selection/Title bars */
    --maya-cyan: #00ffff;     /* Selected wireframes */
    --active-field: #ffcc00;  /* Keyed frame field color */
    
    /* Dimensions */
    --header-height: 24px;
    --shelf-height: 40px;
    --toolbox-width: 44px;
    --channel-width: 220px;
    --timeline-height: 30px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-face);
    color: #000;
    font-family: Arial, Helvetica, sans-serif; /* Real UI font */
    font-size: 11px;
    height: 100vh;
    overflow: hidden;
    user-select: none; /* Feels like app */
}

a { text-decoration: none; color: inherit; }

/* --- Layout Grid --- */
.maya-interface {
    display: grid;
    height: 100vh;
    grid-template-areas:
        "menu menu menu"
        "shelf shelf shelf"
        "toolbox viewport channel"
        "toolbox timeslider channel"
        "command command command";
    grid-template-columns: var(--toolbox-width) 1fr var(--channel-width);
    grid-template-rows: var(--header-height) var(--shelf-height) 1fr var(--timeline-height) 35px;
}

/* --- Bevel Utilities (The Soul of the 90s) --- */
.ui-bar, .tool-btn, .channel-box, .shelf-icon, .media-btn {
    background-color: var(--bg-face);
    border-top: 1px solid var(--highlight);
    border-left: 1px solid var(--highlight);
    border-right: 1px solid var(--shadow);
    border-bottom: 1px solid var(--shadow);
}

.sunken, .viewport-area, .mel-input, input[type="text"] {
    border-top: 1px solid var(--shadow);
    border-left: 1px solid var(--shadow);
    border-right: 1px solid var(--highlight);
    border-bottom: 1px solid var(--highlight);
}

/* --- 1. Menu Bar --- */
.menu-bar {
    grid-area: menu;
    display: flex;
    align-items: center;
    padding: 0 5px;
}

.handle {
    color: #777;
    margin-right: 10px;
    font-weight: bold;
    cursor: grab;
}

.menu-item {
    padding: 2px 8px;
    cursor: default;
}

.menu-item:hover {
    background-color: var(--maya-blue);
    color: white;
}

.personal { color: #0000aa; font-weight: bold; }
.menu-item.personal:hover { color: #fff; }

/* --- 2. Shelf --- */
.shelf-bar {
    grid-area: shelf;
    display: flex;
    flex-direction: column;
    padding: 2px;
}

.shelf-label {
    font-size: 9px;
    padding-left: 4px;
    color: #555;
    margin-bottom: 2px;
}

.shelf-tabs {
    display: flex;
    gap: 2px;
    padding-left: 2px;
}

.shelf-icon {
    height: 20px;
    padding: 0 10px;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shelf-icon:active, .shelf-icon.active {
    background-color: #dcdcdc;
    border-top: 1px solid var(--shadow);
    border-left: 1px solid var(--shadow);
    border-right: 1px solid var(--highlight);
    border-bottom: 1px solid var(--highlight);
}

.personal-tab { color: darkred; font-weight: bold; }

/* --- 3. Toolbox (Left) --- */
.toolbox {
    grid-area: toolbox;
    display: flex;
    flex-direction: column;
    padding: 2px;
    background-color: var(--bg-face);
    border-right: 1px solid var(--shadow);
}

.tool-btn {
    width: 36px;
    height: 30px;
    margin: 2px auto;
    font-size: 9px;
    text-align: center;
    cursor: pointer;
    box-shadow: 1px 1px 0 #000; /* Extra contrast */
}

.tool-btn:active, .tool-btn.active {
    background-color: #a0a0a0;
    border: 1px inset;
}

.separator {
    height: 2px;
    background: #777;
    margin: 5px 2px;
    border-bottom: 1px solid #fff;
}

/* --- 4. Viewport (The Core) --- */
.viewport-area {
    grid-area: viewport;
    background: linear-gradient(to bottom, #303040 0%, #606070 100%);
    position: relative;
    overflow: hidden;
    perspective: 800px;
    margin: 2px;
}

.viewport-header {
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    color: #ffff00; /* Maya yellow overlay */
    font-family: monospace;
    font-size: 12px;
    z-index: 10;
}

/* Grid Floor - CSS Magic */
.grid-floor {
    position: absolute;
    top: 50%; left: 50%;
    width: 1000px; height: 1000px;
    transform: translate(-50%, -50%) rotateX(70deg);
    background-image: 
        linear-gradient(rgba(100,100,100,0.5) 1px, transparent 1px),
        linear-gradient(90deg, rgba(100,100,100,0.5) 1px, transparent 1px);
    background-size: 40px 40px;
}

.scene-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-style: preserve-3d;
}

/* The Cube */
.cube-wrapper {
    position: relative;
    width: 150px;
    height: 150px;
    transform-style: preserve-3d;
    animation: mayaSpin 12s infinite linear;
}

.cube {
    width: 100%; height: 100%;
    transform-style: preserve-3d;
}

.face {
    position: absolute;
    width: 150px; height: 150px;
    background: rgba(0, 255, 255, 0.1); /* See-through selection */
    border: 1px solid #00ffff; /* Selection Highlight cyan */
    display: flex;
    align-items: center;
    justify-content: center;
    color: #00ffff;
    font-size: 20px;
    font-weight: bold;
    box-shadow: inset 0 0 10px rgba(0,255,255,0.2);
}

.front  { transform: translateZ(75px); }
.back   { transform: translateZ(-75px) rotateY(180deg); }
.right  { transform: rotateY(90deg) translateZ(75px); }
.left   { transform: rotateY(-90deg) translateZ(75px); }
.top    { transform: rotateX(90deg) translateZ(75px); }
.bottom { transform: rotateX(-90deg) translateZ(75px); }

/* Selection Ring (Green/White active ring) */
.selection-ring {
    position: absolute;
    width: 100%; height: 100%;
    border: 2px solid white;
    opacity: 0.3;
    transform: rotateX(90deg) translateZ(-80px) scale(1.5);
}

@keyframes mayaSpin {
    0% { transform: rotateX(-15deg) rotateY(0deg); }
    100% { transform: rotateX(-15deg) rotateY(360deg); }
}

/* Axis Indicator (Bottom Left) */
.axis-indicator {
    position: absolute;
    bottom: 10px; left: 10px;
    width: 40px; height: 40px;
}
.axis-indicator span {
    position: absolute;
    font-weight: bold;
    font-size: 10px;
}
.y-axis { color: #00ff00; top: 0; left: 10px; }
.x-axis { color: #ff0000; bottom: 0; right: 0; }
.z-axis { color: #0000ff; bottom: 0; left: 0; }

/* --- 5. Channel Box (Right) --- */
.channel-box {
    grid-area: channel;
    display: flex;
    flex-direction: column;
    padding: 2px;
}

.panel-header {
    background-color: #555;
    color: white;
    padding: 2px;
    font-size: 10px;
    display: flex;
    justify-content: space-between;
}

.object-name {
    background-color: #d0d0d0;
    border: 1px solid #888;
    margin: 2px;
    padding: 2px;
    font-weight: bold;
    text-align: center;
}

.attr-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10px;
}

.attr-table td {
    padding: 2px;
}

.section-head {
    background: #555;
    color: white;
    text-align: left;
    padding-left: 5px;
    font-size: 9px;
    letter-spacing: 1px;
}

.section-head.personal { background: #004400; }

input[type="text"] {
    width: 100%;
    background: #e0e0e0;
    border: none;
    font-family: monospace;
    text-align: right;
    padding-right: 4px;
}

/* Specific Maya States */
.changed { background-color: #ffcccc !important; } /* Pink when changed */
.animating { background-color: #ffcc00 !important; } /* Orange when keyed */
.green-text { color: green; font-weight: bold; }

.ascii-art {
    margin-top: 20px;
    font-family: monospace;
    font-size: 10px;
    color: #444;
    text-align: center;
    opacity: 0.5;
}

/* --- 6. Time Slider --- */
.time-slider-area {
    grid-area: timeslider;
    display: flex;
    align-items: center;
    padding: 0 5px;
    background-color: var(--bg-face);
}

.timeline-controls {
    display: flex;
    margin-right: 10px;
}

.media-btn {
    width: 20px; height: 18px;
    font-size: 8px;
    padding: 0;
}

.timeline-ruler {
    flex-grow: 1;
    position: relative;
    height: 20px;
    background: repeating-linear-gradient(
        90deg,
        #999,
        #999 1px,
        transparent 1px,
        transparent 10px
    );
    border: 1px inset #fff;
    background-color: #bbb;
}

.scrubber {
    width: 100%;
    opacity: 0.5;
    cursor: ew-resize;
}

.time-readout {
    width: 40px;
    background: #000;
    color: #fff;
    font-family: monospace;
    text-align: right;
    padding: 2px;
    margin-left: 5px;
    border: 1px inset #999;
}

/* --- 7. Command Line --- */
.command-line {
    grid-area: command;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-face);
    border-top: 2px solid var(--shadow);
}

.mel-label {
    display: none; /* Hidden in simple view */
}

.mel-input, .feedback-box {
    font-family: "Courier New", monospace;
    font-size: 10px;
    border: none;
    padding: 2px 5px;
    width: 100%;
}

.mel-input {
    background-color: #fff;
    height: 16px;
    border-bottom: 1px solid #ccc;
}

.feedback-box {
    background-color: #dcdcdc;
    color: #444;
    height: 18px;
}

/* Object Styling */
.scene-node {
    position: absolute;
    transform-style: preserve-3d;
    transition: outline 0.1s;
}

/* Wireframe label (The object name floating in 3D) */
.wireframe-label {
    position: absolute;
    top: -20px;
    font-size: 9px;
    color: #00ff00;
    pointer-events: none;
}

/* NURBS Circle Curve */
.nurbsCurve {
    width: 100px;
    height: 100px;
    border: 2px solid #3333ff;
    border-radius: 50%;
}

/* Selection State */
.scene-node.selected .face {
    border: 1px solid #ffffff; /* White highlight */
    background: rgba(255, 255, 255, 0.2);
}

.scene-node.selected.nurbsCurve {
    border-color: #ffffff;
}