/* ==========================================================================
   BG3 Target Selector Styles
   ========================================================================== */

/* Target selector cursor */
body.bg3-targeting {
    cursor: crosshair !important;
}

body.bg3-targeting * {
    cursor: crosshair !important;
}

/* Target count display */
#bg3-target-count {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.9);
    color: #ffffff;
    padding: 12px 16px;
    border-radius: 8px;
    font-family: 'Signika', sans-serif;
    font-size: 14px;
    font-weight: 600;
    z-index: var(--bg3-z-target-selector, 10000);
    border: 2px solid var(--bg3-border-color, #8b4513);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
}

#bg3-target-count:hover {
    background: rgba(0, 0, 0, 0.95);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6);
}

#bg3-target-count .target-count-main {
    font-size: 16px;
    margin-bottom: 4px;
}

#bg3-target-count .target-count-min {
    font-size: 12px;
    color: #cccccc;
}

#bg3-target-current {
    color: var(--bg3-accent-color, #d4af37);
    font-weight: bold;
}

/* Target selector instructions */
.bg3-target-instructions {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 6px;
    font-family: 'Signika', sans-serif;
    font-size: 12px;
    z-index: var(--bg3-z-target-selector, 10000);
    border: 1px solid var(--bg3-border-color, #8b4513);
    backdrop-filter: blur(4px);
    animation: bg3-fade-in 0.3s ease;
}

/* Range indicators */
.bg3-range-indicator {
    pointer-events: none;
    z-index: var(--bg3-z-range-indicator, 50);
}

.bg3-range-circle {
    fill: none;
    stroke: #00ff00;
    stroke-width: 2;
    stroke-opacity: 0.6;
    stroke-dasharray: 5, 5;
    animation: bg3-range-pulse 2s ease-in-out infinite;
}

.bg3-range-circle.out-of-range {
    stroke: #ff0000;
    stroke-opacity: 0.8;
}

/* Target highlighting */
.token.bg3-target-valid {
    filter: drop-shadow(0 0 8px #00ff00);
}

.token.bg3-target-invalid {
    filter: drop-shadow(0 0 8px #ff0000) grayscale(0.5);
}

.token.bg3-target-selected {
    filter: drop-shadow(0 0 12px #00ff00) brightness(1.2);
}

.token.bg3-target-hovered {
    filter: drop-shadow(0 0 6px #ffff00) brightness(1.1);
}

/* Template preview */
.bg3-template-preview {
    pointer-events: none;
    z-index: var(--bg3-z-template-preview, 60);
}

.bg3-template-circle {
    fill: rgba(255, 255, 0, 0.2);
    stroke: #ffff00;
    stroke-width: 2;
    stroke-opacity: 0.8;
}

.bg3-template-cone {
    fill: rgba(255, 165, 0, 0.2);
    stroke: #ffa500;
    stroke-width: 2;
    stroke-opacity: 0.8;
}

.bg3-template-line {
    fill: none;
    stroke: #ff00ff;
    stroke-width: 4;
    stroke-opacity: 0.8;
    stroke-linecap: round;
}

.bg3-template-cube,
.bg3-template-square {
    fill: rgba(0, 255, 255, 0.2);
    stroke: #00ffff;
    stroke-width: 2;
    stroke-opacity: 0.8;
}

/* Target selection feedback */
.bg3-target-feedback {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(220, 20, 60, 0.9);
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 8px;
    font-family: 'Signika', sans-serif;
    font-size: 14px;
    font-weight: 600;
    z-index: var(--bg3-z-target-feedback, 10001);
    border: 2px solid #dc143c;
    animation: bg3-error-shake 0.5s ease;
}

.bg3-target-feedback.success {
    background: rgba(34, 139, 34, 0.9);
    border-color: #228b22;
    animation: bg3-success-pulse 0.5s ease;
}

/* Crosshair overlay */
.bg3-crosshair-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: var(--bg3-z-crosshair, 9999);
}

.bg3-crosshair {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
    animation: bg3-crosshair-pulse 1s ease-in-out infinite;
}

.bg3-crosshair::before,
.bg3-crosshair::after {
    content: '';
    position: absolute;
    background: #ffffff;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
}

.bg3-crosshair::before {
    top: 50%;
    left: -8px;
    right: -8px;
    height: 2px;
    transform: translateY(-50%);
}

.bg3-crosshair::after {
    left: 50%;
    top: -8px;
    bottom: -8px;
    width: 2px;
    transform: translateX(-50%);
}

/* Animations */
@keyframes bg3-fade-in {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes bg3-range-pulse {
    0%, 100% {
        stroke-opacity: 0.6;
        stroke-width: 2;
    }
    50% {
        stroke-opacity: 0.9;
        stroke-width: 3;
    }
}

@keyframes bg3-error-shake {
    0%, 100% {
        transform: translate(-50%, -50%);
    }
    25% {
        transform: translate(-52%, -50%);
    }
    75% {
        transform: translate(-48%, -50%);
    }
}

@keyframes bg3-success-pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.05);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes bg3-crosshair-pulse {
    0%, 100% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

/* Target selector disabled state */
.bg3-targeting-disabled {
    pointer-events: none;
    opacity: 0.5;
    filter: grayscale(1);
}

/* Integration with BG3 hotbar */
#bg3-hotbar-container.targeting-active {
    pointer-events: none;
    opacity: 0.7;
}

#bg3-hotbar-container.targeting-active .hotbar-cell {
    cursor: not-allowed;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #bg3-target-count {
        top: 10px;
        right: 10px;
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .bg3-target-instructions {
        bottom: 10px;
        padding: 6px 12px;
        font-size: 11px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    #bg3-target-count {
        background: #000000;
        border-color: #ffffff;
    }
    
    .bg3-range-circle {
        stroke-width: 3;
        stroke-opacity: 1;
    }
    
    .token.bg3-target-valid {
        filter: drop-shadow(0 0 12px #00ff00) contrast(1.5);
    }
    
    .token.bg3-target-invalid {
        filter: drop-shadow(0 0 12px #ff0000) contrast(1.5);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .bg3-range-circle,
    .bg3-crosshair,
    #bg3-target-count,
    .bg3-target-feedback {
        animation: none;
    }
    
    .bg3-target-instructions {
        animation: none;
    }
} 