.fastevo-mp2-editor-block {
    padding: 15px;
    background: #f7f7f7;
    border: 1px solid #e0e0e0;
    
    // Content ID field with action icons - completely restructured
    .fastevo-mp2-content-id-wrapper {
        margin-bottom: 16px;
        
        .fastevo-mp2-content-id-label {
            display: block;
            margin-bottom: 8px;
            font-size: 13px;
            font-weight: 500;
        }
        
        .fastevo-mp2-content-id-field-group {
            display: flex;
            align-items: center;
            width: 100%;
            
            .components-text-control__input {
                flex: 1;
                height: 36px;
                margin: 0;
                border-radius: 4px;
                border: 1px solid #757575;
                padding: 6px 8px;
                
                &:focus {
                    border-color: #1e73be;
                    box-shadow: 0 0 0 1px #1e73be;
                }
            }
            
            .fastevo-mp2-content-browse, 
            .fastevo-mp2-content-upload {
                width: 36px;
                height: 36px;
                flex: 0 0 36px;
                padding: 0;
                margin-left: 4px;
                border: none;
                border-radius: 4px;
                cursor: pointer;
                color: white;
                display: flex;
                align-items: center;
                justify-content: center;
                transition: background-color 0.2s;
                
                .dashicon {
                    margin: 0;
                }
            }
            
            // Search button
            .fastevo-mp2-content-browse {
                background-color: #1e73be;
                
                &:hover {
                    background-color: #135e9e;
                }
            }
            
            // Upload button
            .fastevo-mp2-content-upload {
                background-color: #00a32a;
                
                &:hover {
                    background-color: #008a20;
                }
            }
        }
        
        .components-base-control__help {
            margin-top: 4px;
            font-size: 12px;
            color: #757575;
        }
    }
    
    // Configuration Mode - Before embedding
    .fastevo-mp2-config-mode {
        h3 {
            margin-top: 0;
            margin-bottom: 15px;
            font-size: 16px;
            color: #333;
        }
        
        .components-text-control__input {
            margin-bottom: 6px;
        }
        
        .fastevo-mp2-block-advanced-options {
            margin-top: 15px;
            margin-bottom: 15px;
            border: 1px solid #e0e0e0;
            border-radius: 4px;
            
            .components-panel__body-title {
                background-color: #f0f0f0;
            }
            
            .components-panel__body-toggle {
                font-weight: 600;
            }
        }
        
        .components-panel__body {
            border: none;
        }
        
        .components-panel__body-title {
            margin-bottom: 8px;
        }
        
        .fastevo-mp2-embed-button-container {
            margin-top: 15px;
            
            button {
                padding: 6px 15px;
            }
        }
    }
    
    // Preview Mode - After embedding
    .fastevo-mp2-preview-mode {
        position: relative;
        
        .fastevo-mp2-loading {
            text-align: center;
            padding: 20px;
            color: #555;
        }
        
        .fastevo-mp2-error {
            padding: 15px;
            background: #fff5f5;
            border: 1px solid #ffb8b8;
            border-radius: 4px;
            
            p {
                margin-top: 0;
                margin-bottom: 15px;
            }
        }
        
        .fastevo-mp2-controls {
            position: absolute;
            top: 10px;
            right: 10px;
            z-index: 10;
            opacity: 0.7;
            
            &:hover {
                opacity: 1;
            }
            
            .fastevo-mp2-edit-button {
                padding: 2px 8px;
                font-size: 11px;
                background: rgba(255, 255, 255, 0.8);
                box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
            }
        }
        
        .fastevo-mp2-preview-embed {
            min-height: 100px;
            background: #222;
            color: #fff;
            border-radius: 4px;
            overflow: hidden;
        }
    }
}

// Content Selector Modal
.fastevo-mp2-content-selector-modal {
    max-width: 95% !important;
    width: 1200px !important;
    max-height: 90vh !important;
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2) !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    z-index: 100010 !important; // Make sure modal is above block editor
    background-color: white !important; // Ensure modal has a background
    display: flex !important; // Use flexbox layout
    flex-direction: column !important; // Stack header and content
    // Ensure no blurring filter
    filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    
    .components-modal__header {
        height: 40px !important;
        min-height: 40px !important;
        padding: 0 16px !important;
        border-bottom: 1px solid #e0e0e0;
        background-color: #f9f9f9 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        
        .components-modal__header-heading {
            font-size: 14px !important;
            font-weight: 600 !important;
        }
        
        .components-button {
            padding: 8px !important;
            position: absolute !important;
            right: 4px !important;
            top: 50% !important;
            transform: translateY(-50%) !important;
            height: 36px !important;
            width: 36px !important;
            display: flex !important;
            align-items: center !important;
            justify-content: center !important;
            
            svg {
                display: block !important;
                margin: 0 auto !important;
            }
        }
    }
    
    .components-modal__content {
        padding: 0 !important;
        margin: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: auto !important; // Allow scrolling
        flex-grow: 1 !important; // Take up available space
        
        &::before {
            margin-bottom: 0 !important;
        }
    }
    
    // Ensure proper spacing for modal header
    .components-modal__header {
        margin-bottom: 0 !important;
    }
    
    // Content selector container for iframe (upload mode)
    .fastevo-mp2-content-selector-container {
        height: calc(90vh - 40px);
        flex: 1;
        overflow: hidden;
        aspect-ratio: 16 / 9; // Maintain aspect ratio for iframe
        
        .fastevo-mp2-content-selector-iframe {
            width: 100%;
            height: 100%;
            border: none;
            display: block;
        }
    }
    
    // Media content browser UI
    .fastevo-mp2-content-browser {
        display: flex !important;
        flex-direction: column !important;
        height: auto !important; 
        min-height: 500px !important;
        flex: 1 1 auto !important;
        padding: 20px !important;
        overflow-y: auto !important;
        background-color: #f8f9fa !important;
        // Ensure no blurring filter
        filter: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        transform: none !important;
        
        // CRITICAL FIX: Force toolbar to always display
        .fastevo-mp2-browser-toolbar {
            display: block !important;
            visibility: visible !important;
            opacity: 1 !important;
        }
        
        // Folder path display
        .fastevo-mp2-folder-path {
            display: flex;
            align-items: center;
            background-color: #fff;
            padding: 12px 15px;
            border-radius: 4px;
            margin-top: 10px; // Add space between modal title and folder path
            margin-bottom: 20px;
            border: 1px solid #e0e0e0;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
            
            .dashicon {
                color: #f7b52a;
                margin-right: 10px;
            }
            
            span {
                font-weight: 500;
                color: #333;
                font-size: 14px;
            }
        }
        
        // Search form
        .fastevo-mp2-search-form {
            display: flex;
            margin-bottom: 20px;
            
            .fastevo-mp2-search-input {
                flex-grow: 1;
                border: 1px solid #ddd;
                border-radius: 4px 0 0 4px;
                padding: 10px 12px;
                font-size: 14px;
                height: 42px;
                
                &:focus {
                    border-color: #1e73be;
                    box-shadow: 0 0 0 1px #1e73be;
                    outline: none;
                }
            }
            
            .fastevo-mp2-search-button {
                background-color: #1e73be;
                border: none;
                color: white;
                padding: 0;
                width: 42px;
                height: 42px;
                border-radius: 0 4px 4px 0;
                cursor: pointer;
                display: flex;
                align-items: center;
                justify-content: center;
                
                &:hover {
                    background-color: #135e9e;
                }
            }
        }
        
        // Loading state
        .fastevo-mp2-loading {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 60px 0;
            background: #fff;
            border-radius: 4px;
            flex: 1;
            
            .components-spinner {
                margin: 0 auto 15px;
            }
            
            p {
                color: #555;
                font-size: 14px;
                margin: 0;
            }
        }
        
        // Error state
        .fastevo-mp2-error {
            background-color: #fff5f5;
            border: 1px solid #ffb8b8;
            color: #d63638;
            padding: 20px;
            border-radius: 4px;
            margin-bottom: 20px;
            text-align: center;
            
            p {
                margin-top: 0;
                margin-bottom: 15px;
                font-size: 14px;
            }
        }
        
        // Browser content
        .fastevo-mp2-browser-content {
            flex: 1;
            display: flex;
            flex-direction: column;
            // Ensure no blurring filter
            filter: none !important;
            backdrop-filter: none !important;
            -webkit-backdrop-filter: none !important;
            transform: none !important;
            
            // Folders section
            .fastevo-mp2-folders-section {
                margin-bottom: 20px;
                // Ensure no blurring filter
                filter: none !important;
                backdrop-filter: none !important;
                -webkit-backdrop-filter: none !important;
                transform: none !important;
                
                .fastevo-mp2-folder-item {
                    display: flex;
                    align-items: center;
                    padding: 12px 15px;
                    background-color: #fff;
                    border: 1px solid #e0e0e0;
                    border-radius: 4px;
                    margin-bottom: 8px;
                    cursor: pointer;
                    transition: background-color 0.2s ease, border-color 0.2s ease;
                    
                    &:hover {
                        background-color: #f7fafd;
                        border-color: #c7d9f1;
                    }
                    
                    .dashicon {
                        color: #f7b52a;
                        margin-right: 10px;
                    }
                    
                    span {
                        font-weight: 500;
                        font-size: 14px;
                    }
                    
                    // Special styling for upload folder item
                    &.fastevo-mp2-upload-folder-item {
                        background-color: #eef7ee;
                        border-color: #d1e7d1;
                        
                        &:hover {
                            background-color: #e1f0e1;
                            border-color: #b5d8b5;
                            transform: none;
                        }
                        
                        .dashicon {
                            color: #00a32a;
                        }
                    }
                }
            }
            
            // Contents section
            .fastevo-mp2-contents-section {
                display: flex;
                flex-direction: column;
                // Ensure no blurring filter
                filter: none !important;
                backdrop-filter: none !important;
                -webkit-backdrop-filter: none !important;
                transform: none !important;
                
                .fastevo-mp2-content-item {
                    display: flex;
                    padding: 15px;
                    background-color: #fff;
                    border: 1px solid #e0e0e0;
                    border-radius: 4px;
                    margin-bottom: 10px;
                    cursor: pointer;
                    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
                    
                    &:hover {
                        background-color: #f7fafd;
                        border-color: #c7d9f1;
                        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
                    }
                    
                    .fastevo-mp2-content-icon {
                        display: flex;
                        align-items: center;
                        justify-content: center;
                        width: 40px;
                        height: 40px;
                        min-width: 40px;
                        background-color: #f2f3f5;
                        border-radius: 4px;
                        margin-right: 15px;
                        
                        .dashicon {
                            color: #1e73be;
                        }
                        
                        // Specific icon colors
                        .dashicon-video-alt3 {
                            color: #d63638; // Red for video
                        }
                        
                        .dashicon-format-audio {
                            color: #00a32a; // Green for audio
                        }
                        
                        .dashicon-format-image {
                            color: #8c5ad2; // Purple for images
                        }
                    }
                    
                    .fastevo-mp2-content-poster {
                        position: relative;
                        overflow: hidden;
                        width: 60px;
                        height: 60px;
                        min-width: 60px;
                        border-radius: 4px;
                        margin-right: 15px;
                        background-color: #000;
                        
                        img {
                            position: relative;
                            z-index: 2;
                        }
                    }
                    
                    .fastevo-mp2-content-details {
                        flex-grow: 1;
                        
                        h4 {
                            margin: 0 0 5px 0;
                            font-size: 14px;
                            color: #333;
                            font-weight: 600;
                            line-height: 1.4;
                            
                            .fastevo-mp2-content-id {
                                font-weight: normal;
                                color: #666;
                                font-size: 12px;
                                margin-left: 8px;
                            }
                        }
                        
                        .fastevo-mp2-content-meta {
                            display: flex;
                            align-items: center;
                            font-size: 12px;
                            
                            .fastevo-mp2-content-type {
                                background-color: #e9f5fe;
                                color: #0078a5;
                                padding: 3px 8px;
                                border-radius: 3px;
                                margin-right: 8px;
                                font-size: 11px;
                                text-transform: uppercase;
                                letter-spacing: 0.5px;
                                font-weight: 500;
                            }
                            
                            .fastevo-mp2-content-status {
                                background-color: #edfaef;
                                color: #1e7e34;
                                padding: 3px 8px;
                                border-radius: 3px;
                                font-size: 11px;
                                text-transform: uppercase;
                                letter-spacing: 0.5px;
                                font-weight: 500;
                                
                                &.processing {
                                    background-color: #fff8e5;
                                    color: #915700;
                                }
                                
                                &.error {
                                    background-color: #ffebec;
                                    color: #d63638;
                                }
                                
                                &.queued {
                                    background-color: #e9ebfc;
                                    color: #6a6ad5;
                                }
                            }
                        }
                    }
                }
            }
            
            // No content state
            .fastevo-mp2-no-content {
                text-align: center;
                padding: 40px 20px;
                background-color: #fff;
                border-radius: 4px;
                color: #555;
                border: 1px dashed #ddd;
                
                p {
                    margin: 0;
                    font-size: 14px;
                }
            }
            
            // Pagination
            .fastevo-mp2-pagination {
                display: flex;
                align-items: center;
                justify-content: center;
                margin-top: 20px;
                padding-top: 20px;
                border-top: 1px solid #e0e0e0;
                
                .components-button {
                    height: 32px;
                    min-height: 32px;
                    padding: 0 12px;
                    
                    &:disabled {
                        opacity: 0.5;
                    }
                }
                
                .fastevo-mp2-page-info {
                    margin: 0 15px;
                    font-size: 13px;
                    color: #555;
                }
            }
        }
    }
    
    // Tablet breakpoint
    @media (max-width: 782px) {
        width: 95vw !important;
        max-height: 95vh !important;
        border-radius: 4px !important;
        
        .components-modal__header {
            height: 32px !important;
            min-height: 32px !important;
        }
        
        .fastevo-mp2-content-selector-container {
            height: calc(95vh - 32px);
        }
        
        .fastevo-mp2-content-browser {
            height: calc(95vh - 32px);
            padding: 15px;
            
            // Improve folder path display on tablet
            .fastevo-mp2-folder-path {
                padding: 10px 12px;
                
                span {
                    font-size: 13px;
                    max-width: 300px;
                    white-space: nowrap;
                    overflow: hidden;
                    text-overflow: ellipsis;
                }
            }
            
            // More compact search form
            .fastevo-mp2-search-form {
                margin-bottom: 15px;
                
                .fastevo-mp2-search-input {
                    height: 38px;
                    padding: 8px 10px;
                    font-size: 13px;
                }
                
                .fastevo-mp2-search-button {
                    width: 38px;
                    height: 38px;
                }
            }
            
            // More compact content items
            .fastevo-mp2-content-item {
                padding: 10px;
                
                .fastevo-mp2-content-icon {
                    width: 32px;
                    height: 32px;
                    min-width: 32px;
                    margin-right: 10px;
                }
                
                .fastevo-mp2-content-details h4 {
                    font-size: 13px;
                }
            }
            
            // Compact folders
            .fastevo-mp2-folder-item {
                padding: 8px 10px;
                
                span {
                    font-size: 13px;
                }
            }
        }
    }
    
    // Mobile breakpoint
    @media (max-width: 600px) {
        .fastevo-mp2-content-browser {
            padding: 10px;
            
            // Even more compact folder path
            .fastevo-mp2-folder-path {
                padding: 8px 10px;
                margin-bottom: 15px;
                
                span {
                    max-width: 200px;
                }
                
                .dashicon {
                    font-size: 18px;
                }
            }
            
            // Full-width search form
            .fastevo-mp2-search-form {
                width: 100%;
                max-width: 100%;
            }
            
            // More compact folder and content items for mobile
            .fastevo-mp2-folder-item,
            .fastevo-mp2-content-item {
                padding: 8px;
            }
            
            // Smaller pagination on mobile
            .fastevo-mp2-pagination {
                margin-top: 15px;
                padding-top: 15px;
                
                .components-button {
                    padding: 0 8px;
                    height: 30px;
                    min-height: 30px;
                    font-size: 12px;
                }
                
                .fastevo-mp2-page-info {
                    margin: 0 8px;
                    font-size: 12px;
                }
            }
        }
    }
}

// Modal overlay styling
.fastevo-mp2-content-selector-overlay {
    background-color: rgba(0, 0, 0, 0.7) !important;
    animation: fastevo-fade-in 0.2s ease-in-out !important;
    z-index: 100005 !important; // Ensure it's above everything but below the modal
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

// Animation for modal appearance
@keyframes fastevo-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}