/* 3D Hitbox Visualization Styles */
/* Стили для 3D визуализации хитбоксов */

.hitbox-3d-container {
    position: relative;
    width: 470px;
    height: 360px;
    margin: 0 auto;
    border-radius: 8px;
    overflow: hidden;
    font-family: Arial, sans-serif;
    background: linear-gradient(135deg, #1e1e2e 0%, #2a2d47 100%);
    border: 2px solid #4f5375;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* 3D Canvas стили */
.hitbox-3d-canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: grab;
}

.hitbox-3d-canvas:active {
    cursor: grabbing;
}

/* Панель управления моделями */
.hitbox-model-selector {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(30, 30, 46, 0.9);
    border: 1px solid #4f5375;
    border-radius: 6px;
    padding: 8px;
    z-index: 10;
}

.hitbox-model-selector select {
    background: rgba(79, 83, 117, 0.8);
    color: #cdd6f4;
    border: 1px solid #6c7086;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 11px;
    outline: none;
    cursor: pointer;
}

.hitbox-model-selector select:hover {
    background: rgba(116, 199, 236, 0.2);
    border-color: #74c7ec;
}

.hitbox-model-selector label {
    color: #b4befe;
    font-size: 10px;
    margin-right: 5px;
}

/* Панель управления камерой */
.hitbox-camera-controls {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(30, 30, 46, 0.9);
    border: 1px solid #4f5375;
    border-radius: 6px;
    padding: 6px;
    z-index: 10;
    display: flex;
    gap: 4px;
}

.hitbox-camera-btn {
    width: 24px;
    height: 24px;
    background: rgba(79, 83, 117, 0.8);
    border: 1px solid #6c7086;
    border-radius: 4px;
    color: #cdd6f4;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.hitbox-camera-btn:hover {
    background: rgba(116, 199, 236, 0.3);
    border-color: #74c7ec;
    transform: scale(1.1);
}

.hitbox-camera-btn:active {
    transform: scale(0.95);
}

/* Индикатор режима */
.hitbox-mode-indicator {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(166, 227, 161, 0.9);
    color: #1e1e2e;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 4px;
}

.hitbox-mode-indicator::before {
    content: "●";
    color: #a6e3a1;
    font-size: 8px;
    animation: pulse-indicator 2s infinite;
}

.hitbox-mode-indicator.mode-2d {
    background: rgba(250, 179, 135, 0.9);
}

.hitbox-mode-indicator.mode-2d::before {
    color: #fab387;
}

@keyframes pulse-indicator {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Статистическая панель для 3D режима */
.hitbox-3d-stats {
    position: absolute;
    top: 45px;
    left: 10px;
    background: rgba(30, 30, 46, 0.95);
    color: #cdd6f4;
    padding: 10px;
    border-radius: 6px;
    font-size: 11px;
    min-width: 160px;
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid #4f5375;
    backdrop-filter: blur(5px);
    z-index: 5;
}

.hitbox-3d-stats .weapon-name {
    color: #a6e3a1;
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 12px;
    text-align: center;
    border-bottom: 1px solid #4f5375;
    padding-bottom: 4px;
}

.hitbox-3d-stats .stat-line {
    display: flex;
    justify-content: space-between;
    margin: 3px 0;
    padding: 2px 0;
    transition: all 0.2s ease;
    border-radius: 2px;
    padding: 2px 4px;
}

.hitbox-3d-stats .stat-line:hover {
    background: rgba(116, 199, 236, 0.1);
    transform: translateX(2px);
}

.hitbox-3d-stats .stat-line.highlighted {
    background: rgba(243, 139, 168, 0.2);
    border-left: 2px solid #f38ba8;
}

.hitbox-3d-stats .stat-label {
    color: #b4befe;
    flex: 1;
    font-size: 10px;
}

.hitbox-3d-stats .stat-value {
    color: #f9e2af;
    font-weight: bold;
    margin-left: 8px;
    font-size: 10px;
}

.hitbox-3d-stats .stat-percent {
    color: #fab387;
    margin-left: 4px;
    font-size: 9px;
}

/* Прогресс-бары для 3D режима */
.hitbox-3d-progress {
    width: 100%;
    height: 3px;
    background: rgba(79, 83, 117, 0.3);
    border-radius: 2px;
    margin-top: 2px;
    overflow: hidden;
}

.hitbox-3d-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #a6e3a1, #74c7ec, #f38ba8);
    border-radius: 2px;
    transition: width 0.5s ease;
    position: relative;
}

.hitbox-3d-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progress-shine 2s infinite;
}

@keyframes progress-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(400%); }
}

/* Tooltip для 3D элементов */
#hitbox-3d-tooltip {
    position: fixed;
    background: rgba(30, 30, 46, 0.98);
    color: #cdd6f4;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 12px;
    border: 1px solid #4f5375;
    pointer-events: none;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.2s ease;
    transform: scale(0.9);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    max-width: 200px;
}

#hitbox-3d-tooltip.show {
    opacity: 1;
    transform: scale(1);
}

#hitbox-3d-tooltip strong {
    color: #a6e3a1;
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
}

/* Режим загрузки */
.hitbox-3d-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #74c7ec;
    font-size: 14px;
    text-align: center;
    z-index: 100;
}

.hitbox-3d-loading::after {
    content: '';
    display: block;
    width: 24px;
    height: 24px;
    margin: 10px auto;
    border: 3px solid rgba(116, 199, 236, 0.3);
    border-top-color: #74c7ec;
    border-radius: 50%;
    animation: loading-spin 1s linear infinite;
}

@keyframes loading-spin {
    to { transform: rotate(360deg); }
}

/* Ошибка WebGL */
.hitbox-3d-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #f38ba8;
    font-size: 12px;
    text-align: center;
    background: rgba(30, 30, 46, 0.9);
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #f38ba8;
    max-width: 250px;
    z-index: 100;
}

.hitbox-3d-error strong {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
}

.hitbox-3d-error small {
    color: #cdd6f4;
    opacity: 0.8;
}

/* Элементы управления анимацией */
.hitbox-animation-controls {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(30, 30, 46, 0.9);
    border: 1px solid #4f5375;
    border-radius: 6px;
    padding: 6px;
    z-index: 10;
    display: flex;
    gap: 4px;
    align-items: center;
}

.hitbox-animation-controls button {
    width: 28px;
    height: 20px;
    background: rgba(79, 83, 117, 0.8);
    border: 1px solid #6c7086;
    border-radius: 3px;
    color: #cdd6f4;
    font-size: 9px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hitbox-animation-controls button:hover {
    background: rgba(116, 199, 236, 0.3);
    border-color: #74c7ec;
}

.hitbox-animation-controls button.active {
    background: rgba(166, 227, 161, 0.3);
    border-color: #a6e3a1;
    color: #a6e3a1;
}

.hitbox-animation-controls .speed-slider {
    width: 40px;
    height: 4px;
    margin: 0 4px;
    cursor: pointer;
}

/* Адаптивность */
@media (max-width: 600px) {
    .hitbox-3d-container {
        width: 100%;
        max-width: 400px;
        height: 280px;
    }
    
    .hitbox-3d-stats {
        font-size: 10px;
        min-width: 140px;
        max-height: 180px;
        padding: 8px;
    }
    
    .hitbox-model-selector,
    .hitbox-camera-controls,
    .hitbox-animation-controls {
        font-size: 9px;
        padding: 4px;
    }
    
    #hitbox-3d-tooltip {
        font-size: 11px;
        padding: 8px 10px;
        max-width: 160px;
    }
}

/* Высококачественные эффекты для больших экранов */
@media (min-width: 1200px) {
    .hitbox-3d-container {
        width: 600px;
        height: 450px;
    }
    
    .hitbox-3d-container {
        box-shadow: 
            0 4px 20px rgba(0, 0, 0, 0.3),
            0 0 40px rgba(116, 199, 236, 0.1);
    }
    
    .hitbox-3d-stats {
        backdrop-filter: blur(10px);
        border: 1px solid rgba(116, 199, 236, 0.3);
    }
}

/* Анимации переходов */
.hitbox-fade-in {
    animation: fade-in 0.5s ease-out;
}

.hitbox-slide-up {
    animation: slide-up 0.3s ease-out;
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slide-up {
    from { 
        opacity: 0; 
        transform: translateY(10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* Специальные эффекты для попаданий */
.hitbox-damage-flash {
    animation: damage-flash 0.8s ease-out;
}

@keyframes damage-flash {
    0% { 
        box-shadow: 0 0 0 rgba(255, 102, 102, 0);
        transform: scale(1);
    }
    30% { 
        box-shadow: 0 0 20px rgba(255, 102, 102, 0.8);
        transform: scale(1.05);
    }
    100% { 
        box-shadow: 0 0 0 rgba(255, 102, 102, 0);
        transform: scale(1);
    }
}

/* Тематические цвета для разных персонажей */
.hitbox-3d-container.character-alyx {
    border-color: #fab387;
    box-shadow: 0 4px 20px rgba(250, 179, 135, 0.2);
}

.hitbox-3d-container.character-ct {
    border-color: #74c7ec;
    box-shadow: 0 4px 20px rgba(116, 199, 236, 0.2);
}

.hitbox-3d-container.character-terrorist {
    border-color: #f38ba8;
    box-shadow: 0 4px 20px rgba(243, 139, 168, 0.2);
}

/* Производительность */
.hitbox-3d-container * {
    box-sizing: border-box;
}

.hitbox-3d-container canvas {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: optimize-contrast;
}

/* Доступность */
@media (prefers-reduced-motion: reduce) {
    .hitbox-3d-container *,
    .hitbox-3d-container *::before,
    .hitbox-3d-container *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}