/* Intro Settings Widget Styles */
.intro-settings-widget {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 320px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #2d3748;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    font-family: 'Orbitron', monospace;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    cursor: move;
    user-select: none;
    max-height: calc(100vh - 40px);
    overflow: hidden;
}

.intro-settings-widget.dragging {
    transition: none;
    cursor: grabbing;
    transform: scale(1.02);
    box-shadow: 0 20px 50px rgba(147, 51, 234, 0.5);
}

.intro-settings-widget:hover {
    box-shadow: 0 15px 40px rgba(147, 51, 234, 0.3);
    border-color: #8b5cf6;
}

.widget-header {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
    border-radius: 10px 10px 0 0;
    cursor: grab;
    transition: background 0.3s ease;
    position: relative;
}

.widget-header:active {
    cursor: grabbing;
}

.widget-header::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background: linear-gradient(180deg, #8b5cf6, #6d28d9);
    border-radius: 2px;
    opacity: 0.6;
}

.widget-header:hover {
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
}

.widget-header:hover::before {
    opacity: 1;
}

.widget-icon {
    color: #8b5cf6;
    font-size: 16px;
    margin-right: 10px;
    animation: rotate 2s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.widget-title {
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    flex-grow: 1;
}

.widget-toggle {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.widget-toggle:hover {
    color: #8b5cf6;
    background: rgba(139, 92, 246, 0.1);
}

.widget-toggle.expanded {
    transform: rotate(180deg);
}

.widget-content {
    padding: 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.widget-content.expanded {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

/* Custom scrollbar for widget content */
.widget-content::-webkit-scrollbar {
    width: 4px;
}

.widget-content::-webkit-scrollbar-track {
    background: #374151;
    border-radius: 2px;
}

.widget-content::-webkit-scrollbar-thumb {
    background: #8b5cf6;
    border-radius: 2px;
}

.widget-content::-webkit-scrollbar-thumb:hover {
    background: #a78bfa;
}

.setting-group {
    margin-bottom: 20px;
}

.setting-item {
    margin-bottom: 20px;
}

.setting-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 8px;
    position: relative;
}

.setting-checkbox {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    background: #374151;
    border: 2px solid #4b5563;
    border-radius: 4px;
    margin-right: 12px;
    position: relative;
    transition: all 0.3s ease;
}

.checkmark:after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.setting-checkbox:checked + .checkmark {
    background: #8b5cf6;
    border-color: #8b5cf6;
}

.setting-checkbox:checked + .checkmark:after {
    opacity: 1;
}

.setting-text {
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    flex-grow: 1;
}

.setting-slider {
    width: 100%;
    height: 6px;
    background: #374151;
    border-radius: 3px;
    outline: none;
    margin: 8px 0;
    -webkit-appearance: none;
    appearance: none;
}

.setting-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #8b5cf6;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
    transition: all 0.3s ease;
}

.setting-slider::-webkit-slider-thumb:hover {
    background: #a78bfa;
    transform: scale(1.1);
}

.setting-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #8b5cf6;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
}

.setting-value {
    color: #8b5cf6;
    font-size: 12px;
    font-weight: 700;
    margin-left: 10px;
    min-width: 30px;
}

.setting-description {
    color: #9ca3af;
    font-size: 11px;
    line-height: 1.4;
    margin: 0;
    padding-left: 32px;
}

.widget-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.btn-reset,
.btn-test {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-reset {
    background: #374151;
    color: #ffffff;
}

.btn-reset:hover {
    background: #4b5563;
}

.btn-test {
    background: #8b5cf6;
    color: #ffffff;
}

.btn-test:hover {
    background: #a78bfa;
}

.widget-info {
    padding: 12px;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.info-text {
    color: #c7d2fe;
    font-size: 10px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.info-text i {
    color: #8b5cf6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .intro-settings-widget {
        width: 280px;
        right: 10px;
        top: 70px;
        max-height: calc(100vh - 80px);
    }
    
    .widget-header {
        padding: 12px 15px;
    }
    
    .widget-content {
        padding: 15px;
    }
    
    .widget-content.expanded {
        max-height: calc(100vh - 150px);
    }
    
    .widget-title {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .intro-settings-widget {
        width: calc(100vw - 20px);
        right: 10px;
        left: 10px;
        top: 60px;
    }
}

/* Boundary indicators for dragging */
.intro-settings-widget.at-boundary {
    border-color: #ef4444;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

/* Position indicator */
.position-indicator {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: rgba(139, 92, 246, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.intro-settings-widget.dragging .position-indicator {
    opacity: 1;
}

/* Animation for widget appearance */
@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.intro-settings-widget.show {
    animation: slideInFromRight 0.5s ease;
}

/* Glow effect for active states */
.setting-checkbox:checked + .checkmark {
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

.setting-slider::-webkit-slider-thumb:active {
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.8);
}

/* Pulse animation for test button */
.btn-test.testing {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}
