/* 🐟💥 Fishcannon - Controls Styles */

/* ===== SPECIALIZED CONTROL COMPONENTS ===== */

/* Canvas Interaction Overlays */
.canvas-interaction-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

.canvas-interaction-overlay.active {
    pointer-events: auto;
}

/* Trajectory Preview */
.trajectory-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
}

.trajectory-line {
    stroke: #3498db;
    stroke-width: 2;
    stroke-dasharray: 5,5;
    fill: none;
    opacity: 0.7;
    animation: dashFlow 2s linear infinite;
}

@keyframes dashFlow {
    0% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: 20; }
}

/* Launch Indicator */
.launch-indicator {
    position: absolute;
    width: 100px;
    height: 100px;
    border: 3px solid #2ecc71;
    border-radius: 50%;
    background: rgba(46, 204, 113, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 200;
}

.launch-indicator.active {
    opacity: 1;
    transform: scale(1);
}

.launch-indicator.firing {
    animation: launchPulse 0.5s ease;
}

@keyframes launchPulse {
    0% { transform: scale(1); background: rgba(46, 204, 113, 0.1); }
    50% { transform: scale(1.2); background: rgba(46, 204, 113, 0.3); }
    100% { transform: scale(1); background: rgba(46, 204, 113, 0.1); }
}

/* ===== ENHANCED BUTTON STYLES ===== */
.action-button.loading {
    position: relative;
    pointer-events: none;
}

.action-button.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: buttonSpin 1s linear infinite;
}

.action-button.loading .button-icon,
.action-button.loading span:not(.button-icon) {
    opacity: 0;
}

@keyframes buttonSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success/Error Button States */
.action-button.success {
    background: linear-gradient(135deg, #2ecc71, #27ae60) !important;
}

.action-button.error {
    background: linear-gradient(135deg, #e74c3c, #c0392b) !important;
}

/* ===== ADVANCED PARAMETER CONTROLS ===== */
.parameter-group {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.parameter-group:last-child {
    margin-bottom: 0;
}

.parameter-group-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #3498db;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.parameter-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.parameter-row:last-child {
    margin-bottom: 0;
}

.parameter-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.parameter-label {
    font-size: 0.9rem;
    color: #ecf0f1;
    font-weight: 500;
}

.parameter-description {
    font-size: 0.75rem;
    color: #95a5a6;
    line-height: 1.3;
}

.parameter-input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.parameter-value-display {
    min-width: 60px;
    padding: 0.25rem 0.5rem;
    background: rgba(52, 152, 219, 0.2);
    border: 1px solid #3498db;
    border-radius: 4px;
    color: #3498db;
    font-size: 0.85rem;
    text-align: center;
    font-weight: 500;
}

/* Enhanced Range Sliders */
.parameter-slider {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(90deg, #34495e 0%, #2c3e50 100%);
    outline: none;
    -webkit-appearance: none;
    position: relative;
}

.parameter-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3498db, #2980b9);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.4);
    transition: all 0.3s ease;
}

.parameter-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.6);
}

.parameter-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3498db, #2980b9);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.4);
    transition: all 0.3s ease;
}

.parameter-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.6);
}

/* Slider Track Progress */
.parameter-slider {
    background: linear-gradient(90deg, #3498db 0%, #3498db var(--progress, 0%), #34495e var(--progress, 0%), #34495e 100%);
}

/* ===== PRESET CONTROLS ===== */
.preset-controls {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.preset-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
}

.preset-button {
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: #bdc3c7;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.preset-button:hover {
    border-color: #3498db;
    background: rgba(52, 152, 219, 0.1);
    color: #3498db;
}

.preset-button.active {
    border-color: #2ecc71;
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}

.preset-actions {
    display: flex;
    gap: 0.5rem;
}

.preset-action {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: #bdc3c7;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.preset-action:hover {
    border-color: #3498db;
    background: rgba(52, 152, 219, 0.1);
    color: #3498db;
}

/* ===== QUICK ACCESS TOOLBAR ===== */
.quick-toolbar {
    position: absolute;
    top: 1rem;
    left: 1rem;
    display: flex;
    gap: 0.5rem;
    z-index: 300;
}

.quick-button {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.quick-button:hover {
    background: rgba(52, 152, 219, 0.8);
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
}

.quick-button.active {
    background: rgba(46, 204, 113, 0.8);
    border-color: #2ecc71;
}

/* ===== HELP TOOLTIPS ===== */
.help-tooltip {
    position: relative;
    display: inline-block;
    margin-left: 0.25rem;
}

.help-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(52, 152, 219, 0.3);
    color: #3498db;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: help;
    font-weight: bold;
}

.tooltip-content {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
    margin-bottom: 0.5rem;
}

.tooltip-content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
}

.help-tooltip:hover .tooltip-content {
    opacity: 1;
}

/* ===== KEYBOARD SHORTCUTS ===== */
.keyboard-shortcut {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: 0.5rem;
    opacity: 0.7;
    font-size: 0.75rem;
}

.key {
    padding: 0.125rem 0.25rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    font-size: 0.7rem;
    min-width: 1.5rem;
    text-align: center;
    color: #bdc3c7;
}

/* ===== RESPONSIVE CONTROLS ===== */
@media (max-width: 768px) {
    .parameter-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .parameter-input-group {
        justify-content: space-between;
    }
    
    .preset-selector {
        grid-template-columns: 1fr 1fr;
    }
    
    .quick-toolbar {
        top: 0.5rem;
        left: 0.5rem;
        flex-wrap: wrap;
    }
    
    .quick-button {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
}

/* ===== ACCESSIBILITY ===== */
.action-button:focus,
.parameter-slider:focus,
.preset-button:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.position-indicator:focus {
    outline: 3px solid #3498db;
    outline-offset: 3px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .action-button {
        border: 2px solid currentColor;
    }
    
    .parameter-slider {
        border: 1px solid currentColor;
    }
    
    .position-indicator {
        border-width: 3px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .action-button,
    .parameter-slider::-webkit-slider-thumb,
    .parameter-slider::-moz-range-thumb,
    .position-indicator,
    .quick-button {
        transition: none;
    }
    
    .trajectory-line {
        animation: none;
    }
    
    .launch-indicator.firing {
        animation: none;
    }
}

/* Smooth dragging improvements */
.position-indicator {
    transition: none !important; /* Disable transitions during drag for smoothness */
    cursor: grab;
    user-select: none;
    pointer-events: auto;
}

.position-indicator:hover {
    transform: scale(1.1);
    filter: brightness(1.2);
    transition: transform 0.2s ease, filter 0.2s ease;
}

.position-indicator.dragging {
    cursor: grabbing !important;
    transform: scale(1.2);
    filter: brightness(1.3) drop-shadow(0 0 10px rgba(255,255,255,0.5));
    z-index: 1000;
    transition: none !important;
}

/* Smooth fish animation */
.fish-indicator {
    font-size: 48px;
    text-shadow: 0 0 10px #3498db;
}

.target-indicator {
    font-size: 36px;
    text-shadow: 0 0 8px #e74c3c;
}

/* Multi-mode indicators */
.multimode-indicator {
    position: absolute;
    width: 60px;
    height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: grab;
    user-select: none;
    pointer-events: auto !important;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    backdrop-filter: blur(10px);
    border: 2px solid transparent;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 100;
}

.multimode-indicator:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
    box-shadow: 0 4px 20px rgba(52, 152, 219, 0.4);
}

.multimode-indicator.dragging {
    cursor: grabbing !important;
    transform: scale(1.2);
    z-index: 1000 !important;
    box-shadow: 0 8px 30px rgba(52, 152, 219, 0.6);
    transition: none !important;
}

.fish-multimode-indicator {
    border-color: #2ecc71;
}

.fish-multimode-indicator:hover {
    border-color: #27ae60;
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.4);
}

.fish-multimode-indicator.dragging {
    border-color: #27ae60;
    box-shadow: 0 8px 24px rgba(46, 204, 113, 0.6);
}

.target-multimode-indicator {
    border-color: #e74c3c;
}

.target-multimode-indicator:hover {
    border-color: #c0392b;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

.target-multimode-indicator.dragging {
    border-color: #c0392b;
    box-shadow: 0 8px 24px rgba(231, 76, 60, 0.6);
}

.indicator-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    position: relative;
}

.indicator-emoji {
    font-size: 30px;
    line-height: 1;
}

.indicator-label {
    font-size: 8px;
    font-weight: bold;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    position: absolute;
    bottom: -2px;
    background: rgba(0, 0, 0, 0.6);
    padding: 1px 3px;
    border-radius: 6px;
    min-width: 12px;
    text-align: center;
}

.indicator-controls {
    position: absolute;
    top: -8px;
    right: -8px;
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: auto !important;
    z-index: 101;
}

.multimode-indicator:hover .indicator-controls {
    opacity: 1;
}

.indicator-control-btn {
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    pointer-events: auto !important;
    z-index: 102;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.add-btn {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
}

.add-btn:hover {
    background: linear-gradient(135deg, #229954, #27ae60);
    transform: scale(1.1);
}

.remove-btn {
    background: linear-gradient(135deg, #c0392b, #e74c3c);
}

.remove-btn:hover {
    background: linear-gradient(135deg, #a93226, #c0392b);
    transform: scale(1.1);
}

.indicator-control-btn:active {
    transform: scale(0.95);
}

/* Help text for multi-mode */
.help-text {
    margin-top: 10px;
    padding: 8px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.help-text p {
    margin: 0;
    line-height: 1.4;
}

/* Multi-mode controls container */
.multi-mode-controls {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.multi-mode-panel {
    margin-top: 10px;
    padding: 15px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.placement-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.placement-controls .action-button {
    flex: 1;
    min-width: 120px;
}

.position-counts {
    margin-top: 10px;
    padding: 8px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    font-weight: bold;
    text-align: center;
    color: #00ff88;
}

.warning-button {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border-color: #e74c3c;
}

.warning-button:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

/* Toggle Switch Styles */
.toggle-switch-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #34495e;
    transition: .4s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.toggle-label {
    font-size: 0.9rem;
    color: #ecf0f1;
    font-weight: 500;
}
