/* Mining Simulator - Custom Styles */

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

::-webkit-scrollbar-track {
    background: rgba(31, 41, 55, 0.5);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: rgba(75, 85, 99, 0.8);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(107, 114, 128, 0.8);
}

/* Range slider styling */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    margin-top: -5px;
}

input[type="range"]::-webkit-slider-runnable-track {
    height: 4px;
    background: #374151;
    border-radius: 2px;
}

input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    border: none;
}

input[type="range"]::-moz-range-track {
    height: 4px;
    background: #374151;
    border-radius: 2px;
}

/* Checkbox styling */
input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    background: #374151;
    border: 1px solid #4b5563;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
}

input[type="checkbox"]:checked {
    background: #3b82f6;
    border-color: #3b82f6;
}

input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Device list item styles */
.device-item {
    background: rgba(55, 65, 81, 0.5);
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.device-item:hover {
    background: rgba(75, 85, 99, 0.5);
    border-color: rgba(107, 114, 128, 0.3);
}

.device-item.selected {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.5);
}

.device-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.device-icon.sensor {
    background: linear-gradient(135deg, #10b981, #059669);
}

.device-icon.edge {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.device-icon.cloud {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.device-info {
    flex: 1;
    min-width: 0;
}

.device-name {
    font-weight: 500;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.device-status {
    font-size: 11px;
    color: #9ca3af;
}

.device-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.device-indicator.online {
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.device-indicator.warning {
    background: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.device-indicator.offline {
    background: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

/* Event log styles */
.event-item {
    display: flex;
    gap: 8px;
    padding: 4px 0;
    border-bottom: 1px solid rgba(55, 65, 81, 0.5);
}

.event-time {
    color: #6b7280;
    flex-shrink: 0;
}

.event-message {
    color: #d1d5db;
}

.event-item.info .event-message {
    color: #60a5fa;
}

.event-item.success .event-message {
    color: #34d399;
}

.event-item.warning .event-message {
    color: #fbbf24;
}

.event-item.error .event-message {
    color: #f87171;
}

/* Button active state */
.camera-btn.active {
    background: #3b82f6;
}

/* Glow effects for status indicators */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 5px currentColor;
    }
    50% {
        box-shadow: 0 0 15px currentColor, 0 0 25px currentColor;
    }
}

.status-pulse {
    animation: pulse-glow 2s ease-in-out infinite;
}

/* Info panel animations */
#info-panel {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

#info-panel.hidden {
    opacity: 0;
    transform: translateX(20px);
    pointer-events: none;
}

/* Loading screen fade out */
#loading-screen.fade-out {
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

/* Three.js label styles */
.label-3d {
    background: rgba(17, 24, 39, 0.9);
    border: 1px solid rgba(75, 85, 99, 0.5);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 11px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    color: white;
    white-space: nowrap;
    pointer-events: none;
}

.label-3d.sensor {
    border-color: rgba(16, 185, 129, 0.5);
}

.label-3d.edge {
    border-color: rgba(59, 130, 246, 0.5);
}

.label-3d.cloud {
    border-color: rgba(139, 92, 246, 0.5);
}

/* Tooltip styles */
.tooltip-3d {
    position: absolute;
    background: rgba(17, 24, 39, 0.95);
    border: 1px solid rgba(75, 85, 99, 0.5);
    border-radius: 8px;
    padding: 12px;
    font-size: 12px;
    color: white;
    pointer-events: none;
    z-index: 100;
    max-width: 250px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

/* Version badge */
.version-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Data flow particle trail effect */
.data-trail {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #60a5fa;
    box-shadow: 0 0 10px #60a5fa, 0 0 20px #60a5fa;
    pointer-events: none;
}

/* Mining scene specific */
.ore-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: linear-gradient(135deg, #78350f, #451a03);
    border-radius: 2px;
    pointer-events: none;
}
