:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --text-color: #f3f4f6;
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.15);
}

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

body {
    margin: 0;
    overflow: hidden;
    background-color: #050510;
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
}

/* Canvas Setup */
canvas {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
}

/* Glassmorphism Classes */
.glassmorphism {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Base Buttons */
.btn {
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-family: inherit;
    color: white;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    outline: none;
}
.btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}
.btn:active {
    transform: translateY(0);
}
.btn-primary {
    background: var(--primary-color);
}
.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 0 15px var(--primary-color);
}
.btn-icon {
    padding: 8px;
    border-radius: 50%;
}
.btn-large {
    padding: 12px;
}

/* HUD Overlay */
.overlay {
    position: fixed;
    z-index: 10;
    left: 20px;
    right: 20px;
    bottom: 20px;
    top: 20px;
    pointer-events: none; /* Let clicks pass through empty spaces */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: none;
    box-shadow: none;
    background: none;
    backdrop-filter: none;
}

/* Child elements of HUD should capture events */
.overlay > * {
    pointer-events: auto;
}

.hud-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.hud-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.presets {
    display: flex;
    gap: 10px;
    align-items: center;
    background: var(--glass-bg);
    padding: 10px 15px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(8px);
}
.presets .label {
    font-size: 0.85rem;
    color: #cbd5e1;
    margin-right: 8px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
}


.controls {
    display: flex;
    gap: 16px;
    align-items: center;
    background: var(--glass-bg);
    padding: 12px 24px;
    border-radius: 50px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
}

.speed-control {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--glass-bg);
    padding: 8px 18px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(8px);
}

.camera-info {
    position: absolute;
    bottom: 0px;
    right: 0px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    pointer-events: none;
}

/* Modal Settings */
.modal-container {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    transition: opacity 0.3s ease;
}
.modal-container.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal {
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
}

.modal-content {
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
}
/* Scrollbar Styling */
.modal-content::-webkit-scrollbar {
    width: 8px;
}
.modal-content::-webkit-scrollbar-track {
    background: transparent;
}
.modal-content::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: flex-end;
}

/* Form inputs */
.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.setting-row label {
    font-size: 0.9rem;
    color: #e2e8f0;
}
.setting-row input[type="number"], .setting-row input[type="text"], .setting-row input[type="color"] {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    outline: none;
    width: 100px;
    font-family: monospace;
}
.setting-row input[type="color"] {
    padding: 0;
    width: 40px;
    height: 30px;
    cursor: pointer;
}

.body-card {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 16px;
    margin-top: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.body-card h4 {
    margin-bottom: 12px;
    color: #94a3b8;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.color-swatch {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-block;
}

/* Range Input Styling */
input[type=range] {
    -webkit-appearance: none;
    width: 150px;
    background: transparent;
}
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    margin-top: -6px;
    box-shadow: 0 0 10px var(--primary-color);
}
input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}
