html, body {
    margin: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #020617, #000);
    color: #e5e7eb;
    font-family: Arial, sans-serif;
    overflow: hidden;
}

/* Top bar */

.status {
    margin-left: auto;
    margin-right: 20px;
    font-size: 12px;
}

.dot {
    height: 8px;
    width: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
}

.running {
    background: #22c55e;
    animation: pulseDot 1.5s infinite;
    box-shadow: 0 0 6px #22c55e;
}
.paused {
    background: #f59e0b;
    animation: pulseDot 1.5s infinite;
    box-shadow: 0 0 6px #f59e0b;
 }
.stopped {
    background: #ef4444;
    animation: pulseDot 1.5s infinite;
    box-shadow: 0 0 6px #ef4444;
}

@keyframes pulseDot {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.top-bar {
    height: 50px;
    background: linear-gradient(
        90deg,
        rgba(15,23,42,0.9),
        rgba(2,6,23,0.9)
    );
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    font-size: 18px;
    border-bottom: 1px solid #1e293b;
    box-shadow: 0 0 10px rgba(56,189,248,0.15);
}

.top-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.title {
    color: #38bdf8;
    font-weight: bold;
}

.back-btn {
    color: #94a3b8;
    text-decoration: none;
    font-size: 14px;
    border: 1px solid #1e293b;
    padding: 5px 10px;
    transition: 0.2s;
}

.back-btn:hover {
    color: #38bdf8;
    border-color: #38bdf8;
    box-shadow: 0 0 8px rgba(56,189,248,0.5);
}

.top-right {
    font-size: 12px;
    color: #94a3b8;
}

/* Layout */
.main-container {
    display: flex;
    height: calc(100vh - 50px);
    width: 100%;
}

/* Panels */
.left-panel,
.right-panel {
    width: 260px;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(12px);
    border: 1px solid #1e293b;
    padding: 15px;
    box-sizing: border-box;
}

.left-panel section {
    border: 1px solid #1e293b;
    padding: 10px;
    margin-bottom: 10px;
    background: rgba(2, 6, 23, 0.5);
}

.info-section {
    border: 1px solid #1e293b;
    border: 1px solid rgba(56,189,248,0.25);
    padding: 10px;
    margin-bottom: 10px;
    background: rgba(2, 6, 23, 0.5);
    transition: all 0.2s ease;
}

.info-section:nth-child(2) {
    box-shadow: inset 0 0 25px rgba(56,189,248,0.08);
}

.info-section:hover {
    box-shadow:
        inset 0 0 20px rgba(56,189,248,0.08),
        0 0 12px rgba(56,189,248,0.08);
}

.right-panel h3 {
    font-size: 12px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.right-panel div {
    font-size: 13px;
    margin-bottom: 4px;
}

/* Panel glow */
.left-panel {
    border-right: 1px solid #1e293b;
    box-shadow: inset 0 0 25px rgba(56,189,248,0.05);
}

.right-panel {
    border-left: 1px solid #1e293b;
    box-shadow: inset 0 0 25px rgba(167,139,250,0.05);
}

/* Section titles */
.left-panel h3 {
    margin-top: 15px;
    font-size: 12px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
}

.left-panel h3::after {
    content: "";
    display: block;
    width: 40px;
    height: 2px;
    background: #38bdf8;
    margin-top: 4px;
    box-shadow: 0 0 6px #38bdf8;
}

/* Buttons */
.left-panel button {
    margin-bottom: 6px;
    background: #020617;
    border: 1px solid #38bdf8;
    color: #38bdf8;
    padding: 8px;
    cursor: pointer;
    transition: 0.2s;
}


.left-panel button:hover {
    background: #38bdf8;
    color: #020617;
    box-shadow: 0 0 10px #38bdf8;
}

/* Dropdown */
.left-panel select {
    background: #020617;
    color: #e5e7eb;
    border: 1px solid #38bdf8;
    padding: 5px;
}

/* Sliders */
.left-panel input[type=range] {
    width: 100%;
}

/* Canvas area */
.canvas-container {
    flex: 1;
    position: relative;
    height: 100%;
    min-width: 0;
}


#controls-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

/* Grid overlay */
.canvas-container::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(56,189,248,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56,189,248,0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

/* Intro Overlay */

.intro-overlay {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.intro-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.intro-image {
    width: 100%;
    max-height: 200px;
    object-fit: contain;
    margin: 10px 0;
    border-radius: 8px;
    display: none;
}

/* Three container */
#threeContainer {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

#threeContainer canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Camera Section Settings */
.camera-section {
    border: 1px solid #1e293b;
    padding: 12px;
    background: linear-gradient(
        180deg,
        rgba(2, 6, 23, 0.6),
        rgba(2, 6, 23, 0.9)
    );

    box-shadow:
        inset 0 0 15px rgba(56,189,248,0.05),
        0 0 10px rgba(56,189,248,0.05);
}

.camera-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1px;
}

.camera-hint {
    font-size: 10px;
    color: #64748b;
    text-align: center;
    margin-top: 8px;
}

/* Keyboard bottom left */
.keyboard-ui {
    height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.row {
    display: flex;
    justify-content: center;
}

.key {
    width: 34px;
    height: 34px;
    margin: 4px;
    border: 1px solid rgba(56,189,248,0.3);
    color: #e5e7eb;
    text-align: center;
    line-height: 34px;
    font-size: 13px;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 6px;

    box-shadow:
        inset 0 0 6px rgba(56,189,248,0.2),
        0 0 8px rgba(56,189,248,0.1);

    transition: all 0.15s ease;
}

.key.special {
    border-color: #f59e0b;
    color: #f59e0b;
}


.key:hover {
    transform: translateY(-2px);
    box-shadow:
        0 0 12px rgba(56,189,248,0.6),
        0 0 25px rgba(56,189,248,0.4);
}

.key:hover::after {
    opacity: 1;
    transform: translateX(-50%) scale(1);
    box-shadow: 0 0 10px rgba(56,189,248,0.5);
}

/* Tooltip */
.key::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%) scale(0.9);

    background: rgba(2, 6, 23, 0.95);
    color: #38bdf8;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid rgba(56,189,248,0.3);

    white-space: nowrap;
    opacity: 0;
    pointer-events: none;

    transition: all 0.15s ease;
}

.key.show-tooltip::after {
    opacity: 1;
}

.key.active {
    background: #38bdf8;
    color: #020617;

    transform: translateY(1px);

    box-shadow:
        0 0 12px #38bdf8,
        0 0 25px rgba(56,189,248,0.6);
}

/* Zoom bottom right */
.zoom-ui {
    position: absolute;
    bottom: 20px;
    right: 20px;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ROTATE instead of relying on browser vertical slider */
.zoom-ui-vertical {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 150px;
    width: 40px;
}

#zoomSlider {
    transform: rotate(-90deg) translateX(-5px);
    transform-origin: center;
    width: 140px;
    height: 20px;
    accent-color: #38bdf8;
    appearance: none;
    background: rgba(56,189,248,0.2);
    border-radius: 4px;
}

#zoomSlider::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;

    background: #38bdf8;
    border: 2px solid #020617;

    box-shadow:
        0 0 8px #38bdf8,
        0 0 20px rgba(56,189,248,0.6);

    cursor: pointer;
}

#zoomSlider::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 4px;
}

input[type=range] {
    appearance: none;
    height: 6px;
    background: rgba(56,189,248,0.2);
    border-radius: 4px;
}

input[type=range]::-webkit-slider-thumb {
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;

    background: #38bdf8;
    border: 2px solid #020617;

    box-shadow:
        0 0 8px #38bdf8,
        0 0 15px rgba(56,189,248,0.5);
}

/* info overlay display */
.intro-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;

    backdrop-filter: blur(12px);
    background: rgba(2, 6, 23, 0.75);

    display: flex;
    align-items: center;
    justify-content: center;
}

/* Card */
.intro-card {
    width: 500px;
    max-width: 90%;

    padding: 25px;

    background: rgba(2, 6, 23, 0.9);
    border: 1px solid rgba(56,189,248,0.3);
    border-radius: 12px;

    box-shadow:
        0 0 20px rgba(56,189,248,0.2),
        inset 0 0 20px rgba(56,189,248,0.05);

    text-align: center;
}

/* Text */
.intro-content h2 {
    color: #38bdf8;
    margin-bottom: 10px;
}

.intro-content p {
    color: #94a3b8;
    font-size: 14px;
}

/* Buttons */
.intro-controls {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
}

.intro-controls button {
    background: transparent;
    border: 1px solid #38bdf8;
    color: #38bdf8;
    padding: 6px 12px;
    cursor: pointer;
    transition: 0.2s;
}

.intro-controls button:hover {
    background: #38bdf8;
    color: #020617;
}

/* Dots */
.intro-dots {
    margin-top: 15px;
}

.intro-dots span {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin: 4px;
    border-radius: 50%;
    background: #334155;
}

.intro-dots .active {
    background: #38bdf8;
}

.intro-card {
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Help Button */
.help-btn {
    position: absolute;
    top: 10px;
    right: 10px;

    width: 22px;
    height: 22px;

    border-radius: 50%;
    border: 1px solid rgba(56,189,248,0.4);

    background: rgba(2, 6, 23, 0.8);
    color: #38bdf8;

    font-size: 12px;
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    transition: all 0.2s ease;
}

.help-btn:hover {
    background: #38bdf8;
    color: #020617;
    box-shadow: 0 0 10px #38bdf8;
}

/* Select Drop Down */
select {
    background: #020617;
    color: #e5e7eb;
    border: 1px solid #38bdf8;
}

select option {
    background: #020617;
    color: #e5e7eb;
}


/* network info section */
.info-controls {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 8px;
    border: 1px solid rgba(56,189,248,0.15);
    border-radius: 6px;

    background: rgba(2, 6, 23, 0.4);
}


.toggle {
    display: flex;
    align-items: center;
    gap: 8px;

    font-size: 12px;
    color: #94a3b8;

    cursor: pointer;
    position: relative;
}

.toggle input {
    display: none;
}

.toggle span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle span::before {
    content: "";
    width: 16px;
    height: 16px;

    border: 1px solid rgba(56,189,248,0.4);
    border-radius: 4px;

    background: rgba(2, 6, 23, 0.6);

    box-shadow: inset 0 0 6px rgba(56,189,248,0.1);

    transition: all 0.15s ease;
}

.toggle input:checked + span::before {
    background: #38bdf8;

    box-shadow:
        0 0 10px #38bdf8,
        inset 0 0 6px rgba(255,255,255,0.2);
}

.toggle input:checked + span {
    color: #38bdf8;
}

#showInfoBtn {
    margin-top: 6px;
    background: rgba(2, 6, 23, 0.6);
    border: 1px solid #38bdf8;
    color: #38bdf8;
    padding: 6px;
    font-size: 12px;
}

.info-controls button {
    background: rgba(2, 6, 23, 0.6);
    border: 1px solid rgba(56,189,248,0.4);
    color: #38bdf8;
    padding: 6px;
    font-size: 12px;

    box-shadow:
        inset 0 0 6px rgba(56,189,248,0.15),
        0 0 6px rgba(56,189,248,0.05);

    transition: all 0.15s ease;
}

.info-controls button:hover {
    background: #38bdf8;
    color: #020617;

    transform: translateY(-1px);

    box-shadow:
        0 0 10px #38bdf8,
        0 0 20px rgba(56,189,248,0.5);
}

.info-controls button:active {
    transform: translateY(1px);
    box-shadow:
        0 0 6px rgba(56,189,248,0.5);
}

.pulse {
    animation: pulseGlow 0.4s ease;
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 0px rgba(56,189,248,0.0); }
    50% { box-shadow: 0 0 20px rgba(56,189,248,0.8); }
    100% { box-shadow: 0 0 0px rgba(56,189,248,0.0); }
}

.auto-indicator {
    font-size: 10px;
    color: #64748b;
    text-align: center;
}

.auto-indicator.active {
    color: #38bdf8;
}
