/* Helper Popup Styles */
.helper-popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    max-width: 90%;
    background-color: rgba(40, 40, 70, 0.95);
    border: 2px solid var(--purple-light);
    border-radius: 12px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    transition: opacity var(--popup-animation-duration, 500ms) ease;
    color: #fff;
}

.helper-popup.visible {
    display: block;
    opacity: 1;
}

.helper-popup-content {
    position: relative;
    padding: 20px;
}

.helper-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.helper-popup-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #fff;
}

.helper-popup-drag-handle {
    cursor: grab;
    padding: 5px;
    margin-left: auto;
}

.helper-popup-drag-handle:active {
    cursor: grabbing;
}

.helper-popup-close {
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    padding: 5px;
    transition: color 0.2s ease;
	-webkit-appearance: none;
	outline: 0;
}

.helper-popup-close:focus, .helper-popup-close:focus-visible {
	outline: 1px solid;
}

.helper-popup-close svg {
    width: 24px;
    height: 24px;
}

.helper-popup-close:hover svg {
    fill: var(--purple-light);
}

.helper-popup-body {
    position: relative;
}

.helper-popup-timer-bar {
    position: absolute;
    top: -10px;
    left: 0;
    height: 3px;
    width: 100%;
    background-color: var(--purple-light);
    overflow: hidden;
}

.helper-popup-timer-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    animation: timer-progress var(--helper-popup-duration, 10000ms) linear forwards;
}

@keyframes timer-progress {
    0% { width: 100%; }
    100% { width: 0%; }
}

.helper-popup-instructions {
    margin: 15px 0;
}

.instruction-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.instruction-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-right: 15px;
    color: var(--purple-light);
}

.instruction-icon svg {
    width: 24px;
    height: 24px;
    stroke: #b341ff;
}

.instruction-icon svg g, #mouseWheel path {
    fill: #b341ff !important;
}

.instruction-text {
    flex: 1;
    font-size: 16px;
    line-height: 1.4;
}

.helper-popup-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: flex-end;
}

.dont-show-again {
    display: flex;
    align-items: center;
    font-size: 14px;
    cursor: pointer;
}

.dont-show-again input {
    margin-right: 8px;
    width: auto;
}

/* Help Icon */
.help-icon {
    position: fixed;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background-color: rgba(40, 40, 70, 0.8);
    border: 2px solid var(--purple-light);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 50;
    transition: transform 0.3s ease, background-color 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.help-icon:hover {
    background-color: var(--purple-light);
    transform: scale(1.1);
}

.help-icon svg {
    width: 24px;
    height: 24px;
    stroke: #fff;
}

/* Pulsating animation for help icon */
@keyframes pulsate {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(179, 65, 255, 0.7); }
    50% { transform: scale(1.1); box-shadow: 0 0 0 10px rgba(179, 65, 255, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(179, 65, 255, 0); }
}

.help-icon.pulsating {
    animation: pulsate 2s infinite;
}

/* Responsive styles */
@media (max-width: 1024px) {
	.help-icon {
		bottom: 12px;
	}
}
@media (max-width: 768px) {
    .helper-popup {
		width: 90%;
		max-width: 400px;
		top: 50% !important;
		left: 50% !important;
		transform: translate(-50%, -50%) !important;
	}
    
    .instruction-item {
        margin-bottom: 12px;
    }
    
    .instruction-icon {
        width: 30px;
        height: 30px;
        margin-right: 10px;
    }
    
    .instruction-text {
        font-size: 14px;
    }
    
    .helper-popup-header h3 {
        font-size: 18px;
    }
}

/* Touch device styles */
@media (pointer: coarse) {
    .helper-popup-drag-handle {
        padding: 8px;
    }
    
    .helper-popup-close {
        padding: 8px;
        font-size: 28px;
    }
    
    .instruction-icon {
        width: 44px;
        height: 44px;
    }
    
    .instruction-icon svg {
        width: 28px;
        height: 28px;
    }
    
    .dont-show-again input[type="checkbox"] {
        width: 20px;
        height: 20px;
    }
}