/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    overflow: hidden;
    height: 100vh;
}

/* Main container */
#container {
    display: flex;
    height: 100vh;
    position: relative;
}

/* 3D Avatar rendering area */
#avatar-container {
    flex: 1;
    position: relative;
    background: #000;
    border-radius: 10px;
    margin: 10px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Controls panel */
#controls {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 280px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
    border: 1px solid rgba(255, 255, 255, 0.18);
    z-index: 1000;
}

/* Secondary controls panel */
#secondary-controls {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 260px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
    border: 1px solid rgba(255, 255, 255, 0.18);
    z-index: 1000;
}

#controls h3, #secondary-controls h3 {
    margin-bottom: 15px;
    text-align: center;
    color: #fff;
    font-size: 1.1em;
}

.button-grid.compact {
    grid-template-columns: 1fr 1fr;
    gap: 5px;
}

.button-grid.compact button {
    padding: 8px 10px;
    font-size: 0.8em;
}

.control-group {
    margin-bottom: 20px;
}

.control-group h4 {
    margin-bottom: 10px;
    color: #fff;
    font-size: 1em;
}

/* Button grid for camera controls */
.button-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

/* Button styles */
button {
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.3s ease;
}

button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

button:active {
    transform: translateY(0);
}

#btn-reset {
    width: 100%;
    background: rgba(255, 107, 107, 0.3);
    margin-top: 10px;
}

#btn-reset:hover {
    background: rgba(255, 107, 107, 0.5);
}

/* Checkbox styles */
label {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    color: #fff;
    font-size: 0.9em;
    cursor: pointer;
}

input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}



/* Responsive design */
@media (max-width: 768px) {
    #controls {
        position: relative;
        width: 100%;
        margin: 10px;
        top: auto;
        right: auto;
    }
    
    #container {
        flex-direction: column;
    }
    
    #avatar-container {
        height: 60vh;
    }
    
    .button-grid {
        grid-template-columns: 1fr;
    }
}

/* Loading and status indicators */
.status-indicator {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 5px;
    color: white;
    font-size: 0.9em;
}

/* Animation for smooth transitions */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#controls {
    animation: fadeIn 0.6s ease-out;
}

/* Calibration controls */
#calibration-status {
    margin: 8px 0;
    padding: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    font-size: 0.8em;
    text-align: center;
}

#calibration-progress {
    margin: 8px 0;
    font-size: 0.8em;
    color: #00ff88;
    text-align: center;
    min-height: 20px;
}

.calibration-active {
    background: rgba(0, 255, 136, 0.2) !important;
    border: 1px solid #00ff88 !important;
}

.calibration-complete {
    background: rgba(255, 215, 0, 0.2) !important;
    border: 1px solid #ffd700 !important;
}

/* Progress bar styles */
.progress-bar-label {
    font-size: 0.8em;
    color: #fff;
    margin-bottom: 5px;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin: 5px 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #00ff88, #44ff44);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 9px;
}

#calibration-sample-count {
    font-size: 0.8em;
    color: #00ff88;
    text-align: center;
    margin-top: 5px;
    font-weight: bold;
}

#calibration-bar-container {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.control-group {
    margin-bottom: 15px;
}

.control-group h4 {
    margin-bottom: 8px;
    color: #fff;
    font-size: 0.9em;
}
