/* i probably shouldve used tailwind */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #1a1a1a;
    color: white;
    overflow: hidden;
}

.container {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    background: rgba(0, 0, 0, 0.8);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
    z-index: 100;
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
    color: #00ff88;
}

.controls {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.export-btn {
    background: #00ff88;
    color: #000;
}

.export-btn:hover {
    background: #00cc6a;
    transform: translateY(-1px);
}

.clear-btn {
    background: #ff4757;
    color: white;
}

.clear-btn:hover {
    background: #ff3838;
    transform: translateY(-1px);
}

.help-btn {
    background: #3742fa;
    color: white;
}

.help-btn:hover {
    background: #2f32e2;
    transform: translateY(-1px);
}

.viewport {
    flex: 1;
    position: relative;
    overflow: hidden;
}

#webcam {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

#hands-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

#flowchart-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
}

.status-overlay {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.status-item {
    background: rgba(0, 0, 0, 0.8);
    padding: 10px 15px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    font-size: 14px;
    font-weight: 500;
    border: 1px solid rgba(0, 255, 136, 0.3);
}

.status-label {
    color: #888;
    margin-right: 8px;
}

#current-gesture {
    color: #00ff88;
    font-weight: 600;
}

.gesture-guide {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 280px;
    background: rgba(0, 0, 0, 0.85);
    padding: 15px;
    border-radius: 12px;
    backdrop-filter: blur(15px);
    z-index: 10;
    border: 1px solid rgba(0, 255, 136, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.gesture-guide h3 {
    margin-bottom: 12px;
    color: #00ff88;
    font-size: 16px;
    text-align: center;
    border-bottom: 1px solid rgba(0, 255, 136, 0.3);
    padding-bottom: 8px;
}

.gesture-guide-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.gesture-guide-header h3 {
    margin: 0;
    flex: 1;
    text-align: center;
    border-bottom: 1px solid rgba(0, 255, 136, 0.3);
    padding-bottom: 8px;
}

.toggle-guide-btn {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(0, 255, 136, 0.6);
    border-radius: 6px;
    color: #00ff88;
    width: 28px;
    height: 22px;
    font-size: 14px;
    font-weight: normal;
    font-family: monospace;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-left: 8px;
    flex-shrink: 0;
    backdrop-filter: blur(5px);
}

.toggle-guide-btn:hover {
    background: rgba(0, 255, 136, 0.15);
    border-color: #00ff88;
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 255, 136, 0.2);
}

.gesture-guide.minimized .gesture-list {
    display: none;
}

.gesture-guide.minimized {
    padding: 12px 15px;
    width: auto;
    min-width: 200px;
}

.gesture-guide.minimized .gesture-guide-header {
    margin-bottom: 0;
}

.gesture-guide.minimized .gesture-guide-header h3 {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.gesture-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gesture-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    transition: background 0.2s ease;
}

.gesture-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.gesture-icon {
    font-size: 18px;
    width: 25px;
    text-align: center;
    flex-shrink: 0;
}

.gesture-desc {
    font-size: 12px;
    line-height: 1.3;
}

.gesture-desc strong {
    color: #00ff88;
    font-size: 13px;
}

.voice-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #ff4757;
    border-radius: 50%;
    margin-left: 8px;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Help panel styles removed since help is now always visible */

/* Export canvas (hidden) */
#export-canvas {
    position: absolute;
    top: -9999px;
    left: -9999px;
}

/* Responsive design */
@media (max-width: 768px) {
    .header {
        padding: 8px 15px;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .gesture-guide {
        width: 240px;
        padding: 12px;
        top: 10px;
        right: 10px;
    }
    
    .gesture-guide-header h3 {
        font-size: 14px;
    }
    
    .toggle-guide-btn {
        width: 24px;
        height: 20px;
        font-size: 12px;
    }
    
    .gesture-guide.minimized {
        width: auto;
        min-width: 180px;
    }
    
    .gesture-item {
        gap: 8px;
        padding: 4px 6px;
    }
    
    .gesture-icon {
        font-size: 16px;
        width: 20px;
    }
    
    .gesture-desc {
        font-size: 11px;
    }
    
    .gesture-desc strong {
        font-size: 12px;
    }
    
    .status-overlay {
        top: 10px;
        left: 10px;
    }
}

.hidden {
    display: none !important;
}
