/* ================================
   MULTI-SELECT SYSTEM STYLES
   Phase 8 Priority 2 Implementation
   ================================ */

/* Multi-Select Controls */
.multi-select-controls {
    margin-bottom: 12px;
}

.selection-toolbar {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

.selection-toolbar:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.selection-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.selection-counter {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    padding: 2px 8px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.selection-actions {
    display: flex;
    gap: 4px;
}

.selection-actions button {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    font-size: 11px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: white;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.selection-actions button:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.selection-actions button:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Specific button colors */
.select-all-btn:hover {
    background: #dbeafe;
    border-color: #3b82f6;
    color: #1e40af;
}

.clear-selection-btn:hover {
    background: #fee2e2;
    border-color: #ef4444;
    color: #dc2626;
}

.bulk-drag-btn:hover {
    background: #f0fdf4;
    border-color: #22c55e;
    color: #16a34a;
}

.remove-selected-btn:hover {
    background: #fef2f2;
    border-color: #f87171;
    color: #dc2626;
}

/* Symbol Selection States */
[data-symbol].selected {
    background: rgba(59, 130, 246, 0.15) !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2) !important;
    transition: all 0.2s ease !important;
}

[data-symbol].selected:hover {
    background: rgba(59, 130, 246, 0.25) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3) !important;
}

/* Selection Checkbox Styling */
.symbol-checkbox-container {
    display: flex;
    align-items: center;
    margin-right: 8px;
    position: relative;
}

.symbol-checkbox {
    width: 16px !important;
    height: 16px !important;
    cursor: pointer !important;
    accent-color: var(--primary-color, #3b82f6) !important;
    transform: scale(1.1) !important;
    transition: all 0.2s ease !important;
}

.symbol-checkbox:hover {
    transform: scale(1.2) !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3) !important;
    border-radius: 2px;
}

.symbol-checkbox:checked {
    transform: scale(1.1) !important;
}

.symbol-checkbox:focus {
    outline: 2px solid rgba(59, 130, 246, 0.5);
    outline-offset: 2px;
}

/* Multi-Select Mode Visual Cues */
.watchlist-content.multi-select-mode [data-symbol] {
    cursor: pointer !important;
    user-select: none !important;
    transition: all 0.2s ease !important;
}

.watchlist-content.multi-select-mode [data-symbol]:hover {
    background: rgba(59, 130, 246, 0.08) !important;
    transform: translateX(2px);
}

/* Bulk Drag Feedback */
.bulk-drag-feedback {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    pointer-events: none;
    animation: slideInDown 0.3s ease-out;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Selection Animation Effects */
[data-symbol].selecting {
    animation: selectPulse 0.3s ease-out;
}

@keyframes selectPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.3);
    }
    100% {
        transform: scale(1);
    }
}

/* Range Selection Visual Feedback */
[data-symbol].range-selecting {
    background: rgba(59, 130, 246, 0.1) !important;
    border-color: rgba(59, 130, 246, 0.5) !important;
    transition: all 0.1s ease !important;
}

/* Multi-Select Button Toggle */
.multi-select-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    margin-bottom: 8px;
}

.multi-select-toggle:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.multi-select-toggle.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.multi-select-toggle.active:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

/* Keyboard Shortcut Hints */
.keyboard-hints {
    font-size: 10px;
    color: #9ca3af;
    margin-top: 4px;
    padding: 4px 8px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
}

.keyboard-hints .hint {
    margin-right: 12px;
}

.keyboard-hints .key {
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 2px;
    padding: 1px 3px;
    font-family: monospace;
    font-size: 9px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .selection-toolbar {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }
    
    .selection-actions {
        justify-content: space-between;
        flex-wrap: wrap;
    }
    
    .selection-actions button {
        flex: 1;
        min-width: 0;
        font-size: 10px;
        padding: 4px 6px;
    }
    
    .selection-counter {
        font-size: 11px;
        text-align: center;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .selection-toolbar {
        background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
        border-color: #374151;
        color: #f3f4f6;
    }
    
    .selection-actions button {
        background: #374151;
        border-color: #4b5563;
        color: #f3f4f6;
    }
    
    .selection-actions button:hover {
        background: #4b5563;
        border-color: #6b7280;
    }
    
    .selection-counter {
        background: rgba(59, 130, 246, 0.2);
        border-color: rgba(59, 130, 246, 0.3);
        color: #e5e7eb;
    }
    
    .keyboard-hints {
        background: #1f2937;
        border-color: #374151;
        color: #9ca3af;
    }
    
    .keyboard-hints .key {
        background: #374151;
        border-color: #4b5563;
        color: #e5e7eb;
    }
}

/* Accessibility Enhancements */
@media (prefers-reduced-motion: reduce) {
    .selection-toolbar,
    [data-symbol].selected,
    .symbol-checkbox,
    .bulk-drag-feedback {
        transition: none !important;
        animation: none !important;
    }
}

/* Focus Visible Support */
.selection-actions button:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.symbol-checkbox:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    [data-symbol].selected {
        background: #000080 !important;
        color: white !important;
        border: 2px solid #ffffff !important;
    }
    
    .selection-toolbar {
        border: 2px solid #000000;
    }
    
    .selection-actions button {
        border: 2px solid #000000;
    }
}