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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #0a0a0a;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#case-container {
    position: absolute;
    top: 0;
    width: 65%;
    height: 67%;
    background-color: #1a1a1a;
    transition: outline 0.2s ease;
    border: 2px solid #333;
}

#previews-container {
    position: absolute;
    top: 67%;
    width: 65%;
    height: 20%;
    background-color: #0a0a0a;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    border-top: 2px solid #00ff00;
    gap: 15px;
    padding: 0 20px;
}

#parts-tray {
    position: absolute;
    top: 85%; 
    width: 65%;
    height: 15%;
    background-color: #0a0a0a;
    padding: 10px 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 15px;
    overflow: hidden;
}

.preview-wrapper {
    width: 200px;
    height: 150px;
    margin: 0;
    position: relative;
    display: flex;             
    justify-content: center;    
    align-items: center; 
    cursor: grab;
    transition: transform 0.2s ease, opacity 0.3s ease;
    border-radius: 8px;
    background-color: rgba(26, 26, 26, 0.5);
    border: 2px solid #00ff00;
}

.preview-wrapper:hover:not(.locked) {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
}

.preview-wrapper canvas {    
    display: block;
    margin: 0 auto;
    pointer-events: none;
}

.preview-wrapper:active:not(.locked) {
    cursor: grabbing;
    transform: scale(0.95);
}

.preview-wrapper.locked {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(70%);
    border-color: #666;
}

.preview-wrapper.locked canvas {
    pointer-events: none;
}

.part-item {
    background-color: #1a1a1a;
    border: 1px solid #00ff00;
    border-radius: 5px;
    padding: 15px;
    margin: 0;
    color: #00ff00;
    transition: transform 0.2s, box-shadow 0.2s;
    width: 200px;
    min-width: 200px;
    text-align: center;
    cursor: default;
    height: 100px;
}

.part-item h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
}

.part-item p {
    margin: 0;
    font-size: 14px;
    opacity: 0.8;
}

#portfolio-container {
    position: absolute;
    top: 0;
    right: 0;
    width: 35%;
    height: 100%;
    background-color: #0f0f0f;
    border-left: 2px solid #00ff00;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.portfolio-box {
    background-color: #1a1a1a;
    border: 2px solid #333;
    border-radius: 8px;
    padding: 20px;
    margin: 0;
    color: #666;
    cursor: not-allowed;
    transition: all 0.3s ease;
    flex: 1;
    min-height: 80px;
}

.portfolio-box.unlocked {
    border-color: #00ff00;
    color: #00ff00;
    cursor: pointer;
}

.portfolio-box.unlocked:hover {
    box-shadow: 0 0 15px #00ff00;
    transform: translateX(5px);
}

.portfolio-box.expanded {
    position: fixed;
    top: 5%;
    left: 5%;
    right: 5%;
    bottom: 5%;
    width: 90vw;
    height: 90vh;
    z-index: 1000;
    margin: 0;
    overflow-y: hidden;
    transform: translateX(0);
}

.portfolio-box h2 {
    margin: 0;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.portfolio-box .lock-icon {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.portfolio-box.unlocked .lock-icon {
    transform: rotate(10deg);
}

.portfolio-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    color: #cccccc;
    line-height: 1.6;
}

.portfolio-box.expanded .portfolio-content {
    max-height: none;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #00ff00;
}

.portfolio-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 999;
    backdrop-filter: blur(5px);
}

.portfolio-backdrop.active {
    display: block;
}

.portfolio-content {
  height: 100%;
}

/* Scrollbar styling for portfolio container */
#portfolio-container::-webkit-scrollbar {
    width: 8px;
}

#portfolio-container::-webkit-scrollbar-track {
    background: #0a0a0a;
}

#portfolio-container::-webkit-scrollbar-thumb {
    background: #00ff00;
    border-radius: 4px;
}

#portfolio-container::-webkit-scrollbar-thumb:hover {
    background: #00cc00;
}

#scene-controls {
    position: absolute;
    top: 14px;
    left: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
}

#scene-controls button {
    background: rgba(20, 20, 20, 0.82);
    color: #00ff88;
    border: 1px solid #00ff88;
    border-radius: 6px;
    padding: 10px 20px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    font-weight: bold;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    backdrop-filter: blur(6px);
}

#scene-controls button:hover {
    background: #00ff88;
    color: #0a0a0a;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.4);
}

.portfolio-box.unlocked .locked-hint {
    display: none;
}