.strategy-hero-icon {
    width: 50px;
    height: 50px;
    object-fit: cover;
    cursor: pointer;
    border-radius: 6px;
    /* Specific: only border-color and filter, not 'all' */
    transition: filter 0.15s ease, box-shadow 0.15s ease;
}

.strategy-hero-icon:hover {
    filter: brightness(1.15);
    box-shadow: 0 0 10px var(--bs-primary);
}

.strategy-card {
    /* Removed transition:all — only target cheap GPU-composited properties */
    transition: box-shadow 0.15s ease, border-color 0.15s ease, filter 0.15s ease;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.strategy-card:hover {
    /* Use filter:brightness instead of translateY+scale to avoid layout thrashing */
    filter: brightness(1.05);
    box-shadow: 0 20px 40px rgba(0,0,0,0.25);
    border-color: rgba(255, 255, 255, 0.2);
}

.strategy-image-preview {
    position: relative;
    overflow: hidden;
}

.strategy-preview-img {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.strategy-card:hover .strategy-preview-img {
    transform: scale(1.08);
}

.strategy-overlay {
    transition: all 0.3s ease;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.strategy-card:hover .strategy-overlay {
    background: linear-gradient(transparent, rgba(0,0,0,0.9)) !important;
}

.strategy-no-image {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.strategy-no-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.strategy-card:hover .strategy-no-image {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%) !important;
}

.strategy-card:hover .strategy-no-image::before {
    transform: translateX(100%);
}

.strategy-card .badge {
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    font-size: 0.75rem;
    /* Use opacity instead of scale for badge hover — cheaper */
    transition: opacity 0.15s ease;
}

.strategy-card:hover .badge {
    opacity: 0.85;
}

.strategy-view-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.strategy-view-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.strategy-card:hover .strategy-view-btn::before {
    left: 100%;
}

.strategy-view-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.strategy-card:hover .strategy-quick-actions {
    opacity: 1 !important;
    transform: translateY(-5px);
}

.strategy-quick-actions .btn {
    transition: all 0.2s ease;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.strategy-quick-actions .btn:hover {
    transform: scale(1.1);
}

/* Text shadow for better readability on images */
.text-shadow {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

/* Strategy Toolbar */
#pathHeroSelect optgroup option:hover,
#pathHeroSelect optgroup option:checked {
    background: rgba(255, 159, 28, 0.12) !important;
    color: #ffffff !important;
}

/* Light theme support for hero select */
[data-theme="light"] #pathHeroSelect {
    background: rgba(255, 255, 255, 0.6) !important;
    border-color: rgba(0, 0, 0, 0.12) !important;
    color: #212529 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23212529' d='M6 9L1 4h10z'/%3E%3C/svg%3E") !important;    
    -webkit-backdrop-filter: blur(8px) !important;
    backdrop-filter: blur(8px) !important;
}

[data-theme="light"] #pathHeroSelect:hover {
    background-color: rgba(255, 255, 255, 0.75) !important;
    border-color: rgba(255, 159, 28, 0.4) !important;
}

[data-theme="light"] #pathHeroSelect:focus {
    background-color: rgba(255, 255, 255, 0.8) !important;
    border-color: var(--bs-success) !important;
}

[data-theme="light"] #pathHeroSelect option {
    background: rgba(255, 255, 255, 0.85) !important;
    color: #212529 !important;    
    -webkit-backdrop-filter: blur(10px) !important;
    backdrop-filter: blur(10px) !important;
}

[data-theme="light"] #pathHeroSelect optgroup {
    background: rgba(248, 249, 250, 0.85) !important;
    color: var(--bs-success) !important;
    border-bottom-color: rgba(0, 0, 0, 0.08) !important;    
    -webkit-backdrop-filter: blur(10px) !important;
    backdrop-filter: blur(10px) !important;
}

[data-theme="light"] #pathHeroSelect optgroup option {
    color: rgba(33, 37, 41, 0.9) !important;
}

/* Hero Picker Improvements */
.strategy-hero-icon {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    /* Specific transitions only */
    transition: filter 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    cursor: grab;
    border: 2px solid transparent;
}

.strategy-hero-icon:hover {
    filter: brightness(1.15);
    border-color: var(--bs-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.strategy-hero-icon:active {
    cursor: grabbing;
    transform: scale(0.95);
}

/* Form Controls */
.form-control-color {
    border-radius: 4px;
    border: 1px solid var(--bs-border-color);
    cursor: pointer;
}

.form-range {
    height: 4px;
}

.form-range::-webkit-slider-thumb {
    width: 16px;
    height: 16px;
    background: var(--bs-primary);
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

.form-range::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

/* Badge improvements */
.badge {
    font-size: 0.7rem;
    padding: 0.3rem 0.5rem;
}

/* Keyboard shortcuts */
kbd {
    background-color: var(--bs-secondary);
    color: var(--bs-white);
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Brush size slider styling */
.form-range {
    height: 0.5rem;
}

.form-range::-webkit-slider-thumb {
    width: 1rem;
    height: 1rem;
    background: var(--bs-primary);
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.form-range::-webkit-slider-thumb:hover {
    background: var(--bs-primary);
    transform: scale(1.1);
}

/* Canvas container styling */
#strategyCanvasColumn {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

#strategyViewerContainer {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

.strategy-board-container {
    position: relative;
    width: 100%;
    height: auto;
    min-height: 0;
    background: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    margin: 0;
    overflow: visible;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}


/* Reduce empty space around canvas */
#strategyCanvasColumn > * {
    margin-bottom: 0.5rem !important;
}

#strategyCanvasColumn .strategy-board-container {
    margin-bottom: 0 !important;
}

.strategy-board-canvas {
    display: block;
    width: 100%;
    height: auto;
    min-height: 500px;
    max-height: 100vh;
    background: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    display: block;
    cursor: crosshair;
    object-fit: contain;
}

/* Image navigation styling */
#image-navigation {
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    padding: 1rem;
}

#image-navigation .badge {
    font-size: 0.875rem;
    font-weight: 500;
}

#image-navigation .btn-group .btn {
    min-width: 40px;
    transition: all 0.3s ease;
}

#image-navigation .btn-group .btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

#image-navigation .btn-group .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Image cycler improvements */
#image-cycler {
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);    
    background: rgba(0, 0, 0, 0.7);
    border-radius: var(--bs-border-radius);
    padding: 0.5rem;
}

#image-cycler .btn {
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transition: all 0.3s ease;
}

#image-cycler .btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

#image-cycler .btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Path tool styling */
.strategy-tools-section .alert {
    background-color: rgba(13, 202, 240, 0.1);
    border: 1px solid rgba(13, 202, 240, 0.3);
    color: var(--bs-info);
}

.strategy-tools-section kbd {
    background-color: var(--bs-secondary);
    color: var(--bs-white);
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
}

/* Path animation improvements - consolidated canvas styles */
.strategy-board-canvas {
    display: block;
    width: auto !important;
    height: auto !important;
    max-width: 100%;
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    flex-shrink: 0;
}

/* Hero picker horizontal line layout with role separation */
.hero-picker-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 1.5rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.hero-picker-grid::-webkit-scrollbar {
    height: 8px;
}

.hero-picker-grid::-webkit-scrollbar-track {
    background: transparent;
}

.hero-picker-grid::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.hero-picker-grid::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.5);
}

.hero-role-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.hero-role-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--bs-primary);
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#heroPickerToolbar {
    width: 100%;
}

#heroPickerToolbar .hero-picker-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
}

#heroPickerToolbar .strategy-hero-icon {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .strategy-image-preview,
    .strategy-no-image {
        height: 150px !important;
    }
    
    .strategy-overlay h5 {
        font-size: 1rem;
    }
    
    .strategy-overlay p {
        font-size: 0.8rem;
    }
    
    .strategy-toolbar {
        padding: 0.75rem;
    }
    
    .strategy-toolbar .card-body {
        padding: 1rem !important;
    }
    
    .tool-btn {
        padding: 0.4rem 0.6rem !important;
        font-size: 0.75rem !important;
    }
    
    .tool-btn i {
        font-size: 0.8rem;
    }
    
    .btn-group-sm .btn {
        padding: 0.3rem 0.6rem !important;
        font-size: 0.7rem !important;
    }
    
    .strategy-hero-icon {
        width: 42px;
        height: 42px;
    }
    
    .strategy-board-container {
        min-height: 400px;
        max-height: 60vh;
        padding: 0.5rem;
    }
    
    .strategy-board-canvas {
        max-width: 100%;
        max-height: 100%;
    }
    
    #image-navigation {
        padding: 0.75rem;
    }
    
    #image-navigation .badge {
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
    }
}

.page-header-strategies {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.15) 0%, rgba(30, 33, 36, 0.95) 100%);
}

.page-header-strategies .page-header-title-universal i {
    background: linear-gradient(135deg, #ec4899, #db2777);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.strategy-board-container {
    position: relative;
    border-radius: 8px;
    overflow: visible;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.strategy-board-canvas {
    display: block;
    width: 100% !important;
    height: auto !important;
    max-width: 100%;
    max-height: 100vh;
    object-fit: contain;
    background: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

/* Whiteboard mode indicator */
.whiteboard-mode-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.whiteboard-mode-indicator i {
    color: #28a745;
    margin-right: 4px;
}

/* Strategy form whiteboard option styling */
.form-check-input:checked + .form-check-label {
    color: #28a745;
    font-weight: 600;
}

.form-check-input:checked + .form-check-label i {
    color: #28a745;
}

/* ==========================================
   LAYER PANEL STYLES
   ========================================== */
.layer-panel-card {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(30, 33, 36, 0.95);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.layer-list-container {
    padding: 0;
    margin: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.layer-list-container::-webkit-scrollbar {
    width: 6px;
}

.layer-list-container::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.layer-item {
    transition: all 0.2s ease;
    border-bottom-color: rgba(255, 255, 255, 0.05) !important;
    padding: 0.5rem 0.75rem;
}

.layer-item:hover {
    background: rgba(255, 255, 255, 0.05) !important;
}

.layer-item.drag-over {
    border-top: 2px solid var(--bs-primary) !important;
    background: rgba(var(--bs-primary-rgb), 0.1) !important;
}

.layer-drag-handle {
    opacity: 0.5;
    transition: opacity 0.2s;
}

.layer-item:hover .layer-drag-handle {
    opacity: 1;
}

.layer-visibility {
    cursor: pointer;
    width: 20px;
    text-align: center;
    transition: color 0.2s;
}

.layer-visibility:hover {
    color: #fff !important;
}

.layer-content {
    user-select: none;
    font-size: 0.85rem;
}

.layer-actions button {
    opacity: 0.3;
    transition: opacity 0.2s;
}

.layer-item:hover .layer-actions button:not(:disabled) {
    opacity: 1;
}

.layer-actions button:hover:not(:disabled) {
    color: var(--bs-primary) !important;
}
