/* Strategy Board Styles */

.strategy-board-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 500px;
}

/* Top Toolbar */
.sb-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: linear-gradient(135deg, #0e1369 0%, #1a1f7a 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sb-toolbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sb-toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Template Dropdown */
.sb-template-dropdown {
    position: relative;
}

.sb-template-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sb-template-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.sb-template-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    min-width: 280px;
    z-index: 1000;
    display: none;
    overflow: hidden;
}

.sb-template-menu.active {
    display: block;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sb-template-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.sb-template-menu-header span {
    font-weight: 600;
    color: #2c3e50;
    font-size: 13px;
}

.sb-new-template-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: #06b8a0;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.sb-new-template-btn:hover {
    background: #05a08c;
}

.sb-template-list {
    max-height: 300px;
    overflow-y: auto;
}

.sb-template-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

.sb-template-item:hover {
    background: #f8f9fa;
}

.sb-template-item:last-child {
    border-bottom: none;
}

.sb-template-item i {
    color: #6c757d;
    font-size: 16px;
}

.sb-template-item-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.sb-template-item-name {
    font-weight: 500;
    color: #2c3e50;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.sb-template-item-date {
    font-size: 11px;
    color: #6c757d;
    margin-top: 2px;
}

/* Active board highlight */
.sb-template-active {
    background: #e8f5f3;
    border-left: 3px solid #06b8a0;
}

.sb-template-active i:first-child {
    color: #06b8a0;
}

.sb-template-active .sb-template-item-name {
    color: #0e1369;
    font-weight: 600;
}

/* Delete button on each board row */
.sb-template-delete-btn {
    background: none;
    border: none;
    color: #adb5bd;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 12px;
    opacity: 0;
    transition: all 0.15s;
}

.sb-template-item:hover .sb-template-delete-btn {
    opacity: 1;
}

.sb-template-delete-btn:hover {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
}

/* Document Title Input */
.sb-doc-title {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 8px 14px;
    color: white;
    font-size: 16px;
    font-weight: 500;
    width: 300px;
    transition: all 0.2s;
}

.sb-doc-title::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.sb-doc-title:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Action Buttons */
.sb-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sb-action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.sb-action-btn i {
    font-size: 14px;
}

/* Export Dropdown */
.sb-export-dropdown {
    position: relative;
}

.sb-export-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    min-width: 220px;
    z-index: 1000;
    display: none;
    overflow: hidden;
}

.sb-export-menu.active {
    display: block;
    animation: slideDown 0.2s ease;
}

.sb-export-menu button {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: none;
    color: #2c3e50;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
    text-align: left;
}

.sb-export-menu button:hover {
    background: #f8f9fa;
}

.sb-export-menu button i {
    width: 20px;
    color: #6c757d;
}

.sb-export-menu button i.fa-file-word {
    color: #2b579a;
}

.sb-export-menu button i.fa-file-powerpoint {
    color: #d24726;
}

.sb-export-menu button i.fa-file-pdf {
    color: #f40f02;
}

.sb-export-menu button i.fa-envelope {
    color: #06b8a0;
}

/* Page Tabs */
.sb-page-tabs {
    display: flex;
    align-items: center;
    padding: 0 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.sb-tabs-container {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 8px 0;
}

.sb-page-tab {
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: 6px 6px 0 0;
    color: #6c757d;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    position: relative;
}

.sb-page-tab:hover {
    color: #2c3e50;
    background: rgba(0, 0, 0, 0.05);
}

.sb-page-tab.active {
    background: white;
    color: #0e1369;
    box-shadow: 0 -2px 0 #06b8a0 inset;
}

.sb-page-tab .close-tab {
    margin-left: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}

.sb-page-tab:hover .close-tab {
    opacity: 1;
}

.sb-add-page-btn {
    padding: 8px 12px;
    background: transparent;
    border: 1px dashed #ced4da;
    border-radius: 6px;
    color: #6c757d;
    cursor: pointer;
    margin-left: 8px;
    transition: all 0.2s;
}

.sb-add-page-btn:hover {
    background: white;
    border-color: #06b8a0;
    color: #06b8a0;
}

/* Rich Text Formatting Toolbar */
.sb-format-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 6px 12px;
    background: #ffffff;
    border-bottom: 1px solid #e9ecef;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.sb-fmt-group {
    display: flex;
    align-items: center;
    gap: 2px;
}

.sb-fmt-divider {
    width: 1px;
    height: 24px;
    background: #dee2e6;
    margin: 0 6px;
}

.sb-fmt-select {
    height: 30px;
    padding: 0 8px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: #fff;
    color: #495057;
    font-size: 12px;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s;
    max-width: 130px;
}

.sb-fmt-select-sm {
    max-width: 70px;
}

.sb-fmt-select:hover {
    border-color: #adb5bd;
}

.sb-fmt-select:focus {
    border-color: #06b8a0;
    box-shadow: 0 0 0 2px rgba(6, 184, 160, 0.15);
}

.sb-fmt-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: #495057;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    padding: 0;
}

.sb-fmt-btn:hover {
    background: #f1f3f5;
    border-color: #dee2e6;
}

.sb-fmt-btn.active {
    background: #e8f5f3;
    border-color: #06b8a0;
    color: #06b8a0;
}

/* Font color & highlight buttons */
.sb-fmt-color-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: #495057;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    padding: 2px 0 0;
    position: relative;
}

.sb-fmt-color-btn:hover {
    background: #f1f3f5;
    border-color: #dee2e6;
}

.sb-fmt-color-input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

.sb-fmt-color-bar {
    display: block;
    width: 16px;
    height: 3px;
    border-radius: 1px;
    background: #000000;
    margin-top: 1px;
}

.sb-fmt-highlight-bar {
    background: #FFFF00;
}

/* Responsive - stack toolbar on mobile */
@media (max-width: 768px) {
    .sb-format-toolbar {
        padding: 4px 8px;
        gap: 1px;
    }
    .sb-fmt-select {
        max-width: 90px;
        font-size: 11px;
        height: 28px;
    }
    .sb-fmt-select-sm {
        max-width: 55px;
    }
    .sb-fmt-btn, .sb-fmt-color-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    .sb-fmt-divider {
        height: 20px;
        margin: 0 3px;
    }
}

/* Canvas Wrapper */
.sb-canvas-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    background: #f0f2f5;
}

.sb-canvas {
    background: white;
    min-height: 100%;
    max-width: 900px;
    margin: 0 auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 40px;
    position: relative;
}

/* Empty State */
.sb-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
    text-align: center;
    color: #6c757d;
}

.sb-empty-state i {
    font-size: 64px;
    color: #dee2e6;
    margin-bottom: 24px;
}

.sb-empty-state h3 {
    font-size: 24px;
    color: #2c3e50;
    margin: 0 0 12px 0;
}

.sb-empty-state p {
    font-size: 15px;
    margin: 0 0 24px 0;
    max-width: 400px;
}

.sb-quick-actions {
    display: flex;
    gap: 12px;
}

.sb-quick-actions button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #0e1369 0%, #06b8a0 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.sb-quick-actions button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(14, 19, 105, 0.3);
}

/* Add Block Zone */
.sb-add-block-zone {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px;
    margin-top: 16px;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    color: #adb5bd;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.sb-add-block-zone:hover {
    border-color: #06b8a0;
    color: #06b8a0;
    background: rgba(6, 184, 160, 0.03);
}

.sb-add-block-zone i {
    font-size: 16px;
}

/* Content Blocks */
.sb-block {
    position: relative;
    margin-bottom: 16px;
    border: 2px solid transparent;
    border-radius: 8px;
    transition: all 0.2s;
}

.sb-block:hover {
    border-color: #e9ecef;
}

.sb-block.selected {
    border-color: #06b8a0;
    box-shadow: 0 0 0 3px rgba(6, 184, 160, 0.15);
}

.sb-block-content {
    padding: 16px;
}

/* Text Block */
.sb-text-block .sb-block-content {
    min-height: 60px;
}

.sb-text-block [contenteditable] {
    outline: none;
    line-height: 1.6;
}

.sb-text-block [contenteditable]:empty:before {
    content: attr(data-placeholder);
    color: #adb5bd;
}

/* Image Block */
.sb-image-block img {
    max-width: 100%;
    border-radius: 6px;
}

.sb-image-block .sb-image-caption {
    margin-top: 8px;
    font-size: 13px;
    color: #6c757d;
    text-align: center;
    outline: none;
    min-height: 20px;
}

.sb-image-block .sb-image-caption:empty:before {
    content: attr(data-placeholder);
    color: #adb5bd;
}

/* Chart Block */
.sb-chart-block {
    background: #f8f9fa;
    border-radius: 8px;
}

.sb-chart-block canvas {
    max-width: 100%;
}

/* Block Toolbar */
.sb-block-toolbar {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: #2c3e50;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    z-index: 100;
}

.sb-block-toolbar button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    transition: background 0.2s;
}

.sb-block-toolbar button:hover {
    background: rgba(255, 255, 255, 0.15);
}

.sb-toolbar-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 8px;
}

/* Chat Selection Overlay */
.sb-chat-selector {
    position: absolute;
    border: 2px dashed #06b8a0;
    background: rgba(6, 184, 160, 0.1);
    cursor: move;
    z-index: 1000;
    border-radius: 4px;
}

.sb-chat-selector-handles {
    position: absolute;
}

.sb-chat-selector-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #06b8a0;
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
}

.sb-chat-selector-handle.nw { top: -6px; left: -6px; cursor: nwse-resize; }
.sb-chat-selector-handle.ne { top: -6px; right: -6px; cursor: nesw-resize; }
.sb-chat-selector-handle.sw { bottom: -6px; left: -6px; cursor: nesw-resize; }
.sb-chat-selector-handle.se { bottom: -6px; right: -6px; cursor: nwse-resize; }

/* Selection Popup */
.sb-selection-popup {
    position: absolute;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    padding: 10px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 1001;
}

.sb-selection-popup button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.sb-selection-popup .sb-push-board {
    background: linear-gradient(135deg, #0e1369 0%, #06b8a0 100%);
    color: white;
}

.sb-selection-popup .sb-push-board:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(14, 19, 105, 0.3);
}

.sb-selection-popup .sb-push-canvas {
    background: #f8f9fa;
    color: #2c3e50;
    border: 1px solid #e9ecef;
}

.sb-selection-popup .sb-push-canvas:hover {
    background: #e9ecef;
}

.sb-selection-popup .sb-cancel {
    background: transparent;
    color: #6c757d;
    padding: 10px 12px;
}

.sb-selection-popup .sb-cancel:hover {
    background: #f8f9fa;
}

/* Content Library Modal */
.sb-library-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

.sb-library-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 900px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sb-library-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e9ecef;
}

.sb-library-header h3 {
    margin: 0;
    font-size: 18px;
    color: #2c3e50;
}

.sb-library-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border: none;
    border-radius: 50%;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s;
}

.sb-library-close:hover {
    background: #e9ecef;
    color: #2c3e50;
}

.sb-library-tabs {
    display: flex;
    gap: 8px;
    padding: 16px 24px;
    border-bottom: 1px solid #e9ecef;
}

.sb-library-tab {
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: 20px;
    color: #6c757d;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.sb-library-tab:hover {
    background: #f8f9fa;
}

.sb-library-tab.active {
    background: #0e1369;
    color: white;
}

.sb-library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.sb-library-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
}

.sb-library-item:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sb-library-item img,
.sb-library-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sb-library-item.selected {
    box-shadow: 0 0 0 3px #06b8a0;
}

.sb-library-item.selected::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: #06b8a0;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.sb-library-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #e9ecef;
}

.sb-library-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.sb-library-btn.cancel {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    color: #6c757d;
}

.sb-library-btn.cancel:hover {
    background: #e9ecef;
}

.sb-library-btn.confirm {
    background: linear-gradient(135deg, #0e1369 0%, #06b8a0 100%);
    border: none;
    color: white;
}

.sb-library-btn.confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(14, 19, 105, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .strategy-board-container {
        height: auto;
        min-height: calc(100vh - 160px);
    }

    .sb-toolbar {
        flex-direction: column;
        gap: 10px;
        padding: 12px 14px;
    }
    
    .sb-toolbar-left {
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }

    .sb-toolbar-right {
        width: 100%;
        justify-content: stretch;
        gap: 8px;
    }

    .sb-template-dropdown {
        width: 100%;
    }

    .sb-template-btn {
        width: 100%;
        justify-content: space-between;
        padding: 10px 14px;
    }

    .sb-template-menu {
        min-width: 0;
        width: calc(100vw - 28px);
        left: 0;
    }
    
    .sb-doc-title {
        width: 100%;
        padding: 10px 14px;
        font-size: 15px;
    }

    .sb-action-btn {
        flex: 1;
        justify-content: center;
        padding: 10px 12px;
        font-size: 13px;
        min-height: 42px;
    }

    .sb-export-dropdown {
        flex: 1;
    }

    .sb-export-dropdown .sb-action-btn {
        width: 100%;
    }

    .sb-export-menu {
        right: auto;
        left: 0;
        min-width: 200px;
    }
    
    .sb-canvas-wrapper {
        padding: 12px;
        padding-bottom: 80px;
    }
    
    .sb-canvas {
        padding: 20px;
    }
    
    .sb-quick-actions {
        flex-direction: column;
    }

    .sb-empty-state {
        padding: 40px 20px;
    }

    .sb-empty-state i {
        font-size: 48px;
    }

    .sb-empty-state h3 {
        font-size: 20px;
    }

    .sb-page-tabs {
        padding: 0 12px;
    }

    .sb-tabs-container {
        gap: 2px;
    }

    .sb-page-tab {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* =============================================
   CHAT SELECTION OVERLAY TOOL
   ============================================= */

/* Selection Mode Button in Chat Header */
.chat-selection-mode-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 36px;
    padding: 0 10px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chat-selection-mode-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chat-selection-mode-btn.active {
    background: #06b8a0;
    border-color: #06b8a0;
}

.chat-selection-mode-btn i {
    font-size: 14px;
}

/* Selection Mode Active State on Messages Container */
.modern-chat-messages.selection-mode {
    cursor: pointer;
    user-select: none;
}

.modern-chat-messages.selection-mode .modern-chat-message-bubble-ai,
.modern-chat-messages.selection-mode .modern-chat-message-bubble-user {
    cursor: pointer;
}

/* Freeform selection box — the single teal rectangle */
.sel-box {
    border: 2px solid #06b8a0;
    background: rgba(6, 184, 160, 0.08);
    border-radius: 8px;
    pointer-events: none;
    z-index: 100;
}

/* Drag pills on top/bottom edges of the box */
.sel-pill {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 48px;
    height: 14px;
    background: #06b8a0;
    border-radius: 7px;
    cursor: ns-resize;
    pointer-events: auto;
    z-index: 201;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    transition: background 0.15s ease;
}

.sel-pill::after {
    content: '';
    width: 20px;
    height: 2px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 1px;
}

.sel-pill:hover {
    background: #059689;
}

.sel-pill-top {
    top: -7px;
}

.sel-pill-bottom {
    bottom: -7px;
}

/* Floating action icons (positioned next to selection) */
.sel-overlay-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 200;
}

.sel-action-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    color: white;
    background: linear-gradient(135deg, #0e1369, #06b8a0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    padding: 0;
    line-height: 1;
}

.sel-action-icon:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 14px rgba(14, 19, 105, 0.4);
}

.sel-action-icon.sel-action-close {
    background: #6c757d;
}

.sel-action-icon.sel-action-close:hover {
    background: #dc3545;
}

/* Selection Action Popup */
.chat-selection-popup {
    position: absolute;
    bottom: -70px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
    z-index: 101;
    pointer-events: auto;
    animation: popupSlideUp 0.2s ease;
}

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

.chat-selection-popup::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid white;
}

.chat-selection-popup-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.chat-selection-popup-btn.strategy-board {
    background: linear-gradient(135deg, #0e1369 0%, #06b8a0 100%);
    color: white;
}

.chat-selection-popup-btn.strategy-board:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(14, 19, 105, 0.3);
}

.chat-selection-popup-btn.content-canvas {
    background: #f8f9fa;
    color: #2c3e50;
    border: 1px solid #e9ecef;
}

.chat-selection-popup-btn.content-canvas:hover {
    background: #e9ecef;
}

.chat-selection-popup-btn.cancel {
    background: transparent;
    color: #6c757d;
    padding: 10px 12px;
}

.chat-selection-popup-btn.cancel:hover {
    background: #f8f9fa;
    color: #495057;
}

/* Selection Mode Instructions Tooltip */
.chat-selection-instructions {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    z-index: 102;
    pointer-events: none;
    animation: fadeIn 0.3s ease;
}

.chat-selection-instructions i {
    margin-right: 8px;
    color: #06b8a0;
}

/* =============================================
   POINT-AND-CLICK SELECTION STYLES
   ============================================= */

/* Hoverable content - shows outline when hovering */
.chat-content-hoverable {
    outline: 2px dashed #06b8a0 !important;
    outline-offset: 2px;
    background: rgba(6, 184, 160, 0.08) !important;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

/* Selected content - solid highlight */
.chat-content-selected {
    outline: 3px solid #06b8a0 !important;
    outline-offset: 2px;
    background: rgba(6, 184, 160, 0.12) !important;
    border-radius: 6px;
    position: relative;
}

/* Selection badge - numbered indicator on selected items */
.chat-selected-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #0e1369 0%, #06b8a0 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(14, 19, 105, 0.4);
    cursor: pointer;
    z-index: 100;
    transition: transform 0.15s ease;
}

.chat-selected-badge:hover {
    transform: scale(1.15);
}

.chat-selected-badge::after {
    content: '×';
    position: absolute;
    opacity: 0;
    font-size: 14px;
    font-weight: bold;
}

.chat-selected-badge:hover span {
    opacity: 0;
}

.chat-selected-badge:hover::after {
    opacity: 1;
}

/* Floating action popup at bottom of chat */
.chat-selection-floating-popup {
    position: sticky;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: fit-content;
    max-width: calc(100% - 24px);
    margin: 16px auto 0;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 12px 16px;
    z-index: 200;
    animation: floatPopupIn 0.25s ease;
}

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

.chat-selection-popup-count {
    text-align: center;
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 10px;
    font-weight: 500;
}

.chat-selection-popup-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Selection mode cursor change */
#modern-chat-messages.selection-mode {
    cursor: pointer;
}

#modern-chat-messages.selection-mode * {
    cursor: pointer;
}

/* Mobile-friendly touch targets */
@media (max-width: 768px) {
    .chat-selection-floating-popup {
        position: fixed;
        bottom: 20px;
        left: 12px;
        right: 12px;
        width: auto;
        transform: none;
        max-width: none;
        padding: 14px;
        border-radius: 20px;
    }
    
    .chat-selection-popup-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .chat-selection-popup-btn {
        width: 100%;
        justify-content: center;
        padding: 14px 20px !important;
        font-size: 15px !important;
    }
    
    .chat-selected-badge {
        width: 28px;
        height: 28px;
        font-size: 13px;
        top: -10px;
        right: -10px;
    }
    
    .chat-content-hoverable,
    .chat-content-selected {
        outline-offset: 4px;
    }
    
    .chat-selection-mode-btn {
        padding: 10px 14px !important;
    }
}
