/**
 * HUD Overlay Styles - name tags, selection highlights, etc.
 */

#hud-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 500;
}

/* Avatar Name Tags */
.avatar-nametag {
    position: absolute;
    transform: translate(-50%, -100%);
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.6) 100%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    padding: 4px 8px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    white-space: nowrap;
}

.nametag-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    margin-bottom: 2px;
}

.nametag-distance {
    font-size: 10px;
    color: #aaa;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* Selection Highlight */
.selection-highlight {
    position: absolute;
    border: 2px solid rgba(255, 200, 0, 0.8);
    box-shadow:
        0 0 10px rgba(255, 200, 0, 0.6),
        inset 0 0 10px rgba(255, 200, 0, 0.3);
    pointer-events: none;
    animation: pulse-selection 1.5s ease-in-out infinite;
}

@keyframes pulse-selection {

    0%,
    100% {
        border-color: rgba(255, 200, 0, 0.8);
        box-shadow:
            0 0 10px rgba(255, 200, 0, 0.6),
            inset 0 0 10px rgba(255, 200, 0, 0.3);
    }

    50% {
        border-color: rgba(255, 220, 50, 1);
        box-shadow:
            0 0 20px rgba(255, 220, 50, 0.8),
            inset 0 0 15px rgba(255, 220, 50, 0.5);
    }
}

/* Build Mode Indicators */
.build-axis-indicator {
    position: absolute;
    width: 60px;
    height: 60px;
    pointer-events: none;
}

.build-axis-x {
    border-left: 3px solid #ff0000;
}

.build-axis-y {
    border-bottom: 3px solid #00ff00;
}

.build-axis-z {
    border-top: 3px solid #0000ff;
}

/* Hover Text (tooltips for objects) */
.object-hover-text {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 12px;
    color: #fff;
    pointer-events: none;
    max-width: 300px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.hover-text-name {
    font-weight: 600;
    margin-bottom: 4px;
    color: #ffd700;
}

.hover-text-owner {
    font-size: 11px;
    color: #aaa;
    margin-bottom: 2px;
}

.hover-text-description {
    font-size: 11px;
    color: #ddd;
    font-style: italic;
}

/* Crosshair */
.crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    pointer-events: none;
}

.crosshair::before,
.crosshair::after {
    content: '';
    position: absolute;
    background: rgba(255, 255, 255, 0.8);
}

.crosshair::before {
    left: 50%;
    top: 0;
    width: 2px;
    height: 100%;
    transform: translateX(-50%);
}

.crosshair::after {
    top: 50%;
    left: 0;
    height: 2px;
    width: 100%;
    transform: translateY(-50%);
}

/* Typing indicator (when someone is typing nearby) */
.typing-indicator {
    position: absolute;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 12px;
    padding: 4px 8px;
    font-size: 11px;
    color: #fff;
    pointer-events: none;
}

.typing-dots {
    display: inline-flex;
    gap: 3px;
}

.typing-dot {
    width: 4px;
    height: 4px;
    background: #fff;
    border-radius: 50%;
    animation: typing-bounce 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing-bounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-6px);
    }
}

/* Control Panels (Movement, Build, etc.) */
.control-panel {
    position: absolute;
    top: 80px;
    right: 20px;
    width: 300px;
    background: linear-gradient(180deg, rgba(30, 30, 30, 0.95) 0%, rgba(20, 20, 20, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
    z-index: 800;
    pointer-events: auto;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: linear-gradient(180deg, rgba(50, 50, 50, 0.9) 0%, rgba(40, 40, 40, 0.9) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px 6px 0 0;
    font-weight: 600;
    font-size: 13px;
}

.panel-close {
    background: rgba(255, 0, 0, 0.6);
    border: none;
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    transition: all 0.2s;
}

.panel-close:hover {
    background: rgba(255, 0, 0, 0.8);
    transform: scale(1.1);
}

.panel-content {
    padding: 12px;
}

.control-section {
    margin-bottom: 16px;
}

.control-section h4 {
    margin: 0 0 8px 0;
    font-size: 12px;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.button-group {
    display: flex;
    gap: 6px;
}

.control-btn {
    flex: 1;
    padding: 8px 12px;
    background: rgba(60, 60, 60, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.control-btn:hover {
    background: rgba(80, 80, 80, 0.9);
    border-color: rgba(100, 150, 255, 0.5);
}

.control-btn.active {
    background: linear-gradient(135deg, rgba(60, 120, 200, 0.8) 0%, rgba(40, 80, 160, 0.9) 100%);
    border-color: rgba(100, 150, 255, 0.8);
}

.movement-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.move-btn {
    padding: 12px 8px;
    background: rgba(60, 60, 60, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.move-btn span {
    font-size: 9px;
    text-transform: uppercase;
}

.move-btn:hover {
    background: rgba(80, 80, 80, 0.9);
    border-color: rgba(100, 150, 255, 0.5);
}

.move-btn:active {
    background: rgba(100, 100, 100, 0.9);
    transform: scale(0.95);
}

#cam-distance {
    width: 100%;
    \n margin-bottom: 4px;
}

#cam-distance-value {
    font-size: 11px;
    color: #aaa;
}

/* Stand Up Button */
.stand-button {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    background: linear-gradient(135deg, rgba(211, 84, 0, 0.95) 0%, rgba(160, 64, 0, 0.98) 100%);
    border: 2px solid rgba(255, 150, 50, 0.8);
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(211, 84, 0, 0.6);
    transition: all 0.2s;
    z-index: 1000;
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stand-button:hover {
    background: linear-gradient(135deg, rgba(230, 126, 34, 0.98) 0%, rgba(211, 84, 0, 1) 100%);
    transform: translateX(-50%) scale(1.05);
    box-shadow: 0 6px 20px rgba(230, 126, 34, 0.8);
}

.stand-button:active {
    transform: translateX(-50%) scale(0.98);
}

.stand-button .material-icons {
    font-size: 24px;
}