/**
 * RT Workspace CSS
 * 
 * Styles for the RT Workspace plugin interface
 */

/* Main Workspace Container */
.rt-workspace-container {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1.5rem;
    min-height: 500px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Workspace Header */
.rt-workspace-header {
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.rt-workspace-title h4 {
    color: #495057;
    font-weight: 600;
}

.rt-workspace-title small {
    font-size: 0.875rem;
}

.rt-workspace-status .badge {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
}

/* Toolbar */
.rt-workspace-toolbar {
    margin-bottom: 1.5rem;
}

.rt-workspace-toolbar .btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.rt-workspace-toolbar .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.rt-workspace-toolbar .btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.rt-workspace-search-input {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tabs */
.rt-workspace-tabs .nav-tabs {
    border-bottom: 2px solid #dee2e6;
    margin-bottom: 1.5rem;
}

.rt-workspace-tabs .nav-link {
    border: none;
    border-radius: 6px 6px 0 0;
    color: #6c757d;
    font-weight: 500;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
    position: relative;
}

.rt-workspace-tabs .nav-link:hover {
    border-color: transparent;
    background-color: #f8f9fa;
    color: #495057;
}

.rt-workspace-tabs .nav-link.active {
    background-color: #ffffff;
    border-color: #dee2e6 #dee2e6 #ffffff;
    color: #495057;
    border-bottom: 2px solid #007bff;
}

.rt-workspace-tabs .rt-btn-add-tab {
    border: 1px dashed #dee2e6;
    background: transparent;
    color: #6c757d;
    transition: all 0.2s ease;
}

.rt-workspace-tabs .rt-btn-add-tab:hover {
    border-color: #007bff;
    color: #007bff;
}

/* Tab Context Menu */
.rt-tab-context-menu {
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.175);
    background-color: #fff;
    padding: 0.5rem 0;
    min-width: 160px;
}

.rt-tab-context-menu .dropdown-item {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    transition: all 0.15s ease-in-out;
}

.rt-tab-context-menu .dropdown-item:hover {
    background-color: #f8f9fa;
}

.rt-tab-context-menu .dropdown-item.text-danger:hover {
    background-color: #f8d7da;
    color: #721c24;
}

.rt-tab-context-menu .dropdown-item i {
    width: 16px;
    text-align: center;
}

/* Workspace Canvas */
.rt-workspace-canvas {
    min-height: 400px;
}

.rt-workspace-area {
    min-height: 350px;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.rt-workspace-area:not(:empty) {
    background: #ffffff;
    border-style: solid;
    border-color: #e9ecef;
}

/* Empty State */
.rt-workspace-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.rt-workspace-empty i {
    color: #dee2e6;
}

.rt-workspace-empty h5 {
    color: #6c757d;
    margin-bottom: 1rem;
}

.rt-workspace-empty p {
    color: #adb5bd;
    margin-bottom: 1.5rem;
}

/* Loading State */
.rt-workspace-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

/* Workspace Items */
.rt-workspace-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.rt-workspace-item {
    background: #ffffff;
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.2s ease;
    cursor: default; /* Default cursor when drag is disabled */
    position: relative;
}

/* Fix cursor when drag is disabled */
.rt-workspace-item.rt-drag-disabled,
.rt-workspace-container.rt-drag-disabled {
    cursor: default !important;
}

.rt-workspace-item.rt-drag-disabled *,
.rt-workspace-container.rt-drag-disabled * {
    cursor: default !important;
}

/* Enable move cursor ONLY when drag mode is active AND item is not disabled */
.rt-drag-mode-active .rt-workspace-item.rt-draggable:not(.rt-drag-disabled) {
    cursor: move !important;
}

.rt-drag-mode-active .rt-workspace-container:not(.rt-drag-disabled) .rt-workspace-container-header {
    cursor: move;
}



/* Empty Container */
.rt-workspace-empty-container {
    min-height: 80px;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0.5rem 0;
}

.rt-workspace-empty-container p {
    margin: 0;
    font-size: 0.875rem;
}

/* Drop Zone */
.rt-workspace-drop-zone {
    min-height: 60px;
    transition: all 0.2s ease;
}

.rt-workspace-drop-zone.drag-over {
    background: #e8f5e8;
    border: 2px dashed #28a745;
    border-radius: 6px;
}

/* Modal Enhancements */
.modal {
    z-index: 1055;
}

.modal-dialog {
    margin: 1.75rem auto;
    display: flex;
    align-items: center;
    min-height: calc(100vh - 3.5rem);
}

.modal-dialog-centered {
    min-height: calc(100vh - 3.5rem);
}

.modal-header {
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.modal-title {
    color: #495057;
    font-weight: 600;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}

/* Form Enhancements */
.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

.form-control:focus,
.form-select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

/* Tab Enhancements */
.nav-link[data-tab-id] {
    cursor: pointer;
    user-select: none;
}

/* Animations */
.rt-workspace-item-enter {
    opacity: 0;
    transform: translateY(20px);
}

.rt-workspace-item-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.3s ease;
}

.rt-workspace-item-exit {
    opacity: 1;
    transform: translateY(0);
}

.rt-workspace-item-exit-active {
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
}

/* Loading States */
.btn .spinner-border {
    width: 0.875rem;
    height: 0.875rem;
}

/* Status Indicators */
.rt-workspace-status-indicator {
    position: absolute;
    top: -0.5rem;
    right: -0.5rem;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: #28a745;
    border: 2px solid #ffffff;
}

.rt-workspace-status-indicator.error {
    background: #dc3545;
}

.rt-workspace-status-indicator.warning {
    background: #ffc107;
}

/* Enhanced Phrase Items */
.rt-workspace-phrase {
    position: relative;
}

.rt-workspace-nickname {
    background: #007bff;
    color: #ffffff;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-block;
    margin-bottom: 0.75rem;
}

.rt-workspace-text {
    color: #495057;
    line-height: 1.5;
    word-wrap: break-word;
}

/* Theme Colors */
.rt-workspace-theme-blue .rt-workspace-nickname {
    background: #007bff !important;
}

.rt-workspace-theme-green .rt-workspace-nickname {
    background: #28a745 !important;
}

.rt-workspace-theme-orange .rt-workspace-nickname {
    background: #fd7e14 !important;
}

.rt-workspace-theme-purple .rt-workspace-nickname {
    background: #6f42c1 !important;
}

.rt-workspace-theme-grey .rt-workspace-nickname {
    background: #6c757d !important;
}

/* Theme Colors */
.rt-workspace-theme-blue .rt-workspace-break-label {
    background: #007bff !important;
}

.rt-workspace-theme-green .rt-workspace-break-label {
    background: #28a745 !important;
}

.rt-workspace-theme-orange .rt-workspace-break-label {
    background: #fd7e14 !important;
}

.rt-workspace-theme-purple .rt-workspace-break-label {
    background: #6f42c1 !important;
}

.rt-workspace-theme-grey .rt-workspace-break-label {
    background: #6c757d !important;
}


/* Theme Colors */
.rt-workspace-theme-blue {
    border: 1px solid #007bff;
}

.rt-workspace-theme-green {
    border: 1px solid #28a745;
}

.rt-workspace-theme-orange {
    border: 1px solid #fd7e14;
}

.rt-workspace-theme-purple {
    border: 1px solid #6f42c1;
}

.rt-workspace-theme-grey {
    border: 1px solid #6c757d;
}


/* Size Variants */
.rt-workspace-size-small {
    font-size: 0.875rem;
    padding: 0.75rem;
}

.rt-workspace-size-medium {
    font-size: 1rem;
    padding: 1rem;
}

.rt-workspace-size-large {
    font-size: 1.125rem;
    padding: 1.25rem;
}

/* Container Items */
.rt-workspace-container {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: #f8f9fa;
    padding: 0;
}

.rt-workspace-container-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #ffffff;
    border-bottom: 1px solid #e9ecef;
    border-radius: 6px 6px 0 0;
}

.rt-workspace-container-title {
    font-weight: 600;
    color: #495057;
}

.rt-workspace-toggle-btn {
    border: none;
    background: transparent;
    color: #6c757d;
    padding: 0.25rem 0.5rem;
    transition: color 0.2s ease;
}

.rt-workspace-toggle-btn:hover {
    color: #007bff;
}

.rt-workspace-container-content {
    padding: 1rem;
    background: #ffffff;
    border-radius: 0 0 6px 6px;
}

.rt-workspace-container.collapsed .rt-workspace-container-content {
    display: none;
}

/* Break/Divider Items */
.rt-workspace-break {
    text-align: left;
    margin: 1rem 0;
    position: relative;
}

.rt-workspace-divider {
    border: 0;
    height: 2px;
    background: #dee2e6;
    margin: 1rem 0;
}

.rt-workspace-break-label {
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    background: #ffffff;
    padding: 0.25rem 1rem;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 10px;
    text-align: left !important;
    display: inline-block;
    width: auto;
}

/* Messages and Alerts */
.rt-workspace-messages {
    margin-top: 1rem;
}

.rt-workspace-warning {
    margin-top: 1rem;
}

.rt-workspace-warning .alert {
    border-left: 4px solid #ffc107;
}

/* Error State */
.rt-workspace-error {
    background: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    margin: 1rem 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .rt-workspace-container {
        padding: 1rem;
    }
    
    .rt-workspace-toolbar .btn {
        margin-bottom: 0.5rem;
    }
    
    .rt-workspace-toolbar .d-flex {
        flex-direction: column;
        align-items: stretch;
    }
    
    .rt-workspace-toolbar .btn-group {
        width: 100%;
    }
    
    .rt-workspace-toolbar .btn-group .btn {
        margin-bottom: 0;
    }
    
    .rt-workspace-tabs .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .rt-workspace-area {
        padding: 1rem;
    }
    
    .rt-workspace-item {
        padding: 0.75rem;
    }
    
    /* Mobile modal adjustments */
    .modal-dialog {
        margin: 1rem auto;
        min-height: calc(100vh - 2rem);
    }
    
    .modal-lg {
        max-width: none;
        margin: 1rem;
    }
    
    /* Mobile form adjustments */
    .modal-body .row .col-md-6 {
        margin-bottom: 1rem;
    }
}

@media (max-width: 576px) {
    .rt-workspace-header .d-flex {
        flex-direction: column;
        align-items: flex-start !important;
    }
    
    .rt-workspace-status {
        margin-top: 0.5rem;
    }
    
    .rt-workspace-tabs .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }
}
.rt-workspace-item[data-item-type="container"] {
    padding: 0px !important;
    background: #e6e9ec !important;
}
/* ==================== DRAG AND DROP STYLES ==================== */

/* Drag Handle - only show grab cursor when drag is enabled */
.rt-item-drag-handle {
    cursor: default; /* Default cursor when drag disabled */
    color: #6c757d;
    opacity: 0.7;
    transition: all 0.2s ease;
    margin-right: 0.5rem;
    padding: 0.25rem;
    border-radius: 3px;
}

/* Enable grab cursor only when drag is enabled */
.rt-drag-mode-active .rt-item-drag-handle,
.rt-workspace-item:not(.rt-drag-disabled) .rt-item-drag-handle {
    cursor: grab;
}

.rt-item-drag-handle:hover {
    color: #495057;
    opacity: 1;
    background-color: #f8f9fa;
}

.rt-drag-mode-active .rt-item-drag-handle:active,
.rt-workspace-item:not(.rt-drag-disabled) .rt-item-drag-handle:active {
    cursor: grabbing;
}

/* Dragging States */
.rt-item-chosen {
    opacity: 0.8;
}

.rt-item-dragging {
    opacity: 0.4;
    transform: rotate(3deg);
    box-shadow: 0 8px 32px rgba(0,0,0,0.15) !important;
    z-index: 9999;
}

.rt-item-ghost {
    opacity: 0.3;
    background-color: #e9ecef;
    border: 2px dashed #6c757d;
    transform: none;
    box-shadow: none;
}

/* Drop Zone Feedback */
.rt-dragging-active {
    background-color: #f8f9fa;
    border: 2px dashed #007bff;
    border-radius: 8px;
    padding: 1rem;
}

.rt-drop-zone-active {
    background-color: rgba(0, 123, 255, 0.05);
    border: 2px dashed rgba(0, 123, 255, 0.3);
    min-height: 60px;
    position: relative;
}

.rt-drop-zone-active::before {
    content: 'Drop items here';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #007bff;
    font-size: 0.875rem;
    font-weight: 500;
    pointer-events: none;
    opacity: 0.7;
}

.rt-drop-zone-active:not(:empty)::before {
    display: none;
}

/* Container Specific Drag Styles */
.rt-container-dragging {
    background-color: rgba(220, 53, 69, 0.05);
    border-color: rgba(220, 53, 69, 0.3);
}

.rt-workspace-drop-zone.rt-drop-zone-active {
    background-color: rgba(40, 167, 69, 0.05) !important;
    border: 2px dashed rgba(40, 167, 69, 0.3) !important;
    min-height: 80px;
    margin: 0.5rem 0;
    border-radius: 6px;
    position: relative !important;
    z-index: 1000 !important;
    transition: all 0.3s ease;
    pointer-events: auto !important;
    display: block !important;
}

.rt-workspace-drop-zone.rt-drop-zone-active::before {
    content: 'Drop containers, phrases, and dividers here' !important;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #28a745;
    font-size: 0.875rem;
    font-weight: 600;
    pointer-events: none;
    opacity: 0.9;
    white-space: nowrap;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.7);
}

.rt-workspace-drop-zone.rt-drop-zone-active:not(:empty)::before {
    display: none;
}

/* Enhanced targeting for container-to-container drops */
.rt-workspace-drop-zone.rt-container-drag-target {
    background-color: rgba(255, 193, 7, 0.15) !important;
    border: 3px dashed rgba(255, 193, 7, 0.7) !important;
    box-shadow: 0 0 15px rgba(255, 193, 7, 0.3) !important;
    z-index: 500 !important;
    transform: scale(1.02);
    min-height: 100px !important;
}

.rt-workspace-drop-zone.rt-container-drag-target::before {
    content: 'Drop container here for nesting' !important;
    color: #856404 !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.9) !important;
}

/* Ensure containers are properly visible during drag */
.rt-workspace-container.rt-drag-mode-active .rt-workspace-drop-zone {
    background-color: rgba(248, 249, 250, 0.5);
    min-height: 60px;
    margin: 0;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.rt-workspace-container.rt-drag-mode-active .rt-workspace-drop-zone:hover {
    background-color: rgba(40, 167, 69, 0.1);
    border-color: rgba(40, 167, 69, 0.4);
}

/* Enhanced container visual feedback */
.rt-workspace-container {
    transition: all 0.2s ease;
}

.rt-drag-mode-active .rt-workspace-container {
    border: 1px dashed #dee2e6;
    border-radius: 6px;
    margin: 0;
}

.rt-drag-mode-active .rt-workspace-container:hover {
    border-color: #007bff;
    background-color: rgba(0, 123, 255, 0.02);
}

/* Empty container styling */
.rt-workspace-empty-container {
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rt-workspace-empty-container p {
    margin: 0;
    color: #6c757d;
    font-style: italic;
}

/* Nested container depth indicators */
.rt-workspace-drop-zone[data-container-level="1"] {
    padding-left: 1rem;
}

.rt-workspace-drop-zone[data-container-level="2"] {
    padding-left: 2rem;
}

.rt-workspace-drop-zone[data-container-level="3"] {
    padding-left: 3rem;
}

/* Maximum depth warning */
.rt-container-max-depth {
    border-color: #dc3545 !important;
    background-color: rgba(220, 53, 69, 0.1) !important;
}

.rt-container-max-depth::before {
    content: 'Maximum nesting depth reached' !important;
    color: #dc3545 !important;
}

/* Sortable Animation */
.sortable-fallback {
    opacity: 0.6;
    background-color: #007bff;
    color: white;
    border-radius: 6px;
    padding: 0.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Enhanced Item Interaction */
.rt-workspace-item {
    transition: all 0.2s ease;
    position: relative;
}

.rt-workspace-item:hover .rt-item-drag-handle {
    opacity: 1;
    background-color: #e9ecef;
}

.rt-workspace-item.sortable-chosen {
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    z-index: 1000;
}

/* Cross-tab Drop Zones */
.tab-content .tab-pane.rt-drop-zone-active {
    border: 2px dashed #17a2b8;
    background-color: rgba(23, 162, 184, 0.05);
}

.tab-content .tab-pane.rt-drop-zone-active::before {
    content: 'Drop to move to this tab';
    color: #17a2b8;
}

/* Loading Animation for Drag Operations */
.rt-drag-processing {
    position: relative;
}

.rt-drag-processing::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.8);
    border-radius: inherit;
    z-index: 10;
}

.rt-drag-processing::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #007bff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 11;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Mobile Drag Adjustments */
@media (max-width: 768px) {
    .rt-item-drag-handle {
        font-size: 1.2rem;
        padding: 0.5rem;
        margin-right: 0.25rem;
    }
    
    .rt-drop-zone-active {
        min-height: 80px;
    }
    
    .rt-item-dragging {
        transform: scale(0.95) rotate(2deg);
    }
    
    .rt-workspace-tabs .nav-link {
        white-space: nowrap;
    }
    
    /* Larger touch targets */
    .rt-workspace-toggle-btn {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Animation Classes */
.rt-workspace-item-enter {
    opacity: 0;
    transform: translateY(20px);
}

.rt-workspace-item-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.3s ease;
}

.rt-workspace-item-exit {
    opacity: 1;
    transform: translateY(0);
}

.rt-workspace-item-exit-active {
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
}

/* Drag and Drop Styles (for future implementation) */
.rt-workspace-item.sortable-ghost {
    opacity: 0.5;
    background: #e3f2fd;
}

.rt-workspace-item.sortable-drag {
    transform: rotate(5deg);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.rt-workspace-area.sortable-over {
    background: #e8f5e8;
    border-color: #28a745;
}

/* Accessibility */
.rt-workspace-item:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.rt-workspace-toolbar .btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

/* Print Styles */
@media print {
    .rt-workspace-toolbar,
    .rt-workspace-tabs,
    .rt-workspace-warning {
        display: none !important;
    }
    
    .rt-workspace-container {
        border: none;
        padding: 0;
    }
    
    .rt-workspace-item {
        break-inside: avoid;
        margin-bottom: 1rem;
    }
}

/* ==================== DRAG MODE TOGGLE STYLES ==================== */

/* Drag Mode Active State */
.rt-drag-mode-active {
    background-color: #f8f9fa;
    /* border: 2px dashed #28a745; */
    position: relative;
}

/* Draggable Items Visual Feedback - cursor controlled by drag state */
.rt-workspace-item.rt-draggable {
    cursor: default; /* Default cursor, override when drag enabled */
    transition: all 0.2s ease;
    border: 1px solid transparent;
    position: relative;
}

/* Fix cursor when drag is disabled */
.rt-workspace-item.rt-draggable.rt-drag-disabled {
    cursor: default !important;
}

.rt-workspace-item.rt-draggable:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0,123,255,0.2);
}

.rt-workspace-item.rt-draggable:hover::before {
    opacity: 1;
    color: #007bff;
}

/* Drag Mode Button Animation */
.rt-btn-toggle-drag[data-drag-mode="on"] {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 123, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0);
    }
}

/* Drag Toggle Button Styles */
.rt-btn-drag-toggle {
    position: relative;
    transition: all 0.3s ease;
}

.rt-btn-drag-toggle.rt-drag-enabled {
    border-color: #17a2b8 !important;
    color: #17a2b8 !important;
}

.rt-btn-drag-toggle.rt-drag-enabled:hover {
    background-color: #17a2b8 !important;
    color: white !important;
    border-color: #17a2b8 !important;
}

.rt-btn-drag-toggle.rt-drag-disabled {
    border-color: #6c757d !important;
    color: #6c757d !important;
}

.rt-btn-drag-toggle.rt-drag-disabled:hover {
    background-color: #6c757d !important;
    color: white !important;
    border-color: #6c757d !important;
}

.rt-drag-status {
    font-weight: 500;
    font-size: 0.9em;
}

/* Drag Mode Disabled Visual Feedback */
.rt-workspace-container.rt-drag-disabled,
.rt-workspace-item.rt-drag-disabled {
    /* opacity: 0.8; */
    cursor: default !important;
}

.rt-workspace-container.rt-drag-disabled .rt-workspace-container-header,
.rt-workspace-item.rt-drag-disabled {
    cursor: default !important;
}

/* Ensure all child elements have default cursor when drag is disabled */
.rt-workspace-container.rt-drag-disabled *,
.rt-workspace-item.rt-drag-disabled * {
    cursor: default !important;
}

/* Override any grab or move cursors when drag mode is off */
.rt-workspace-container:not(.rt-drag-enabled) *,
.rt-workspace-item:not(.rt-drag-enabled) *,
.rt-workspace-area:not(.rt-drag-mode-active) .rt-workspace-item,
.rt-workspace-area:not(.rt-drag-mode-active) .rt-workspace-container {
    cursor: default !important;
}

.rt-workspace-container.rt-drag-disabled:hover,
.rt-workspace-item.rt-drag-disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* User Selection Control */
.rt-workspace-item:not(.rt-draggable) {
    pointer-events: auto;
}

.rt-workspace-item.rt-draggable {
    user-select: none;
}

/* Enhanced Container Feedback in Drag Mode */
.rt-drag-mode-active .rt-container {
    border: 1px dashed #dee2e6;
    transition: all 0.2s ease;
}

.rt-drag-mode-active .rt-container:hover {
    border-color: #007bff;
    background-color: rgba(0, 123, 255, 0.05);
}

.rt-workspace-item:not(.rt-draggable)::before {
    display: none;
}

/* Right-click Context Menu */
.rt-context-menu {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 180px;
    padding: 8px 0;
    font-size: 14px;
    z-index: 9999;
}

.rt-context-menu-item {
    padding: 8px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
}

.rt-context-menu-item:hover {
    background-color: #f8f9fa;
}

.rt-context-menu .dropdown-divider {
    margin: 4px 0;
    border-color: #e9ecef;
}
.rt-context-menu .rt-submenu-content{
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    padding: 8px 0;
    font-size: 14px;
}
/* Workspace Layout - Right Column */
.rt-workspace-container {
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    overflow-x: hidden;
}

.rt-workspace-container::-webkit-scrollbar {
    width: 8px;
}

.rt-workspace-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.rt-workspace-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.rt-workspace-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Phrase Hover Behavior */
.rt-workspace-phrase {
    position: relative;
}

.rt-workspace-phrase .rt-workspace-text:not(.rt-text-hidden) {
    cursor: help;
    transition: all 0.2s ease;
}

.rt-workspace-phrase .rt-workspace-text.rt-text-hidden {
    cursor: default;
    transition: all 0.2s ease;
}

.rt-workspace-phrase:hover .rt-workspace-text {
    background-color: rgba(0,123,255,0.05);
    border-radius: 4px;
}

/* Hidden text when nickname exists */
.rt-workspace-text.rt-text-hidden {
    display: none !important;
}

/* Phrase with nickname styling */
.rt-workspace-phrase .rt-workspace-nickname {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.rt-workspace-phrase .rt-workspace-nickname[title] {
    cursor: help;
    transition: all 0.2s ease;
}

/* Item Update Animation */
.rt-item-updated {
    animation: highlightFade 2s ease-out;
}
.rt-workspace-toolbar {
    padding-top: 20px;
    padding-left: 20px;
}
@keyframes highlightFade {
    0% {
        background-color: #fff3cd;
        border-color: #ffeaa7;
    }
    100% {
        background-color: transparent;
        border-color: transparent;
    }
}

/* ==================== RESPONSIVE DESIGN ==================== */

/* Mobile Optimizations */
@media (max-width: 768px) {
    /* Layout adjustments */
    .rt-workspace-container {
        position: static;
        max-height: none;
        margin-top: 1rem;
        padding: 1rem;
        border-radius: 6px;
    }
    
    /* Toolbar adjustments */
    .rt-workspace-toolbar {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .rt-workspace-toolbar .btn {
        width: 100%;
        justify-content: flex-start;
    }
    
    /* Item adjustments */
    .rt-workspace-item {
        margin-bottom: 0.75rem;
    }
    
    /* Context menu adjustments */
    .rt-context-menu {
        min-width: 200px;
        font-size: 16px;
    }
    
    .rt-context-menu-item {
        padding: 12px 16px;
    }
    
    /* Drag feedback adjustments */
    .rt-item-drag-handle {
        font-size: 1.2rem;
        padding: 0.5rem;
        margin-right: 0.25rem;
    }
    
    .rt-drop-zone-active {
        min-height: 80px;
    }
    
    .rt-item-dragging {
        transform: scale(0.95) rotate(2deg);
    }
    
    /* Tab adjustments */
    .rt-workspace-tabs .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }
    
    .rt-workspace-tabs .nav-link {
        white-space: nowrap;
        min-width: 120px;
    }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .rt-workspace-container {
        max-height: calc(100vh - 60px);
    }
    
    .rt-workspace-toolbar {
        flex-wrap: wrap;
    }
}

/* Two-Column Layout Support */
.two-column-layout .rt-workspace-container {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* High DPI Display Support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .rt-workspace-item {
        border-radius: 6px;
    }
    
    .rt-context-menu {
        box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    }
}

/* Print Styles */
@media print {
    .rt-workspace-toolbar,
    .rt-workspace-tabs,
    .rt-workspace-warning {
        display: none !important;
    }
    
    .rt-workspace-container {
        border: none;
        padding: 0;
    }
    
    .rt-workspace-item {
        break-inside: avoid;
        margin-bottom: 1rem;
    }
 
}

/* Search Functionality Styles */

/* Search Results Container */
.rt-search-results {
    margin-top: 0.5rem;
    z-index: 1050;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.rt-search-results .card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.rt-search-results .card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.75rem 1rem;
}

.rt-search-results .card-body {
    max-height: 400px;
    overflow-y: auto;
}

.rt-search-results .list-group-item {
    border: none;
    padding: 0.75rem 1rem;
    transition: background-color 0.2s ease;
}

.rt-search-results .list-group-item:hover {
    background-color: #f8f9fa;
}

.rt-search-results .list-group-item:not(:last-child) {
    border-bottom: 1px solid #f0f0f0;
}

/* Search Result Item Styling */
.rt-search-result-item h6 {
    color: #343a40;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.rt-search-result-item small {
    color: #6c757d;
    font-size: 0.8rem;
}

.rt-search-result-item .badge {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Search Highlight Effect */
.rt-search-highlight {
    position: relative;
    animation: rt-search-pulse 0.5s ease-in-out;
    /* Change background temporarily */
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.1), rgba(13, 110, 253, 0.05)) !important;
    border: 2px solid rgba(13, 110, 253, 0.3) !important;
    border-radius: 8px !important;
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.1) !important;
}

/* Search highlight pulse animation */
@keyframes rt-search-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(13, 110, 253, 0.2);
    }
    100% {
        box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.1);
    }
}

/* Search Input Styling */
.rt-workspace-search-input {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Search Loading State */
.rt-search-results .spinner-border {
    width: 1rem;
    height: 1rem;
    border-width: 0.1rem;
}

/* Close button styling */
.rt-search-results .btn-close {
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.rt-search-results .btn-close:hover {
    opacity: 1;
}

/* Responsive search adjustments */
@media (max-width: 768px) {
    .rt-search-results .card-body {
        max-height: 300px;
    }
    
    .rt-search-results .list-group-item {
        padding: 0.5rem 0.75rem;
    }
}

/*Filter System Styles (STEP 3) */

/* Filter Button Styling */
.rt-filter-btn {
    position: relative;
    transition: all 0.2s ease;
}

.rt-filter-btn.btn-primary {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: white;
}

.rt-filter-btn .rt-filter-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 18px;
    height: 18px;
    font-size: 0.7rem;
    line-height: 1;
    padding: 2px 0;
    border-radius: 9px;
    z-index: 10;
}

/* Filter Dropdown Styling */
.rt-filter-dropdown {
    min-width: 180px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #e0e0e0;
}

.rt-filter-dropdown .dropdown-header {
    background-color: #f8f9fa;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    padding: 0.5rem 1rem;
    margin: 0;
    border-bottom: 1px solid #e0e0e0;
}

.rt-filter-dropdown .rt-filter-item {
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

.rt-filter-dropdown .rt-filter-item:hover {
    background-color: #f8f9fa;
    color: #0d6efd;
}

.rt-filter-dropdown .rt-filter-item.active {
    background-color: #e7f1ff;
    color: #0d6efd;
    font-weight: 500;
}

.rt-filter-dropdown .rt-filter-item.active::after {
    content: '✓';
    margin-left: auto;
    font-weight: bold;
    color: #0d6efd;
}

.rt-filter-dropdown .rt-filter-clear {
    color: #dc3545;
    border-top: 1px solid #e0e0e0;
    background-color: #fff5f5;
}

.rt-filter-dropdown .rt-filter-clear:hover {
    background-color: #ffe6e6;
    color: #dc3545;
}

/* Clear All Filters Button */
.rt-clear-all-filters {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Filter Status Indicators */
.rt-filter-status {
    background-color: #e7f1ff;
    border: 1px solid #b6d7ff;
    border-radius: 6px;
    padding: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #0d6efd;
}

.rt-filter-status .badge {
    margin-left: 0.25rem;
}

/* Filter Loading State */
.rt-filter-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.rt-filter-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Filter Responsive Design */
@media (max-width: 768px) {
    .rt-filter-btn {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }
    
    .rt-filter-btn .rt-filter-badge {
        top: -6px;
        right: -6px;
        min-width: 16px;
        height: 16px;
        font-size: 0.65rem;
    }
    
    .rt-filter-dropdown {
        min-width: 160px;
    }
}

/* Controls Dropdown Styling */
.rt-controls-btn {
    position: relative;
    transition: all 0.2s ease;
}

.rt-controls-dropdown {
    min-width: 200px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.rt-controls-dropdown .dropdown-header {
    background-color: #f8f9fa;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    padding: 0.5rem 1rem;
    margin: 0;
    border-bottom: 1px solid #e0e0e0;
}

.rt-controls-dropdown .dropdown-item {
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

.rt-controls-dropdown .dropdown-item:hover {
    background-color: #f8f9fa;
    color: #0d6efd;
}

/* Drag Status Indicator in Dropdown */
.rt-controls-dropdown .rt-btn-drag-toggle.rt-drag-enabled {
    color: #198754;
}

.rt-controls-dropdown .rt-btn-drag-toggle:not(.rt-drag-enabled) {
    color: #dc3545;
}

/* Toolbar Compactness for 50% Width Constraint */
.rt-workspace-toolbar {
    max-width: 100%;
    /* overflow: hidden; */
}

.rt-workspace-toolbar .d-flex {
    flex-wrap: nowrap;
    /* overflow-x: auto; */
    gap: 0.5rem;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE */
}

.rt-workspace-toolbar .d-flex::-webkit-scrollbar {
    display: none; /* Chrome, Safari */
}

.rt-workspace-toolbar .btn {
    white-space: nowrap;
    flex-shrink: 0;
    min-width: auto;
}

.rt-workspace-toolbar .btn-group {
    flex-shrink: 0;
}

/* Make buttons more compact */
.rt-workspace-toolbar .btn-outline-secondary,
.rt-workspace-toolbar .btn-primary {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

/* Icon-only search button */
.rt-btn-search {
    min-width: 38px;
    padding: 0.5rem 0.75rem;
}

/* Responsive adjustments for very small screens */
@media (max-width: 576px) {
    .rt-workspace-toolbar .d-flex {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .rt-workspace-toolbar .btn {
        font-size: 0.8rem;
        padding: 0.375rem 0.6rem;
    }
    
    .rt-btn-search {
        min-width: 32px;
        padding: 0.375rem 0.6rem;
    }
}

/* Main Filters Button */
.rt-filters-main-btn {
    position: relative;
    transition: all 0.2s ease;
}

.rt-filters-main-btn .rt-filters-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 18px;
    height: 18px;
    font-size: 0.7rem;
    line-height: 1;
    padding: 2px 0;
    border-radius: 9px;
    z-index: 10;
}

/* Main Filters Dropdown */
.rt-filters-main-dropdown {
    min-width: 220px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 0;
    z-index: 1050 !important;
    position: absolute !important;
}

.rt-controls-dropdown {
    z-index: 1050 !important;
    position: absolute !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid #e0e0e0;
}

/* Fix dropdown visibility */
.dropdown-menu.show {
    display: block !important;
    z-index: 1050 !important;
    position: absolute !important;
}

/* Submenu Items */
.rt-submenu-item {
    position: relative;
}

.rt-submenu-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1rem;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    width: 100%;
}

.rt-submenu-trigger:hover {
    background-color: #f8f9fa;
    color: #0d6efd;
}

.rt-submenu-trigger .rt-filter-badge {
    margin-left: 0.5rem;
    margin-right: 0.5rem;
}

.rt-submenu-trigger .fa-chevron-right {
    font-size: 0.8rem;
    color: #6c757d;
    transition: transform 0.2s ease;
}

/* Submenu Items Styling */
.rt-submenu-content .dropdown-header {
    background-color: #f8f9fa;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    padding: 0.5rem 1rem;
    margin: 0;
    border-bottom: 1px solid #e0e0e0;
    border-radius: 6px 6px 0 0;
}

.rt-submenu-content .rt-filter-item,
.rt-submenu-content .rt-sort-item {
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
    color: #495057;
}

.rt-submenu-content .rt-filter-item:hover,
.rt-submenu-content .rt-sort-item:hover {
    background-color: #f8f9fa;
    color: #0d6efd;
}

.rt-submenu-content .rt-filter-item.active,
.rt-submenu-content .rt-sort-item.active {
    background-color: #e7f1ff;
    color: #0d6efd;
    font-weight: 500;
}

.rt-submenu-content .rt-filter-item.active::after,
.rt-submenu-content .rt-sort-item.active::after {
    content: '✓';
    margin-left: auto;
    font-weight: bold;
    color: #0d6efd;
}
ul.rt-submenu-content.dropdown-menu {
    top: 0px !important;
    left: 230px !important;
}
.rt-submenu-content .rt-filter-clear {
    color: #dc3545;
    border-top: 1px solid #e0e0e0;
    background-color: #fff5f5;
}

.rt-submenu-content .rt-filter-clear:hover {
    background-color: #ffe6e6;
    color: #dc3545;
}

/* Clear All Filters in Dropdown */
.rt-filters-main-dropdown .rt-clear-all-filters {
    color: #dc3545;
    background-color: #fff5f5;
    border-top: 1px solid #e0e0e0;
    padding: 0.6rem 1rem;
    transition: all 0.2s ease;
}

.rt-filters-main-dropdown .rt-clear-all-filters:hover {
    background-color: #ffe6e6;
    color: #dc3545;
    font-weight: 500;
}

/* Hover effects for submenu expansion */
.rt-submenu-item:hover .rt-submenu-trigger .fa-chevron-right {
    transform: rotate(90deg);
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
    .rt-filters-main-dropdown {
        min-width: 200px;
        position: fixed !important;
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
        transform: none !important;
        max-height: 60vh;
        overflow-y: auto;
    }
    
    .rt-submenu-content {
        position: fixed !important;
        left: 15px !important;
        right: 15px !important;
        width: auto !important;
        max-width: none !important;
        max-height: 50vh;
        overflow-y: auto;
        z-index: 1150 !important;
    }
    
    .rt-submenu-trigger .fa-chevron-right {
        transform: rotate(90deg);
    }
    
    /* Ensure proper spacing on mobile */
    .rt-submenu-content .dropdown-item {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}

/* Add backdrop overlay for better submenu visibility */
.rt-submenu-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.1);
    z-index: 1090;
    display: none;
}

.rt-submenu-backdrop.show {
    display: block;
}

/* Sort System Styles (STEP 4) */

/* Sort Button Styling */
.rt-sort-btn {
    position: relative;
    transition: all 0.2s ease;
}

.rt-sort-btn.active {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: white;
}

.rt-sort-label {
    font-weight: 500;
}

/* Sort Dropdown Styling */
.rt-sort-dropdown {
    min-width: 180px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #e0e0e0;
}

.rt-sort-dropdown .dropdown-header {
    background-color: #f8f9fa;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    padding: 0.5rem 1rem;
    margin: 0;
    border-bottom: 1px solid #e0e0e0;
}

.rt-sort-dropdown .rt-sort-item {
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

.rt-sort-dropdown .rt-sort-item:hover {
    background-color: #f8f9fa;
    color: #0d6efd;
}

.rt-sort-dropdown .rt-sort-item.active {
    background-color: #e7f1ff;
    color: #0d6efd;
    font-weight: 500;
}

.rt-sort-dropdown .rt-sort-item.active::after {
    content: '✓';
    margin-left: auto;
    font-weight: bold;
    color: #0d6efd;
}

/* Sort Status Indicator */
.rt-sort-status {
    background-color: #f0f8ff;
    border: 1px solid #b6d7ff;
    border-radius: 6px;
    padding: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #0d6efd;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rt-sort-status i {
    opacity: 0.7;
}

/* Sort Loading State */
.rt-sort-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.rt-sort-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Sort Animation */
.rt-sort-animating {
    animation: rt-sort-fade 0.3s ease-in-out;
}

@keyframes rt-sort-fade {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Sort Responsive Design */
@media (max-width: 768px) {
    .rt-sort-btn {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }
    
    .rt-sort-dropdown {
        min-width: 160px;
    }
    
    .rt-sort-status {
        font-size: 0.85rem;
        padding: 0.4rem;
        right: -6px;
        font-size: 0.65rem;
        min-width: 16px;
        height: 16px;
    }
    
    .rt-filter-dropdown {
        min-width: 160px;
    }
    
    .rt-clear-all-filters {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }
}

/* Filter No Results Message */
.rt-workspace-no-results {
    background-color: #f8f9fa !important;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    margin: 2rem 0;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.5s ease-in-out;
    width: 100%;
}

.rt-workspace-no-results h5 {
    color: #6c757d;
    font-weight: 600;
}

.rt-workspace-no-results p {
    color: #8a8a8a;
    font-size: 0.95rem;
    max-width: 400px;
    line-height: 1.4;
}

.rt-workspace-no-results small {
    color: #aaa;
    font-size: 0.8rem;
    font-style: italic;
}

.rt-workspace-no-results .fas.fa-filter {
    margin-bottom: 1rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dark mode support for no results */
@media (prefers-color-scheme: dark) {
    .rt-workspace-no-results {
        background-color: #2d3748;
        border-color: #4a5568;
    }
    
    .rt-workspace-no-results h5 {
        color: #a0aec0;
    }
    
    .rt-workspace-no-results p {
        color: #9ca3af;
    }
    
    .rt-workspace-no-results small {
        color: #718096;
    }
}

/* Flat Container Styles (for sorted view) */
.rt-sorted-flat-container {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem !important;
}

.rt-sorted-flat-container .rt-workspace-container-flat {
    display: block;
}

.rt-sorted-flat-container .rt-workspace-container-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0;
    background: none;
    border: none;
}

.rt-sorted-flat-container .rt-workspace-container-title {
    font-weight: 600;
    color: #495057;
    font-size: 1rem;
}

.rt-sorted-flat-container small {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: normal;
}

.rt-sorted-flat-container:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.1);
}

/* Theme Colors for Flat Containers */
.rt-sorted-flat-container.rt-workspace-theme-blue {
    border-left: 4px solid #007bff;
}

.rt-sorted-flat-container.rt-workspace-theme-green {
    border-left: 4px solid #28a745;
}

.rt-sorted-flat-container.rt-workspace-theme-orange {
    border-left: 4px solid #fd7e14;
}

.rt-sorted-flat-container.rt-workspace-theme-purple {
    border-left: 4px solid #6f42c1;
}

.rt-sorted-flat-container.rt-workspace-theme-grey {
    border-left: 4px solid #6c757d;
}