.menu-builder-area {
    margin-top: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    background: #f9f9f9;
    width: 100%;
    max-width: none;
}

.wrap {
    max-width: none !important;
    margin-right: 20px;
}

.card {
    max-width: none;
}

.builder-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ddd;
    align-items: center;
    flex-wrap: wrap;
}

.builder-toolbar .dashicons {
    vertical-align: middle;
    margin-right: 5px;
}

.toolbar-separator {
    width: 1px;
    height: 20px;
    background: #ddd;
    margin: 0 5px;
}

.menu-items-container {
    min-height: 200px;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #666;
}

.empty-state .dashicons {
    font-size: 48px;
    margin-bottom: 10px;
    opacity: 0.5;
}

.menu-item-editor {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 10px;
    padding: 15px;
    position: relative;
}

.menu-item-editor.dropdown {
    border-left: 4px solid #2196f3;
}

.menu-item-editor.mega-menu {
    border-left: 4px solid #9c27b0;
}

.menu-item-editor.collapsed .item-fields,
.menu-item-editor.collapsed .sub-items,
.menu-item-editor.collapsed .mega-menu-columns {
    display: none;
}

.item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    cursor: pointer;
}

.menu-item-editor.collapsed .item-header {
    margin-bottom: 0;
}

.item-title {
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.collapse-toggle {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 2px;
    margin-right: 8px;
    transition: transform 0.2s ease;
}

.collapse-toggle:hover {
    color: #333;
}

.menu-item-editor.collapsed .collapse-toggle {
    opacity: 0.6;
}

.menu-item-editor.collapsed .collapse-toggle .dashicons {
    transform: rotate(-90deg);
    transition: transform 0.2s ease;
}

.collapse-toggle .dashicons {
    transition: transform 0.2s ease;
}

.item-actions,
.column-actions,
.voxfor-row-buttons {
    display: flex;
    gap: 5px;
    align-items: center;
}

.item-actions button,
.column-actions button {
    padding: 4px 8px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.item-actions button:hover,
.column-actions button:hover {
    background: #f0f0f0;
}

.item-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.field-group {
    display: flex;
    flex-direction: column;
}

.field-group label {
    font-weight: 500;
    margin-bottom: 5px;
    color: #333;
}

.field-group input, .field-group select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.sub-items {
    margin-top: 15px;
    padding-left: 20px;
    border-left: 2px solid #e0e0e0;
}

.drag-handle {
    cursor: move;
    color: #999;
    margin-right: 10px;
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 10px 15px;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    margin: 15px 0;
}

.mega-menu-columns {
    margin-top: 15px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
}

/* Responsive column layout */
@media (max-width: 1200px) {
    .mega-menu-columns {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    .mega-menu-columns {
        grid-template-columns: 1fr;
    }
}

.mega-column {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
}

.column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}

.mega-column.collapsed .column-header {
    margin-bottom: 0;
    border-bottom: none;
}

.mega-column.collapsed .column-items {
    display: none;
}

.column-title {
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.column-fields {
    margin-bottom: 15px;
}

.column-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 10px;
}

.column-item .item-header {
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e9ecef;
}

.column-item .item-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.no-items {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
    background: #f8f9fa;
    border: 1px dashed #ddd;
    border-radius: 4px;
}

.column-row {
    background: #f0f4f8;
    border: 1px solid #d1e7dd;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
}

.row-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin-bottom: 15px !important;
    padding: 10px !important;
    border-bottom: 1px solid #b8d4da !important;
    background: rgba(13, 110, 253, 0.05) !important;
    border-radius: 4px 4px 0 0 !important;
    cursor: pointer !important;
    width: 100% !important;
    min-height: 60px !important;
    overflow: visible !important;
    position: relative !important;
}

.column-row.collapsed .row-header {
    margin-bottom: 0;
    border-bottom: none;
    border-radius: 4px;
}

.column-row.collapsed .row-fields,
.column-row.collapsed .row-items {
    display: none;
}

.row-title {
    font-weight: 600;
    color: #0d6efd;
    display: flex;
    align-items: center;
    gap: 8px;
}

.voxfor-row-buttons {
    flex-wrap: wrap;
}

.voxfor-row-buttons button {
    padding: 4px 8px;
    border: 1px solid #0d6efd;
    background: #fff;
    color: #0d6efd;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
    margin: 0 2px;
    transition: all 0.2s ease;
}

.voxfor-row-buttons button:hover {
    background: #0d6efd;
    color: #fff;
}

.voxfor-row-buttons button.add-multiple-items {
    background: #28a745;
    border-color: #28a745;
    color: white;
}

.voxfor-row-buttons button.add-multiple-items:hover {
    background: #218838;
}

.voxfor-row-buttons button.delete-row {
    background: #dc3545;
    border-color: #dc3545;
    color: white;
}

.voxfor-row-buttons button.delete-row:hover {
    background: #c82333;
}

.row-fields {
    margin-bottom: 15px;
}

.row-item {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 10px;
}

.row-item .item-header {
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #dee2e6;
}

.row-item .item-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* Collapsed states */
.menu-item-editor.collapsed,
.mega-column.collapsed,
.column-row.collapsed {
    background: #f8f9fa;
    opacity: 0.8;
}

/* Smooth transitions */
.menu-item-editor .item-fields,
.menu-item-editor .sub-items,
.menu-item-editor .mega-menu-columns,
.mega-column .column-fields,
.mega-column .column-items,
.column-row .row-fields,
.column-row .row-items,
.row-item {
    transition: all 0.3s ease;
}

/* Hover effects */
.collapse-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
    color: #333;
}

.row-item:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

/* Status indicators */
.menu-item-editor.collapsed .item-title::after,
.mega-column.collapsed .column-title::after,
.column-row.collapsed .row-title::after {
    content: " (collapsed)";
    font-size: 12px;
    color: #666;
    font-weight: normal;
}

/* SVG Icon Selector Styles */
.svg-icon-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 12px;
    background: #f9f9f9;
}

.svg-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border: 2px dashed #ddd;
    border-radius: 6px;
    background: white;
    position: relative;
    flex-shrink: 0;
}

.svg-icon-preview {
    max-width: 40px;
    max-height: 40px;
    object-fit: contain;
}

.no-icon-placeholder {
    color: #999;
    font-size: 11px;
    text-align: center;
    line-height: 1.2;
    padding: 4px;
}

.svg-controls {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Styling Actions Section */
.styling-actions {
    background: #f0f8ff;
    border: 2px solid #0073aa;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.styling-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.styling-buttons .button {
    font-size: 14px;
    padding: 8px 16px;
    height: auto;
    line-height: 1.5;
}

#apply-styling {
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

#apply-styling.updated {
    background-color: #46b450 !important;
    border-color: #46b450 !important;
    box-shadow: 0 2px 4px rgba(70, 180, 80, 0.3) !important;
}

#apply-styling.error {
    background-color: #dc3232 !important;
    border-color: #dc3232 !important;
    color: #fff !important;
    box-shadow: 0 2px 4px rgba(220, 50, 50, 0.3) !important;
}

#apply-styling:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
}

.color-control {
    position: relative;
}

.color-control .wp-color-result {
    margin-left: 0 !important;
}

/* Styling controls layout improvements */
.styling-controls {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 1200px) {
    .styling-controls {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .styling-controls {
        grid-template-columns: 1fr;
    }
    
    .styling-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .styling-buttons .button {
        width: 100%;
        max-width: 200px;
    }
}

/* SVG Button Styles */
[class*="select-svg-btn"],
[class*="remove-svg-btn"] {
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    white-space: nowrap;
    color: white;
}

[class*="select-svg-btn"] {
    background: #2271b1;
}

[class*="select-svg-btn"]:hover {
    background: #135e96;
}

[class*="remove-svg-btn"] {
    background: #d63638;
}

[class*="remove-svg-btn"]:hover {
    background: #b32d2e;
}

/* Responsive design for SVG selector */
@media (max-width: 768px) {
    .svg-icon-selector {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
    
    .svg-controls {
        flex-direction: row;
        justify-content: center;
    }
}

/* Styling Controls CSS */
.styling-controls {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.styling-section {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.styling-section h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
    border-bottom: 2px solid #2271b1;
    padding-bottom: 8px;
}

.color-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.color-control {
    display: flex;
    flex-direction: column;
}

.color-control label {
    font-weight: 500;
    margin-bottom: 5px;
    color: #333;
}

.color-picker {
    width: 80px;
    height: 40px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    padding: 0;
}

.color-control .description {
    font-size: 12px;
    color: #666;
    margin: 5px 0 0 0;
    font-style: italic;
}

.styling-preview {
    grid-column: span 3;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    border: 2px solid #2271b1;
    margin-top: 20px;
    margin-bottom: 180px; /* Add space for dropdown preview */
}

.styling-preview h3 {
    margin: 0 0 15px 0;
    color: #2271b1;
    border-bottom: 2px solid #2271b1;
    padding-bottom: 8px;
}

.preview-menu {
    overflow: visible;
    position: relative;
    min-height: 60px; /* Ensure minimum height for the preview */
}

.preview-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    background: var(--bg-color, #ffffff);
    border-radius: 8px;
}

.preview-menu-item {
    position: relative;
}

.preview-link {
    display: block;
    padding: 15px 20px;
    text-decoration: none;
    color: var(--text-color, #333333);
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    cursor: default;
}

.preview-menu-item.preview-hover .preview-link {
    background: var(--bg-hover-color, #f8f9fa);
    color: var(--text-hover-color, #2071e4);
}

.preview-menu-item.preview-active .preview-link {
    color: var(--text-active-color, #2071e4);
    border-bottom-color: var(--text-active-color, #2071e4);
}

.preview-dropdown {
    position: absolute;
    top: 100%;
    left: 20px;
    width: 200px;
    background: var(--dropdown-bg-color, #ffffff);
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow-color, rgba(0,0,0,0.1));
    margin-top: 5px;
    z-index: 1; /* Lower z-index to not interfere with other elements */
}

.preview-dropdown-list {
    list-style: none;
    margin: 0;
    padding: 10px 0;
}

.preview-dropdown-list li {
    padding: 0;
}

.preview-dropdown-link {
    display: block;
    padding: 10px 20px;
    color: var(--text-color, #333333);
    transition: all 0.3s ease;
    cursor: default;
}

.preview-dropdown-link:hover {
    background: var(--bg-hover-color, #f8f9fa);
    color: var(--text-hover-color, #2071e4);
}

/* Tablet view - 2 columns */
@media (max-width: 1024px) and (min-width: 769px) {
    .styling-controls {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
    
    .styling-preview {
        grid-column: span 2;
    }
}

/* Mobile view - 1 column */
@media (max-width: 768px) {
    .styling-controls {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .styling-preview {
        grid-column: span 1;
        margin-bottom: 200px; /* More space on mobile */
    }
    
    .preview-menu-list {
        flex-direction: column;
    }
    
    .preview-dropdown {
        position: static; /* Static positioning on mobile */
        width: 100%;
        margin-top: 15px;
        z-index: auto;
    }
}

/* Additional inline style replacements */
.notice-inline-spacing {
    margin: 10px 0;
}

.notice-list-spacing {
    margin: 5px 0 0 20px;
}

.add-mega-menu-btn {
    background: #9c27b0 !important;
    color: white !important;
    border-color: #9c27b0 !important;
} 