:root {
    --bp-bg: #02090b;
    --bp-grid: rgba(0, 243, 255, 0.05);
    --bp-grid-major: rgba(0, 243, 255, 0.15);
    --bp-line: #00f3ff;
    --bp-line-dim: rgba(0, 243, 255, 0.35);
    --bp-text: #e0fbfc;
    --bp-accent: #c8ff00;
    --bp-accent-dim: rgba(200, 255, 0, 0.3);
    --bp-panel-bg: rgba(2, 9, 11, 0.88);
    --bp-border: 1px solid rgba(0, 243, 255, 0.25);
    --bp-border-bright: 1px solid #00f3ff;
}

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

body {
    background-color: var(--bp-bg);
    background-image: 
        linear-gradient(var(--bp-grid-major) 1px, transparent 1px),
        linear-gradient(90deg, var(--bp-grid-major) 1px, transparent 1px),
        linear-gradient(var(--bp-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--bp-grid) 1px, transparent 1px);
    background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px;
    color: var(--bp-text);
    font-family: 'Space Mono', monospace;
    overflow: hidden;
    height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr;
}

/* Technical Border Overlay */
.blueprint-border {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 2px solid var(--bp-line);
    pointer-events: none;
    z-index: 999;
    opacity: 0.6;
}
.blueprint-border::before {
    content: "";
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    border: 0.5px solid var(--bp-line-dim);
}

/* Header / Drawing Title Block */
header {
    padding: 16px 24px;
    background: rgba(2, 9, 11, 0.95);
    border-bottom: 2px solid var(--bp-line);
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 5px 25px rgba(0, 243, 255, 0.15);
}

.title-block {
    display: flex;
    align-items: center;
    gap: 20px;
}

.drawing-number {
    border: 1px solid var(--bp-line);
    padding: 4px 8px;
    font-size: 0.85rem;
    color: var(--bp-line);
    text-shadow: 0 0 5px rgba(0, 243, 255, 0.4);
    background: rgba(0, 243, 255, 0.05);
}

h1 {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.5rem;
    letter-spacing: 2px;
    color: #fff;
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.6);
}

/* Workspace Grid */
main {
    display: grid;
    grid-template-columns: 360px 1fr 320px;
    height: 100%;
    overflow: hidden;
    position: relative;
}

/* Panels styling */
.panel {
    background: var(--bp-panel-bg);
    border-right: 1px solid rgba(0, 243, 255, 0.15);
    display: flex;
    flex-direction: column;
    z-index: 5;
    overflow-y: auto;
    position: relative;
    backdrop-filter: blur(8px);
}

.panel-right {
    border-right: none;
    border-left: 1px solid rgba(0, 243, 255, 0.15);
}

.panel-header {
    padding: 14px 20px;
    border-bottom: 1px solid rgba(0, 243, 255, 0.2);
    background: rgba(0, 243, 255, 0.04);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-title {
    font-family: 'Share Tech Mono', monospace;
    text-transform: uppercase;
    font-size: 0.95rem;
    letter-spacing: 1.5px;
    color: var(--bp-line);
    font-weight: bold;
    text-shadow: 0 0 6px rgba(0, 243, 255, 0.3);
}

.panel-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Viewport */
#viewport-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #021a22 0%, #000507 100%);
}

#canvas3d {
    width: 100%;
    height: 100%;
    display: block;
}

/* Interactive overlay for dimensioning */
#dimensions-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

/* Widgets & Sliders */
.control-group {
    border: 1px dashed rgba(0, 243, 255, 0.2);
    padding: 14px;
    border-radius: 4px;
    background: rgba(0, 243, 255, 0.01);
}

.control-group-title {
    font-size: 0.8rem;
    color: var(--bp-accent);
    margin-bottom: 12px;
    text-transform: uppercase;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    text-shadow: 0 0 5px rgba(200, 255, 0, 0.4);
}

.param-row {
    margin-bottom: 12px;
}
.param-row:last-child {
    margin-bottom: 0;
}

.param-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    margin-bottom: 6px;
}

.param-label {
    color: rgba(224, 251, 252, 0.7);
}
.param-value {
    color: var(--bp-line);
    font-weight: bold;
    text-shadow: 0 0 4px rgba(0, 243, 255, 0.3);
}

.slider-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

input[type="range"] {
    flex: 1;
    height: 2px;
    background: rgba(0, 243, 255, 0.2);
    appearance: none;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 12px;
    height: 18px;
    background: var(--bp-line);
    border: 1px solid var(--bp-bg);
    cursor: pointer;
    box-shadow: 0 0 6px var(--bp-line);
}

/* Text & Number Input Cyber-Styling */
.cyber-input {
    width: 100%;
    background: rgba(0, 243, 255, 0.05);
    border: 1px solid rgba(0, 243, 255, 0.3);
    color: #fff;
    padding: 8px 12px;
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    outline: none;
    margin-bottom: 10px;
    border-radius: 0;
    transition: all 0.3s;
}

.cyber-input:focus {
    border-color: var(--bp-line);
    background: rgba(0, 243, 255, 0.1);
    box-shadow: 0 0 8px rgba(0, 243, 255, 0.2);
}

/* View Mode Controls */
.btn-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.btn {
    background: transparent;
    border: 1px solid rgba(0, 243, 255, 0.35);
    color: var(--bp-text);
    padding: 8px 12px;
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    text-transform: uppercase;
}

.btn:hover {
    background: rgba(0, 243, 255, 0.08);
    border-color: var(--bp-line);
    box-shadow: 0 0 5px rgba(0, 243, 255, 0.2);
}

.btn.active {
    background: rgba(0, 243, 255, 0.2);
    border-color: var(--bp-line);
    color: #fff;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.4);
    text-shadow: 0 0 5px #fff;
}

.btn-accent {
    border-color: var(--bp-accent);
    color: var(--bp-accent);
    grid-column: span 2;
    font-weight: bold;
    margin-top: 10px;
    text-shadow: 0 0 4px var(--bp-accent-dim);
}

.btn-accent:hover {
    background: rgba(200, 255, 0, 0.12);
    border-color: var(--bp-accent);
    box-shadow: 0 0 10px rgba(200, 255, 0, 0.3);
}

/* Checkbox lists */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    padding: 5px 0;
}

.toggle-row input[type="checkbox"] {
    appearance: none;
    width: 14px;
    height: 14px;
    border: 1px solid rgba(0, 243, 255, 0.4);
    background: transparent;
    cursor: pointer;
    position: relative;
    outline: none;
}

.toggle-row input[type="checkbox"]:checked {
    background: var(--bp-line);
    box-shadow: 0 0 6px var(--bp-line);
    border-color: var(--bp-line);
}

.toggle-row input[type="checkbox"]:checked::after {
    content: "✓";
    color: #02090b;
    font-size: 10px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
}

/* Radio buttons list (e.g. for toggle sides) */
.radio-group {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.radio-group label {
    flex: 1;
    display: block;
}

.radio-group input[type="radio"] {
    display: none;
}

.radio-group span {
    display: block;
    text-align: center;
    border: 1px solid rgba(0, 243, 255, 0.3);
    padding: 6px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
}

.radio-group input[type="radio"]:checked + span {
    background: rgba(0, 243, 255, 0.2);
    border-color: var(--bp-line);
    color: #fff;
    box-shadow: 0 0 6px rgba(0, 243, 255, 0.3);
}

/* Specs Sheet on Right */
.spec-item {
    border-bottom: 1px dashed rgba(0, 243, 255, 0.12);
    padding: 8px 0;
    font-size: 0.75rem;
    display: flex;
    justify-content: space-between;
}
.spec-label {
    color: rgba(224, 251, 252, 0.5);
}
.spec-val {
    color: #fff;
    font-weight: bold;
}

/* Bottom Status Block */
footer {
    background: rgba(2, 9, 11, 0.97);
    border-top: 2px solid var(--bp-line);
    padding: 8px 24px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    font-size: 0.7rem;
    color: var(--bp-line-dim);
    align-items: center;
    z-index: 10;
    box-shadow: 0 -5px 25px rgba(0, 243, 255, 0.1);
}

.status-left {
    display: flex;
    align-items: center;
    gap: 15px;
}
.status-dot {
    width: 6px;
    height: 6px;
    background-color: var(--bp-line);
    border-radius: 50%;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 1; box-shadow: 0 0 6px var(--bp-line); }
}

/* Custom Scrollbar Styling (Cyan theme) */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(2, 9, 11, 0.95);
    border-left: 1px solid rgba(0, 243, 255, 0.1);
}
::-webkit-scrollbar-thumb {
    background: var(--bp-line);
    border-radius: 3px;
    box-shadow: 0 0 5px var(--bp-line);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--bp-accent);
    box-shadow: 0 0 8px var(--bp-accent);
}

/* Firefox compatibility */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--bp-line) rgba(2, 9, 11, 0.95);
}

/* Styled Font Dropdown Select Menu */
select.cyber-input {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='%2300f3ff' d='M2 0L0 2h4zm0 5L0 3h4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 8px 10px;
    padding-right: 30px;
    cursor: pointer;
}

select.cyber-input option {
    background: #02090b;
    color: var(--bp-text);
    font-family: 'Space Mono', monospace;
    border: 1px solid var(--bp-line);
}

/* Number Spinner Cyber Styling */
.number-spinner {
    display: flex;
    align-items: stretch;
    width: 100%;
    border: 1px solid rgba(0, 243, 255, 0.3);
    background: rgba(0, 243, 255, 0.03);
    transition: all 0.3s;
}

.number-spinner:focus-within {
    border-color: var(--bp-line);
    box-shadow: 0 0 8px rgba(0, 243, 255, 0.2);
}

.number-spinner input.cyber-input.num-input {
    flex: 1;
    border: none;
    margin-bottom: 0;
    text-align: center;
    background: transparent;
    padding: 8px;
    /* Hide default spin buttons */
    -webkit-appearance: none;
    -moz-appearance: textfield;
}

.number-spinner input.cyber-input.num-input::-webkit-inner-spin-button,
.number-spinner input.cyber-input.num-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.number-spinner .spin-btn {
    background: rgba(0, 243, 255, 0.08);
    border: none;
    color: var(--bp-line);
    width: 32px;
    font-family: 'Space Mono', monospace;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    user-select: none;
}

.number-spinner .spin-btn:hover {
    background: rgba(0, 243, 255, 0.2);
    color: #fff;
    text-shadow: 0 0 5px var(--bp-line);
}

.number-spinner .spin-btn:active {
    background: rgba(0, 243, 255, 0.35);
}

.rainbow-btn {
    background-image: linear-gradient(90deg, #ff007f, #ff00ff, #7f00ff, #0000ff, #007fff, #00ffff, #00ff7f, #00ff00, #7fff00, #ffff00, #ff7f00, #ff0000, #ff007f) !important;
    background-size: 200% 100% !important;
    background-color: transparent !important;
    color: #fff !important;
    border: none !important;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.8) !important;
    box-shadow: 0 0 15px rgba(255, 0, 127, 0.4);
    animation: rainbow-shift 12s linear infinite !important;
    font-weight: bold;
    letter-spacing: 2px;
    grid-column: span 2;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.rainbow-btn:hover {
    background-image: linear-gradient(90deg, #ff007f, #ff00ff, #7f00ff, #0000ff, #007fff, #00ffff, #00ff7f, #00ff00, #7fff00, #ffff00, #ff7f00, #ff0000, #ff007f) !important;
    background-size: 200% 100% !important;
    background-color: transparent !important;
    box-shadow: 0 0 25px rgba(0, 243, 255, 0.8) !important;
    transform: scale(1.03) !important;
}

@keyframes rainbow-shift {
    0% {
        background-position: 0% 0;
    }
    100% {
        background-position: -200% 0;
    }
}




