/* ============================================
   AI Avatar Assistant - Professional Styles
   Gradient Background Version
   ============================================ */

:root {
    --gradient-top: #BED4D8;
    --gradient-bottom: #4B585C;
    --accent-primary: #00d4ff;
    --text-primary: rgba(255, 255, 255, 0.95);
    --text-secondary: rgba(255, 255, 255, 0.6);
}

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Plus Jakarta Sans', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ============================================
   Avatar Container with GRADIENT BACKGROUND
   ============================================ */
#avatar-container {
    width: 100vw;
    height: 100vh;
    position: relative;
    /* DIAGONAL GRADIENT: Bottom color dominant */
    background: linear-gradient(
        135deg,
        var(--gradient-top) 0%,
        var(--gradient-bottom) 35%,
        var(--gradient-bottom) 100%
    );
}

#avatar-canvas {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 1;
}

/* ============================================
   Loading Screen
   ============================================ */
#loading-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--gradient-top) 0%, var(--gradient-bottom) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

#loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.loader {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

#loading-text {
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 1px;
}

.progress-bar {
    width: 200px;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
}

#progress-fill {
    width: 0%;
    height: 100%;
    background: #fff;
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* ============================================
   Debug Panel - Lighting Controls
   ============================================ */
#debug-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 280px;
    max-height: calc(100vh - 40px);
    background: rgba(30, 40, 45, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

#debug-panel.hidden {
    display: none;
}

#debug-panel h3 {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 18px;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.light-control {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.light-control:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.light-control label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.light-control input[type="range"] {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

.light-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent-primary);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.15s ease;
    box-shadow: 0 2px 8px rgba(0, 212, 255, 0.4);
}

.light-control input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.light-control input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--accent-primary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* ============================================
   Utility
   ============================================ */
.hidden {
    display: none !important;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ============================================
   Test Controls (Bottom Left)
   ============================================ */
#test-controls {
    position: absolute;
    bottom: 20px;
    left: 20px;
    display: flex;
    gap: 10px;
    z-index: 100;
}

#test-controls button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    color: white;
    background: rgba(30, 40, 45, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

#test-controls button:hover {
    background: rgba(50, 60, 65, 0.9);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

#test-controls button:active {
    transform: translateY(0);
}

.btn-primary {
    background: rgba(0, 180, 220, 0.3) !important;
    border-color: rgba(0, 212, 255, 0.5) !important;
}

.btn-primary:hover {
    background: rgba(0, 180, 220, 0.5) !important;
}

.btn-icon {
    font-size: 16px;
}

/* ============================================
   Keyboard Hints (Bottom Center)
   ============================================ */
#keyboard-hints {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 16px;
    padding: 10px 20px;
    background: rgba(30, 40, 45, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 50;
}

#keyboard-hints span {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 4px;
}

#keyboard-hints kbd {
    display: inline-block;
    padding: 2px 6px;
    font-size: 10px;
    font-family: inherit;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Responsive: Hide hints on mobile */
@media (max-width: 768px) {
    #keyboard-hints {
        display: none;
    }
    
    #test-controls {
        flex-wrap: wrap;
        max-width: calc(100% - 40px);
    }
}
