:root {
    --primary-color: #00ff88;
    --secondary-color: #00d4ff;
    --bg-dark: #0a0e27;
    --bg-light: #1a1f3a;
    --text-primary: #ffffff;
    --text-secondary: #b0b9d4;
    --accent-color: #ff006e;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-light) 100%);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
}

#app {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.header {
    padding: 20px;
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(0, 255, 136, 0.2);
    z-index: 10;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 5px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header p {
    color: var(--text-secondary);
    font-size: 0.95em;
}

.controls {
    padding: 15px 20px;
    background: rgba(26, 31, 58, 0.8);
    border-bottom: 1px solid rgba(0, 212, 255, 0.1);
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
    z-index: 10;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-group label {
    font-size: 0.9em;
    color: var(--text-secondary);
    white-space: nowrap;
}

.control-group input[type="file"],
.control-group input[type="range"] {
    padding: 5px 10px;
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid var(--primary-color);
    border-radius: 4px;
    color: var(--text-primary);
    cursor: pointer;
}

.control-group input[type="range"] {
    width: 150px;
    padding: 0;
}

.control-group input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

#particleCountDisplay {
    color: var(--primary-color);
    font-weight: bold;
    min-width: 40px;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    color: var(--bg-dark);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 255, 136, 0.4);
}

.btn-secondary {
    background: rgba(255, 0, 110, 0.2);
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
}

.btn-secondary:hover {
    background: rgba(255, 0, 110, 0.3);
    box-shadow: 0 5px 20px rgba(255, 0, 110, 0.2);
}

.canvas-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

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

.camera-container {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 200px;
    height: 200px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid var(--primary-color);
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.2);
    z-index: 20;
}

#cameraFeed,
#cameraCanvas {
    width: 100%;
    height: 100%;
    display: block;
    transform: scaleX(-1);
}

#cameraCanvas {
    display: none;
}

.info-panel {
    position: absolute;
    top: 120px;
    left: 20px;
    background: rgba(10, 14, 39, 0.9);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 8px;
    padding: 15px;
    z-index: 20;
    min-width: 200px;
    backdrop-filter: blur(10px);
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.9em;
}

.info-item:last-child {
    margin-bottom: 0;
}

.info-item .label {
    color: var(--text-secondary);
}

.info-item .value {
    color: var(--primary-color);
    font-weight: bold;
    font-family: 'Courier New', monospace;
}

.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 100;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.loading.active {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(0, 255, 136, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading p {
    color: var(--text-secondary);
    font-size: 1.1em;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8em;
    }

    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .control-group {
        width: 100%;
        justify-content: space-between;
    }

    .btn {
        width: 100%;
    }

    .camera-container {
        width: 150px;
        height: 150px;
        bottom: 10px;
        right: 10px;
    }

    .info-panel {
        top: auto;
        bottom: 180px;
        left: 10px;
        right: 10px;
    }
}
