@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&family=Orbitron:wght@400;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #0a0a0f;
    color: #e0e0e0;
    font-family: 'JetBrains Mono', monospace;
    min-height: 100vh;
    overflow: hidden;
}

.container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

#canvas-container {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #0d1117 0%, #161b22 50%, #0d1117 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

#canvas-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(56, 139, 78, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(88, 166, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

#render-canvas {
    display: block;
}

.sidebar {
    position: fixed;
    top: 16px;
    right: 16px;
    bottom: 16px;
    width: 340px;
    background: rgba(22, 27, 34, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 100;
}

.sidebar-toggle {
    position: fixed;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: rgba(22, 27, 34, 0.95);
    border: 1px solid #30363d;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 20px;
    cursor: pointer;
    z-index: 99;
    display: none;
}

.sidebar-toggle:hover {
    background: rgba(56, 139, 78, 0.3);
}

.sidebar.hidden {
    display: none;
}

.sidebar.hidden + .sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #388b4e;
    padding-bottom: 8px;
    border-bottom: 1px solid #30363d;
    margin-bottom: 4px;
}

.sidebar-close {
    background: none;
    border: none;
    color: #8b949e;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.sidebar-close:hover {
    color: #ff6b6b;
}

.panel-header {
    font-family: 'Orbitron', sans-serif;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #388b4e;
    padding-bottom: 8px;
    border-bottom: 1px solid #30363d;
    margin-bottom: 4px;
}

.control-group {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 12px;
}

.control-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}

.control-row:last-child {
    margin-bottom: 0;
}

label {
    font-size: 11px;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: linear-gradient(to right,
        #30363d 0%,
        #30363d 50%,
        #30363d 100%
    );
    border-radius: 3px;
    outline: none;
    position: relative;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #388b4e;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(56, 139, 78, 0.5);
    transition: all 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: #4ade80;
}

.slider-container {
    position: relative;
    padding-top: 4px;
}

.slider-container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 14px;
    background: #58a6ff;
    border-radius: 1px;
    pointer-events: none;
    z-index: 1;
    margin-top: 2px;
}

.slider-track {
    position: relative;
    height: 6px;
    background: #30363d;
    border-radius: 3px;
}

.slider-fill {
    position: absolute;
    height: 100%;
    background: linear-gradient(90deg, #388b4e, #4ade80);
    border-radius: 3px;
    pointer-events: none;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 9px;
    color: #6e7681;
    margin-top: 2px;
}

.slider-labels span:nth-child(2) {
    color: #58a6ff;
}

.file-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.file-input {
    display: none;
}

.file-input-wrapper:hover {
    border-color: #388b4e;
}

.file-status {
    flex: 1;
    font-size: 11px;
    color: #6e7681;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-status.loaded {
    color: #4ade80;
}

.btn-small {
    background: #30363d;
    border: none;
    color: #f85149;
    padding: 2px 6px;
    font-size: 10px;
    border-radius: 3px;
    cursor: pointer;
}

.btn-small:hover {
    background: #f85149;
    color: white;
}

.value-display {
    font-size: 12px;
    color: #58a6ff;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
    margin-left: auto;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    transition: background 0.15s, color 0.15s;
    user-select: none;
}

.value-display:hover {
    background: rgba(88, 166, 255, 0.2);
    color: #79c0ff;
}

.value-display:active {
    background: rgba(88, 166, 255, 0.3);
}

.value-input {
    font-size: 12px;
    color: #58a6ff;
    font-weight: 700;
    background: #0d1117;
    border: 1px solid #58a6ff;
    border-radius: 3px;
    padding: 2px 6px;
    width: 60px;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    outline: none;
    margin-left: auto;
}

.value-input:focus {
    border-color: #79c0ff;
    box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.2);
}

.btn {
    background: linear-gradient(135deg, #238636 0%, #2ea043 100%);
    border: none;
    color: white;
    padding: 12px 20px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.btn:hover {
    background: linear-gradient(135deg, #2ea043 0%, #3fb950 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(46, 160, 67, 0.4);
}

.btn-secondary {
    background: #30363d;
}

.btn-secondary:hover {
    background: #484f58;
}

.bone-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.bone-left { background: #f97316; }
.bone-right { background: #3b82f6; }

.status-bar {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid #30363d;
    font-size: 10px;
    color: #6e7681;
}

.status-bar span {
    color: #388b4e;
}

/* Drag and drop styles */
.file-input-wrapper.drag-over {
    border-color: #4ade80;
    background: rgba(74, 222, 128, 0.1);
    box-shadow: 0 0 15px rgba(74, 222, 128, 0.3);
}

.file-input-wrapper.drag-over .file-status {
    color: #4ade80;
}

/* Auto-align toggle */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
}

.toggle-label {
    font-size: 11px;
    color: #8b949e;
}

.toggle-switch {
    position: relative;
    width: 40px;
    height: 20px;
    background: #30363d;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
}

.toggle-switch.active {
    background: #388b4e;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
}

.toggle-switch.active::after {
    transform: translateX(20px);
}

.auto-align-info {
    font-size: 9px;
    color: #6e7681;
    margin-top: 4px;
}

.axis-legend {
    font-size: 9px;
    color: #8b949e;
    margin: 4px 0 8px 0;
    font-family: monospace;
}

.bone-select {
    width: 100%;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 4px;
    color: #e0e0e0;
    padding: 4px 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    cursor: pointer;
    margin-bottom: 4px;
}

.bone-select:hover {
    border-color: #388b4e;
}

.bone-select:focus {
    outline: none;
    border-color: #58a6ff;
}

.equipment-slot {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #21262d;
}

.equipment-slot:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.slot-label {
    font-size: 11px;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

/* Attachment slots */
.attachment-slot {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #21262d;
}

.attachment-slot:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.attachment-slot .slot-label {
    color: #f0883e;
}

.attachment-slot .bone-select {
    border-color: #f0883e33;
}

.attachment-slot .bone-select:hover {
    border-color: #f0883e;
}

.attachment-slot .file-input-wrapper {
    margin-top: 4px;
}

/* Attachment offset controls */
.attachment-offsets {
    margin-top: 8px;
    padding: 8px;
    background: rgba(240, 136, 62, 0.05);
    border: 1px solid #f0883e33;
    border-radius: 4px;
}

.control-row.compact {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.control-row.compact label {
    min-width: 50px;
    font-size: 9px;
    margin-bottom: 0;
}

.control-row.compact input[type="range"] {
    flex: 1;
    height: 4px;
}

.control-row.compact input[type="range"]::-webkit-slider-thumb {
    width: 12px;
    height: 12px;
}

.control-row.compact .value-display {
    font-size: 10px;
}

/* Mode toggle buttons */
.mode-toggle-container {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
}

.mode-btn {
    flex: 1;
    padding: 10px 16px;
    font-family: 'Orbitron', sans-serif;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #8b949e;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mode-btn:hover {
    background: #161b22;
    border-color: #388b4e;
    color: #e0e0e0;
}

.mode-btn.active {
    background: linear-gradient(135deg, #238636 0%, #2ea043 100%);
    border-color: #2ea043;
    color: white;
    box-shadow: 0 2px 8px rgba(46, 160, 67, 0.3);
}
